Solved

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

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now