4
Answers

supress open/save dialog in c# web broser control while down

Ask a question
Mai Hu Na

Mai Hu Na

11y
2.1k
1
here is my code i used web client and pass my link to load file but file created in
folder contain htmlscript tag instead file content whats the wrong.see attach file


  foreach (HtmlElement link in row.GetElementsByTagName("A"))
  {
  bool isFound = false;
  string url = "";
  isFound = true;
  mshtml.HTMLAnchorElement anchor = link.DomElement as HTMLAnchorElement;
  if (anchor != null)
  {
  url = anchor.href;
  }
  if (isFound && url != "")
  {
  WebClient client = new WebClient();
  client.UseDefaultCredentials = true;
  var fileName = @"C:\DownLoads\070813.GACT";
  client.DownloadFile(url, fileName);
  }
  }

Attachment: 070813.rar

Answers (4)