Proxy Authentication Error...

tealmad

Member
Joined
Jul 12, 2005
Messages
6
Location
USA
Programming Experience
1-3
Hi all.

I have created a Windows Service that runs every 8 minutes to go out and get the current weather for several of our company's locations. To access the internet, we are required to provide a username and a password. This has to do with our proxy. After 8 hours of INITIALLY logging in, the authentication expires requiring authentication again.

My VB.NET 2005 application does not have this implemented. I would like to create a sub routine that gets called everytime the service goes out to the internet for the current weather. I don't know how to code this and my searches have come up with nothing.

Can someone help me with a code example as to how I would authenticate so my .NET app can access the internet without getting a 407 error. Proxy Authentication Required.

Thanks.

Greggory
 
Just wanted to step in and let you know that I was able to authenticate through the proxy using the following method:


VB.NET:
Private proxyLoginId As String = "username"
Private proxyPassword As String = "password"

'LOG ON TO THE PROXY.
        Try
            Dim makeReq As HttpWebRequest
            Dim giveCred As NetworkCredential
            makeReq = WebRequest.Create("http:\\www.google.com")
            giveCred = New NetworkCredential(proxyLoginId, proxyPassword)
            makeReq.Proxy = New System.Net.WebProxy("111.111.111.1", 9119)
            makeReq.Proxy.Credentials = giveCred
        Catch ex As Exception
            writeToLog(ex.Message.ToString())
        End Try
 
Web Proxy

Hi,

i am making a module which can send automatic email from google smtp server. but going to google i need to pass my network proxy.


how can i will automatic get windows details and bypass proxy?

or use windows detail to fill proxy and use it.

Regards,
Syed
 
Back
Top