c# - copy a file to shared folder on another computer -
I am moving the copy file to the mapped network location. If I try to do it manually then everything is working fine.
I get no exception by running the following code, but I do not get the code at the required location.
string _ share location = @ "c: \ user \ pddd \ appdata \ roaming \ microsoft \ windows \ network shortcut \ system-test"; If (directory .xis (_shared location) & amp; amp; file.exis (@ "c: \\ automation \\ test \\ test1 \\ events.json") {file copy (@ "c : \\ Automation \ test \\ Test 1 \ Events .Jason ", Path.Combine (_space location," Event 11.Jusus "), True);} That Any suggestions with issue.
_SharedLocation variable, it is in place : "... \ Windows \ network shortcut \ ..." I'm just guessing here, but do you have a network fol Tringing to refer to a shortcut in the Network folder instead of the address? This will never work:
Copy (myOriginalFile, "C: \ ... \ MyShortcutToANetworkFolder \ myFile.txt"); Why not? Because a shortcut is basically file not in the folder (compared to this it is more complex, but I keep it simple for logic). You can not put a file (or something) in shortcut Astvik network requires folder path.
This will work:
file. Copy (myOriginalFile, "\\ myServer \ myFolder1 \ myFolder2 \ myFile.txt");
Comments
Post a Comment