Hi
I am trying to create a web request. I have taken some examples out of the
documentation for .NET and the code i am using is show below.
Dim objWebRequest As WebRequest = WebRequest.Create
("http://localhost/testcompile/AdminAttributes.aspx")
Dim objWebResponse As WebResponse = objWebRequest.GetResponse
I keep getting an error saying i am unauthorized. Does anyone know how i
get round this. The full error message is shown below
The remote server returned an error: (401) Unauthorized.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote server returned an
error: (401) Unauthorized.
Source Error:
Line 296:
Line 297: Dim objWebRequest As WebRequest = WebRequest.Create
("http://localhost/testcompile/AdminAttributes.aspx")
Line 298: Dim objWebResponse As WebResponse
objWebRequest.GetResponse
Line 299:
Line 300:
Source File: c:\inetpub\wwwroot\Compiler\WebForm1.aspx.vb Line: 298
Stack Trace:
[WebException: The remote server returned an error: (401) Unauthorized.]
System.Net.HttpWebRequest.CheckFinalStatus()
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
System.Net.HttpWebRequest.GetResponse()
Compiler.WebForm1.Go() in
c:\inetpub\wwwroot\Compiler\WebForm1.aspx.vb:298
Compiler.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\Compiler\WebForm1.aspx.vb:49
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()