0

I have a problem with reading a file from a Windows service that is on an other computer on the network.

If I have a file locally I just give the path for example.. C:\test\

I just write C:\\Test\\ and it works great, but on the server with this address \\\Server\Test\

I don't know what to write... I would love some help!

/Nick

2
  • Shouldn't it be \\Server\C$\Test\ ??? Commented Apr 11, 2012 at 8:37
  • @DimiToulakis - As long as there is a share called C$. It all depends on the sharing setting that Nick3 has or has not set up on the remote server. Commented Apr 11, 2012 at 8:44

2 Answers 2

1

I think you're just looking for:

string myPath = @"\\Server\Test";

or:

string myPath = "\\\\Server\\Test";

This doesn't seem to be anything related to SQL-Server, and is just a simple C# string question.

In general you just replace \ with \\ so if there's normally two \ next to each-other in the path (such as \\server) you want to then have \\\\

Sign up to request clarification or add additional context in comments.

Comments

0

If it is a windows local machine Windows try to change the folder (x86), i have the same problem some time ago and for some reason is not working in the default folder x86., or if is a SQL server take a look at this post.

Don't forget that you need to create the file \Test in folder \\Server in order to access it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.