473,656 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

28 New Member
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.
Apr 16 '08 #1
2 2981
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
Expand|Select|Wrap|Line Numbers
  1. System.Net.HttpWebRequest request = new System.Net.HttpWebRequest();
  2. System.Net.WebProxy wp = new System.Net.WebProxy("http://myproxyserver");
  3. wp.Credentials = new System.Net.NetworkCredential("username", "password");
  4. request.Proxy = wp;
send the webrequest to the website using the request object
Apr 16 '08 #2
minhtran
28 New Member
Expand|Select|Wrap|Line Numbers
  1. System.Net.HttpWebRequest request = new System.Net.HttpWebRequest();
  2. System.Net.WebProxy wp = new System.Net.WebProxy("http://myproxyserver");
  3. wp.Credentials = new System.Net.NetworkCredential("username", "password");
  4. 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
Apr 16 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
7088
by: spdude | last post by:
I have written a windows app to request a file from www.hotmail.com and i get the following error: ************* Exception Text ************** System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required. My code: private void Download(String strFinalURL)
3
3025
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it identifies itself as the computer name which is not in domain.com format, triggering spam filter problems). Instead, I want to have my code send through an SMTP server of a company that we pay for mail service. But they require a username and password....
5
5273
by: SK | last post by:
Hi, We have 2 Servers in our Production Environment. Inside our application I am calling a Webservice in Production Server 2 from Production Server 1. It is failing. But when I try to open the webservice from Production 1 Server using IE, it is working. Initially I don't have web proxy object in my code, then after reading couple of posting, I tried that also, it won't help much. I tried to use the Proxy object forcefully, no result....
11
3222
by: volcano | last post by:
Hello, folks! A trivial question - I have a working Python script that I have to invoke from C++ code. No fancy stuff - just run the whole script with its parameters. No callbacks, no signalling - nada, just stupid,primitive, straightforward call. And while there is a lot of help on embedding, I could not find out how to run script as a whole.SOS!!!!
11
12300
by: Phoe6 | last post by:
Hi, The following piece of code works properly when my proxy password contains characters etc. But when my proxy password contained something like '|\/|' , the httplib incorrectly indentified it as separator. How do I resolve this issue. <code> # Proxy Address PROXY_IP = "1.1.9.8:80"
0
1059
by: talktozee | last post by:
Ok, so I have to reuse some VB that was used in an ASP page in a place where I can only use straight VB code. And of course Server.MapPath doesn't work. Any ideas? Thanks!
0
3830
by: shamirza | last post by:
· What is view state and use of it? The current property settings of an ASP.NET page and those of any ASP.NET server controls contained within the page. ASP.NET can detect when a form is requested for the first time versus when the form is posted (sent to the server), which allows you to program accordingly. · What are user controls and custom controls? Custom controls: A control authored by a user or a third-party software vendor that...
2
1149
by: BigWilli | last post by:
I need it to open my old modules. Would be very happy! Email: Removed as per posting guidelines]
5
2283
by: gilbertsavier | last post by:
Hello friends, I have one task, That is we create a bar diagram ,the data are stored in database, for example New York population is 10000 at 2000 year then next year at 2001 population is 10100 so here we draw the bar 2000,2001 up to 2010.so we apply different colors for the year. So anybody develop the code in php send me. Thanks in advance for your help. Regards, Gilbertsavier. <link...
0
8380
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8497
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8598
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.