Mai Hu Na

Mai Hu Na

  • NA
  • 86
  • 133.3k

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

Jul 11 2013 1:57 AM
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)