?
Solved

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

Posted on 2008-10-12
3
Medium Priority
?
2,158 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month11 days, 1 hour left to enroll

770 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