File.Copy Error - Please Help
-
The Error: Could not find file "\\myserver\share$\myfile.txt". The Code: File.Copy(@"\\myserver\share$\myfile.txt",@"c:\myfile.txt"), true); The file is there. The premissions on the share$ is set to everyone. I can navigate to the file using the above quoted string. What am I missing?
-
The Error: Could not find file "\\myserver\share$\myfile.txt". The Code: File.Copy(@"\\myserver\share$\myfile.txt",@"c:\myfile.txt"), true); The file is there. The premissions on the share$ is set to everyone. I can navigate to the file using the above quoted string. What am I missing?
:((:((
-
The Error: Could not find file "\\myserver\share$\myfile.txt". The Code: File.Copy(@"\\myserver\share$\myfile.txt",@"c:\myfile.txt"), true); The file is there. The premissions on the share$ is set to everyone. I can navigate to the file using the above quoted string. What am I missing?
Hi! I guess the problem lies in the share itself. If you enter "\\myserver\share$" in the address bar of a windows explorer, do you get a dialog asking for a user name and password? If you can see the file in your explorer, does the program still throw the exception afterwards? Or is the code executed from within a windows service process running under LocalSystem account? mav
-
Hi! I guess the problem lies in the share itself. If you enter "\\myserver\share$" in the address bar of a windows explorer, do you get a dialog asking for a user name and password? If you can see the file in your explorer, does the program still throw the exception afterwards? Or is the code executed from within a windows service process running under LocalSystem account? mav
thank you for responding... no.. no dialog box appears. Any lowly person in the company and open this share no problem. And the code is being executed by ASPNET account
-
thank you for responding... no.. no dialog box appears. Any lowly person in the company and open this share no problem. And the code is being executed by ASPNET account
i think i've boiled down the issue. ASPNET service account is a local service account to my machine. I'm trying to copy a file from a domain server. The premissions on the server is set to everyone, but that means everyone in the Domain, not local mcahin accounts. Now I need to figure out how to pass premissions with my file.copy... any clues?
-
i think i've boiled down the issue. ASPNET service account is a local service account to my machine. I'm trying to copy a file from a domain server. The premissions on the server is set to everyone, but that means everyone in the Domain, not local mcahin accounts. Now I need to figure out how to pass premissions with my file.copy... any clues?
You don't. You can create a domain account, restrict it's log to certain machines!, that the ASP.NET server can run under. It doesn't have to run under a local machine account! Then you can give that domain account appropriate rights to the machines and folders required to run your code and do file copies. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
The Error: Could not find file "\\myserver\share$\myfile.txt". The Code: File.Copy(@"\\myserver\share$\myfile.txt",@"c:\myfile.txt"), true); The file is there. The premissions on the share$ is set to everyone. I can navigate to the file using the above quoted string. What am I missing?
Maybe the parameter are incorrect you can try with the ip: File.Copy(@"\###.###.###.###\directory\file.txt",@"c:\file.txt",true); I can use the instruction like my example and work well.