1

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.

7
  • Is this a web application or console application or... ? Also what error are you getting? And is "\\server\direcotyr" in quotes or no? Jul 23, 2018 at 17:59
  • Under what protocol can you access that server? Is it a Windows Share and does the user that is executing your program have privilege to read/write to it? Is it NFS share, FTP, SFTP, something else?
    – JNevill
    Jul 23, 2018 at 18:00
  • It is sometimes easier to simply mount a drive and access it as a regular folder Jul 23, 2018 at 18:01
  • Windows Share i have an access through //server/directory path
    – Kenik
    Jul 23, 2018 at 18:02
  • this should work fine if you have access via \\server\share
    – pm100
    Jul 23, 2018 at 18:04

1 Answer 1

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.