C# Скачать файл

bool DownLoadFile()
{
  WebClient myWebClient = new WebClient();
  myWebClient.DownloadFile("http://e-trust.gosuslugi.ru/CA/DownloadTSL?schemaVersion=0", @"c:\temp\ListOfCA.xml");
  return true;
}


///с Proxy
        public static bool DownLoadFile()
        {
            WebProxy wproxy = new WebProxy("10.10.0.2:8080", true);
            wproxy.Credentials = new NetworkCredential("int", "FSinet1234","fsrar");

            WebClient myWebClient = new WebClient();
            myWebClient.Proxy = wproxy;
            myWebClient.DownloadFile("http://e-trust.gosuslugi.ru/CA/DownloadTSL?schemaVersion=0", @"\\iis2\certs\ListOfCA.xml");
            
            return true;
        }

No comments:

Post a Comment

Note: only a member of this blog may post a comment.