Reply to thread

I regret very much the delay. Finally, i think found a elegant solution, without "if" and working at least for this two webs. (I guess that this solution work for all webs).


[code]    public static void DownLoadImage(string strURL, string strFile)

      try

      {

        HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(strURL);

        wr.Timeout = 20000;

...

[/code]


PATCH


[code]    public static void DownLoadImage(string strURL, string strFile)

      try

      {

        HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(strURL);

        wr.Timeout = 20000;


        //Set UserAgent = "Any UserAgent"

       wr.UserAgent = "Mozilla/8.0 (compatible; MSIE 9.0; Windows NT 6.1; .NET CLR 1.0.3705;)";


        //Accept All

        wr.Accept = "*/*";

...

[/code]

With this two lines, this code works fine for me No need for set any other header, like language, etc.



Additional Observation


This old procedure entry uses WebClient, but i think is not used anymore. (from 1.9)

[code]

    public static void DownLoadImage(string strURL, string strFile, System.Drawing.Imaging.ImageFormat imageFormat)

[/code]


Greetings from Spain!!!


Top Bottom