Solved

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

Posted on 2008-10-12
3
2,148 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
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Footer for each row on Gridview 2 33
Add a Condition in ASP Repeater 6 34
Where is this file? 3 25
How to repeat the data 4 18
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 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