PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework webrequest ignores proxy on PPC2003

Reply

webrequest ignores proxy on PPC2003

 
Thread Tools Rate Thread
Old 03-03-2006, 03:13 PM   #1
allan teo
Guest
 
Posts: n/a
Default webrequest ignores proxy on PPC2003


Hi
I was testing out the MSDN example and I noted that
any proxy settings I choose for web request has no effect.

Is this a known problem? I tried this
on the Ipaq 6500 phone series.

Allan


Sub Main()

Dim myWebRequest As HttpWebRequest =
CType(WebRequest.Create("http://www.microsoft.com"), HttpWebRequest)

Dim myProxy As New WebProxy

' Obtain the 'Proxy' of the Default browser.

myProxy = CType(myWebRequest.Proxy, WebProxy)

dim proxyAddress As String

proxyAddress = ""

proxyAddress = "http://no.such.proxy:9090"



If proxyAddress.Length = 0 Then

myWebRequest.Proxy = myProxy

Else


Dim username As String = "Rubbish"

Dim password As String = "Rubbish"

' Create a new Uri object.

Dim newUri As New Uri(proxyAddress)

' Associate the newUri object to 'myProxy' object so that new myProxy
settings can be set.

myProxy.Address = newUri

' Create a NetworkCredential object and associate it with the Proxy property
of request object.

myProxy.Credentials = New NetworkCredential(username, password)

myProxy.BypassProxyOnLocal = False



myWebRequest.Proxy = myProxy

End If



Dim myWebResponse As HttpWebResponse = CType(myWebRequest.GetResponse(),
HttpWebResponse)

End Sub

End Module






  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off