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

logfile = new StreamWriter("\\\\\\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,,,

6 Years
Discussion Span
Last Post by saneeha.nust
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.