473,893 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error 401: Unauthorized

The following snippet of code is part of a larger module, and the code shown
here is giving me an error. The error is "The remote server returned an
error: (401) Unauthorized." The error occurs on the line 'objResponse =
objRequest.GetR esponse()
............... ............... ............... ............... ............... .............
Private Function readHtmlPage(By Val url As String) As String
Dim result As String
Dim objResponse As WebResponse
Dim objRequest As WebRequest = System.Net.Http WebRequest.Crea te(url)
objResponse = objRequest.GetR esponse(
............... ............... ............... ............... ............... .............
Could someone please help me understand why this error is appearing. If
anymore information or clarification is needed, please let me know. Thanks.
Jul 21 '05 #1
3 4131
Is the website you are trying to access using authentication? If so, then
the code you have there will give such an error.
"MrMike" <Mr****@discuss ions.microsoft. com> wrote in message
news:A8******** *************** ***********@mic rosoft.com...
The following snippet of code is part of a larger module, and the code shown
here is giving me an error. The error is "The remote server returned an
error: (401) Unauthorized." The error occurs on the line 'objResponse =
objRequest.GetR esponse()'
............... ............... ............... ............... ............... .............
Private Function readHtmlPage(By Val url As String) As String
Dim result As String
Dim objResponse As WebResponse
Dim objRequest As WebRequest = System.Net.Http WebRequest.Crea te(url)
objResponse = objRequest.GetR esponse()
............... ............... ............... ............... ............... .............
Could someone please help me understand why this error is appearing. If
anymore information or clarification is needed, please let me know. Thanks.
Jul 21 '05 #2
Yes, the application requires Windows authentication. I have full control of
the application, and am able to perform all other functions within the
application. How would I go about correcting this specific problem and
specifying the proper credentials during this process? Thanks.

"Lance Wynn" wrote:
Is the website you are trying to access using authentication? If so, then
the code you have there will give such an error.
"MrMike" <Mr****@discuss ions.microsoft. com> wrote in message
news:A8******** *************** ***********@mic rosoft.com...
The following snippet of code is part of a larger module, and the code shown
here is giving me an error. The error is "The remote server returned an
error: (401) Unauthorized." The error occurs on the line 'objResponse =
objRequest.GetR esponse()'
............... ............... ............... ............... ............... .............
Private Function readHtmlPage(By Val url As String) As String
Dim result As String
Dim objResponse As WebResponse
Dim objRequest As WebRequest = System.Net.Http WebRequest.Crea te(url)
objResponse = objRequest.GetR esponse()
............... ............... ............... ............... ............... .............
Could someone please help me understand why this error is appearing. If
anymore information or clarification is needed, please let me know. Thanks.

Jul 21 '05 #3
this might hep you out a bit.

http://msdn.microsoft.com/library/de...icatetopic.asp
"MrMike" <Mr****@discuss ions.microsoft. com> wrote in message
news:F6******** *************** ***********@mic rosoft.com...
Yes, the application requires Windows authentication. I have full control
of
the application, and am able to perform all other functions within the
application. How would I go about correcting this specific problem and
specifying the proper credentials during this process? Thanks.

"Lance Wynn" wrote:
Is the website you are trying to access using authentication? If so, then
the code you have there will give such an error.
"MrMike" <Mr****@discuss ions.microsoft. com> wrote in message
news:A8******** *************** ***********@mic rosoft.com...
The following snippet of code is part of a larger module, and the code
shown
here is giving me an error. The error is "The remote server returned an
error: (401) Unauthorized." The error occurs on the line 'objResponse =
objRequest.GetR esponse()'
............... ............... ............... ............... ............... .............
Private Function readHtmlPage(By Val url As String) As String
Dim result As String
Dim objResponse As WebResponse
Dim objRequest As WebRequest =
System.Net.Http WebRequest.Crea te(url)
objResponse = objRequest.GetR esponse()
............... ............... ............... ............... ............... .............
Could someone please help me understand why this error is appearing. If
anymore information or clarification is needed, please let me know.
Thanks.

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1876
by: Andrew | last post by:
I am having trouble sending error codes to the browser from my php page. I want to send a 401 Unauthorized, and a 404 not found. I have tried these (in seperate documents): header("HTTP/1.0 404 Not Found"); header("Status: 401 Unauthorized");
0
580
by: sirumalla | last post by:
These posting i have seen in so many sites but none of them solved the problem. Iam trying to fix this problem past 2 days but iam not able to do so. I doubt whether iam missing any peice of code I am trying to logon to remote server thru my code. when i paste the link in web browser it is working correctly but when iam trying to execute thru my code it is giving me problem saying ur Unauthorized. Here is my code:
1
841
by: ag | last post by:
Hi guys.. need your help. We have abc.asp page on the source server which calls a .net component on that server. The component is in MTS running under say "domain2\id1" identity. The component uses HttpWebRequest to call xyz.asp on the target server. Both servers are under the same domain say domain1 and there is a trust between domain1 and domain2. The problem is the target server is returning 401 unauthorized access when calling xyz.asp...
1
3643
by: schramae | last post by:
Hi, I have just reinstalled Reporting Services on win 2003 server that was added to a domain and has been renamed. Two strange things happen: 1) In IE I am prompted for an ID and password with a basic security prompt. 2) After supplying the credentials I get some of the report manager web page but it has a 401 error instead of the folder and options to manage projects. The page looks like this:
2
8218
by: obeOnline | last post by:
I'm getting the following error... System.Net.HttpWebRequest.CheckFinalStatus() +676 System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) +139 System.Net.HttpWebRequest.GetResponse() +147 Web.WebDav.Page_Load(Object sender, EventArgs e)
0
1506
by: Daniel Kopp | last post by:
Hi! I tried to implement custom error pages using the <customErrors> directive in a web.config file. It worked fine for "simple" errors like HTTP 404, like this example: <customErrors mode="On"> <error statusCode="404" redirect="http://localhost/ErrorPages/Error404.aspx"/> </customErrors>
0
731
by: Francois Guerin | last post by:
I have an application calling a web service on a different machine. The application code runs under a local user account on the application server. The account (identical username/password) is created on the web service server. The web service uses Windows integrated security and ACLs are set on the web service to allow the remote application to use it. The problem is that everytime IIS' is recycled, I get an "unauthorized" error on the...
1
15535
by: HMS1 | last post by:
Hi, When I try to access an SQL Server 2005 database using ASP pages, it works fine on one PC when the ASP pages are on the local machine and the database on the server. However, when the ASP pages and the database are both on the server, where I want them to be, it displays the error message below: You are not authorized to view this page You do not have permission to view this directory or page using the credentials that you supplied....
5
24535
by: rote | last post by:
I'm using ASP.NET 2.0 and i have copied and pasted the code below to my Global.asax file but it desn't trap the error I want to trap the 401 access denied void Application_Error(object sender, EventArgs e) { Exception exception = Server.GetLastError();
0
9832
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,...
0
11245
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8025
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
7175
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
5859
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
6066
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4684
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
2
4281
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.