TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Karthi Keyan
1k
755
238.6k
Donwload file from Website.
May 19 2017 1:29 AM
Hi All,
I use the below code to download the file from one website. but it's not working. it's not downloading the file.
In my code, the invoke is a HtmlElement that have the href attribute. the attribute value is URL link.
foreach (HtmlElement invoke in aa)
{
if(invoke.InnerText == "epub")
{
string dwnlodpath = invoke.GetAttribute("href");
WebClient client = new WebClient();
DownloadProgressChangedEventHandler(ProgressChanged);
client.DownloadFileAsync(new Uri(dwnlodpath), @"D:\");
}
}
and also i tried without WebClient by invoke the link. Like follow,
foreach (HtmlElement invoke in aa)
{
if(invoke.InnerText == "epub")
{
invoke.InvokeMember("click");
}
}
but it was asking open or save option. i dont need that option. it automatically save the file in specified path. and how can i use the crome browser for this downloading. help me to solve this issue.
Thankz in advance.
Reply
Answers (
1
)
generate pdf then send it to mail
How to remove the space betweeen two string in C#?