Streamwriter problem with remote machine

I try to create a file on a remote machine, but I get "Network name could not be found." I checked the network path and I was able to access the path from my machine. Could you tell me what could be wrong?

Here is my code.

        using (StreamWriter sw = new StreamWriter("\\\\servername\\TEST1\\TEST\\NEWFILE.csv", true))
    {
        sw.WriteLine(sw);
    }
+3
source share
3 answers

Grant access rights to the user under whom this application is running, either it is an IIS pool, or a Windows service, etc.

0
source

Go to \ servername \ TEST1 and give write permission to the user or aspnet (if you have a web application) in the test folder , and then restart your program. He will work.

, :
/

, IP- , .

+1

this is definitely a security issue. you need to provide write access to the remote computer.

0
source

All Articles