I want to create and write to file on a machine which is connected to my network...
The code is:

logfile = new StreamWriter("\\\\192.168.15.237\\C\\AdminTrace\\" + " " + DateTime.Now.ToShortDateString().ToString().Replace("/", "-") + ".txt", true);

the IP address corresponds to the machine on which i need to create the file...
and the drive C and the Folder "AdminTrace" are shared...
The prog raises the error , "unknown userName or bad password"...


I have turned off the "password Protected sharing" from network and sharing center, and have also tried to create file in the public folder, but it raises the same error.

Kindly guide me how can I supply the username and password, from the code, as I know the username and password for administrator of the network machine,,,

Recommended Answers

All 2 Replies

Read this thread, it has some code in the 6th message and some followup after.

Thanks alot... it was a great help.. my prob is solved...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.