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,,,

This question has already been answered. Start a new discussion instead.