Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. WebRequest.Response takes long time...

WebRequest.Response takes long time...

Scheduled Pinned Locked Moved Web Development
sysadminalgorithmscode-review
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 1401496
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • U User 1401496

      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

      P Offline
      P Offline
      Pradeep Shamarao
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups