473,401 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

problems with authenication in C#

I have a intranet page that I want to use to open a certain file from a
network location make changes to it and then write the changed file
back to the same network location

<my try at the code>

TextReader tr = new StreamReader("\\\\server\\location\\text1.txt");

StreamWriter tw = new StreamWriter("\\\\server\\location\\text2.txt");
</my try at the code>

I have setup IIS to use a domain user account that has read and write
rights to the server location.

I get the following error.
************************************************** ******************************

Server Error in '/web' Application.
--------------------------------------------------------------------------------

Logon failure: unknown user name or bad password.
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.IO.IOException: Logon failure: unknown user
name or bad password.

Source Error:
Line 64: TextReader tr = new StreamReader
("\\\\server\\location\\file1.txt");

Line 66: StreamWriter tw = new
StreamWriter("\\\\server\\location\\file2.txt");
Source File: c:\inetpub\wwwroot\web\default.aspx.cs Line: 64

Stack Trace:
[IOException: Logon failure: unknown user name or bad password.
]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +723
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String
msgPath, Boolean bFromProxy) +859
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize) +44
System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean
detectEncodingFromByteOrderMarks, Int32 bufferSize) +79
System.IO.StreamReader..ctor(String path) +101
web.WebForm1.Button1_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\web\default.aspx.cs:64
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1263
Kevin Joyner
Systems Analyst

Nov 16 '05 #1
2 7444
Hi there... which user is being authenticated (IUSR_MACHINENAME) ? Remember
that it belongs to the Guests user group. The same privileges as user but
with more restrictions. Does the user being authenticated have access to
that folder (Security)? Does the user being authenticated have the
corresponding checkboxes selected in your case read/write attributes?
Check those things out first and try again...

Regards,
--
Angel J. Hernández M.
MCSD
"kj96" <kj*****@cstx.gov> escribió en el mensaje
news:cg********@odah37.prod.google.com...
I have a intranet page that I want to use to open a certain file from a
network location make changes to it and then write the changed file
back to the same network location

<my try at the code>

TextReader tr = new StreamReader("\\\\server\\location\\text1.txt");

StreamWriter tw = new StreamWriter("\\\\server\\location\\text2.txt");
</my try at the code>

I have setup IIS to use a domain user account that has read and write
rights to the server location.

I get the following error.
************************************************** **************************
****
Server Error in '/web' Application.
-------------------------------------------------------------------------- ------
Logon failure: unknown user name or bad password.
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.IO.IOException: Logon failure: unknown user
name or bad password.

Source Error:
Line 64: TextReader tr = new StreamReader
("\\\\server\\location\\file1.txt");

Line 66: StreamWriter tw = new
StreamWriter("\\\\server\\location\\file2.txt");
Source File: c:\inetpub\wwwroot\web\default.aspx.cs Line: 64

Stack Trace:
[IOException: Logon failure: unknown user name or bad password.
]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +723
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String
msgPath, Boolean bFromProxy) +859
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize) +44
System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean
detectEncodingFromByteOrderMarks, Int32 bufferSize) +79
System.IO.StreamReader..ctor(String path) +101
web.WebForm1.Button1_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\web\default.aspx.cs:64
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1263
Kevin Joyner
Systems Analyst

Nov 16 '05 #2
What OS version (IIS version) are you running this on?

Willy.
"kj96" <kj*****@cstx.gov> wrote in message
news:cg********@odah37.prod.google.com...
I have a intranet page that I want to use to open a certain file from a
network location make changes to it and then write the changed file
back to the same network location

<my try at the code>

TextReader tr = new StreamReader("\\\\server\\location\\text1.txt");

StreamWriter tw = new StreamWriter("\\\\server\\location\\text2.txt");
</my try at the code>

I have setup IIS to use a domain user account that has read and write
rights to the server location.

I get the following error.
************************************************** ******************************

Server Error in '/web' Application.
--------------------------------------------------------------------------------

Logon failure: unknown user name or bad password.
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.IO.IOException: Logon failure: unknown user
name or bad password.

Source Error:
Line 64: TextReader tr = new StreamReader
("\\\\server\\location\\file1.txt");

Line 66: StreamWriter tw = new
StreamWriter("\\\\server\\location\\file2.txt");
Source File: c:\inetpub\wwwroot\web\default.aspx.cs Line: 64

Stack Trace:
[IOException: Logon failure: unknown user name or bad password.
]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +723
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String
msgPath, Boolean bFromProxy) +859
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize) +44
System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean
detectEncodingFromByteOrderMarks, Int32 bufferSize) +79
System.IO.StreamReader..ctor(String path) +101
web.WebForm1.Button1_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\web\default.aspx.cs:64
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1263
Kevin Joyner
Systems Analyst

Nov 16 '05 #3

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

Similar topics

3
by: nao921 | last post by:
Hi everyone, I am currently involved in a project that involves a windows client program written in delphi and a web application written in php. I have made several php pages for the delphi...
0
by: LouB | last post by:
I am researching a scenario with our Web Product, and am unsure about how to do it. In product 'A', we use Forms Authenication, and it works fine. The User Initially logs on with user/password etc...
14
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
1
by: 3f | last post by:
Hello; We have made a web application that people can download from our web site and installed on: Windows XP Windows 2000 Professional Windows 2003 Server Windows 2000 Server
5
by: Corky | last post by:
This works: db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID = PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
0
by: LouB | last post by:
I am researching a scenario with our Web Product, and am unsure about how to do it. In product 'A', we use Forms Authenication, and it works fine. The User Initially logs on with user/password etc...
0
by: Kenneth Keeley | last post by:
Hi, I have an login page on our ASP.Net Intranet site that uses forms authenication to validate the user against there windows 2000 active directory login. this was all working fine until a...
14
by: Toni | last post by:
I have some program in VB6 (I can make new in .NET if it is necessary). This program is working with SQL Server 2000 database from long distance (computers are in agencies and is connected to DSL...
2
by: Angel666 | last post by:
We are using forms authenication with AJAX update control panels. We get various results but no redirect when the user has timed out and is no longer authenicated and does a asyncpostback. We...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.