How does WebRequest work?

  • Thread starter Thread starter Tosco
  • Start date Start date
T

Tosco

I'm trying to use for the first time WebRequest, but all the simplest
examples that I find in the documentation or Internet don't work.

For example this:
Public Shared Sub Main()
Dim request As WebRequest = WebRequest.Create("http://
www.google.com")
Dim response As WebResponse = request.GetResponse()
End Sub
Throws this WebException.InnerException:
"An attempt was made to access a socket in a way forbidden by its
access permissions"

The same happens trying to run the example in the documentation of the
"WebRequest Class" (ms-help://MS.VSExpressCC.v80/
MS.NETFramework.v20.en/cpref10/html/T_System_Net_WebRequest.htm)

Why I'm not able to run the very example distributed with the
documentation?

Thanks,
Stefano
 
Back
Top