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
L

Larry Rutledge

@Larry Rutledge
About
Posts
2
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • HTTP Read w/ Authentication
    L Larry Rutledge

    I used the following code to download the source of an HTML page: ... try { // _url is a private variable which contains the URL to download HttpWebRequest _request = (HttpWebRequest)WebRequest.Create(_url); if (_useProxy) { WebProxy _proxy = new WebProxy(_proxyHost + ":" + _proxyPort.ToString()); _request.Proxy = _proxy; } HttpWebResponse _response = (HttpWebResponse)_request.GetResponse(); if (_response.StatusCode == HttpStatusCode.OK) { Stream _stream = _response.GetResponseStream(); StreamReader _streamReader = new StreamReader(_stream, Encoding.UTF8); MessageBox.Show(_streamReader.ReadToEnd().Trim()); } catch (WebException we) { // HTTP response was not "OK", handle HTTP error } catch (Exception e) { // Handle exception } ... My question is, what if the page I need to access requires authentication. In other words, when browsing normally, with a web browser client, a dialog pops up asking for my username and password. I have the access information, but I want the preceding code to be able to send that authentication information along and get the code without any user intervention. Any ideas?

    C# question html security help

  • Web Service Question
    L Larry Rutledge

    Before I ask my question, let me give some quick background. My current employer has recently decided that downloading certain files (.zip, .exe, etc) slows down the internet performance for the rest of the internet users. So, as a result, they have modified the proxy server to no longer allow such downloads during peak internet hours (8:00 - 3:00 PST). Because of this, I am no longer allowed to download files I need for work without writing a 3 page justification and getting it signed off by 3 levels of managers and then waiting for the right department to give me access and hope the access they give me has a long enough window to get what I need. That's the background, now here's my question. Is it possible, and if so any ideas on how to go about it, to create a web service which I could give a URL (presumably to a .zip or .exe file) and it would get the file and then stream it to my client? I am still able to consume web services through our proxy, so this would solve my dilemma. Thanks in advance for any ideas, suggestions, help, pointers, etc. Larry

    C# question wcf sysadmin json performance
  • Login

  • Don't have an account? Register

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