WebRequest.Response takes long time...
-
Hi, I am trying to download a file from server using WebRequest object. The following is my algorithm. 1. Create a WebRequest object WebRequest req = WebRequest.Create(); 2. Set the method to the request object req.Method = "GET"; 3. Set the current user credentials req.Credentials = CredentialCache.DefaultCredentials; 4. Get the response WebResponse res = req.GetResponse(); 5. Get the response stream Stream inStream - res.GetResponseStream(); 6. Save the stream to the local file. GetReponse takes lot of time and I want to optimize the same. Can anyone suggest me what settings I can make so that I can reduce the time. I will be downloading the files from within the intranet. Thanks for any suggestions V. Srinivas
-
Hi, I am trying to download a file from server using WebRequest object. The following is my algorithm. 1. Create a WebRequest object WebRequest req = WebRequest.Create(); 2. Set the method to the request object req.Method = "GET"; 3. Set the current user credentials req.Credentials = CredentialCache.DefaultCredentials; 4. Get the response WebResponse res = req.GetResponse(); 5. Get the response stream Stream inStream - res.GetResponseStream(); 6. Save the stream to the local file. GetReponse takes lot of time and I want to optimize the same. Can anyone suggest me what settings I can make so that I can reduce the time. I will be downloading the files from within the intranet. Thanks for any suggestions V. Srinivas
Hi, There is a direct method to download file WebClient.DownloadFile very simple. I am using this, not very sure this help u in performance improvement. cool man