Search code examples
c#fileio

Access to remote server for File I/O


I have a question about accessing to remote server. Should I do something special when I want to get into remote server ? Example path is : \server\directory do I need to use diffrent library than these which I'm using to copy/move normal files ?

I've tried do this this way :

FileStream fs = new FileStream( \\server\direcotyr, FileMode.Create, FileAccess.Write, FileShare.None);

Not full code, that's just an example.

I'm asking because I have some problem while trying copy these files from server and thought that might be a cause.


Solution

  • In your example,if it were @"\\server\direcotyr\filename.fileExtension" and the calling code had permissions, it should work.