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. ASP.NET
  4. How to set proxy Credentials to WebRequest ?

How to set proxy Credentials to WebRequest ?

Scheduled Pinned Locked Moved ASP.NET
csharphtmlasp-netcomhelp
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.
  • V Offline
    V Offline
    VenkataRamana Gali
    wrote on last edited by
    #1

    Hi, in my asp.net 1.1 application, i am sending request to another site, getting response from there. my code is strUrl =" http://www.xyz.com/xyz.html"; WebRequest request = WebRequest.Create(strUrl); request.Credentials = CredentialCache.DefaultCredentials; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); if(response.StatusDescription == "OK") { //my logic here } my problem is instead of Default Credentials, i want to give proxy userid, password to it. (because without proxy credentials i am unable to access the xyz.com) anybody give me solution for this?

    regards GV Ramana

    A 1 Reply Last reply
    0
    • V VenkataRamana Gali

      Hi, in my asp.net 1.1 application, i am sending request to another site, getting response from there. my code is strUrl =" http://www.xyz.com/xyz.html"; WebRequest request = WebRequest.Create(strUrl); request.Credentials = CredentialCache.DefaultCredentials; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); if(response.StatusDescription == "OK") { //my logic here } my problem is instead of Default Credentials, i want to give proxy userid, password to it. (because without proxy credentials i am unable to access the xyz.com) anybody give me solution for this?

      regards GV Ramana

      A Offline
      A Offline
      Abhishek Chatterjee
      wrote on last edited by
      #2

      Hi buddy, add the following code to supply ur username and password WebProxy myproxy=new WebProxy("proxy server IP",port); myproxy.Credentials=new NetworkCredential("user name","password","domain"); request.Proxy=myproxy; regards, abhishek:-> "If u believe in psychokinesis then raise my hand." :-)

      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