Solved

Error Logon failure: unknown user name or bad password when using StreamWriter

Posted on 2008-10-12
3
2,155 Views
Last Modified: 2012-06-27
Hi,

 I am getting error Logon failure: unknown user name or bad password. when running the attached code

 I am trying to write to a network path (\\server\folder\)
 
Hope you can help me
using (StreamWriter sw = new StreamWriter(Path + cmbProduct.SelectedItem.Text +".product",false)) 
						{
							// Add some text to the file.
							sw.Write(ProductData);							
						}//using

Open in new window

0
Comment
Question by:negreteo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
harwantgrewal earned 500 total points
ID: 22700090
Hi negreteo
Are you aware of the exception associated with the SreamWrite? If not have a look at the following URL
http://msdn.microsoft.com/en-us/library/fysy0a4b.aspx

And make sure your application has rights to write files on that UNC path.

Thanks
Harry
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question