Anyone knows how to code(.NET) send username and password to Proxy Server ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • minhtran
    New Member
    • Feb 2008
    • 28

    Anyone knows how to code(.NET) send username and password to Proxy Server ?

    Hi All
    Anyone knows how to code(ASP.NET, C#,VB.NET) as to send username and password to Proxy Server required to reach web page (That means you code as programming automatically get web page without enter username password again, cause of your coding has username and password "Our server asks username and password for external communication") . Thank you in advance for anyone read this question. Please, anyone has this idea to share, Thanks a lot to all.
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    Code:
    System.Net.HttpWebRequest request = new System.Net.HttpWebRequest();
    System.Net.WebProxy wp = new System.Net.WebProxy("http://myproxyserver");
    wp.Credentials = new System.Net.NetworkCredential("username", "password");
    request.Proxy = wp;
    send the webrequest to the website using the request object

    Comment

    • minhtran
      New Member
      • Feb 2008
      • 28

      #3
      Originally posted by Shashi Sadasivan
      Code:
      System.Net.HttpWebRequest request = new System.Net.HttpWebRequest();
      System.Net.WebProxy wp = new System.Net.WebProxy("http://myproxyserver");
      wp.Credentials = new System.Net.NetworkCredential("username", "password");
      request.Proxy = wp;
      send the webrequest to the website using the request object

      Thank you Shashi Sadsivan
      IT works now, Please, take a big appreciation from me (Sydney-Australia). Thank you very much for your help (Without your help I can't do a good Job). Thank you all

      Comment

      Working...