I tried with WMI but doesn't work.
I also tried this with LogonUser but it doesnt work because LogonUser only works for local computers.
So how can I copy a file or at least get connected to the computer so it accept System.IO.File.Copy?
I tried with WMI but doesn't work.
I also tried this with LogonUser but it doesnt work because LogonUser only works for local computers.
So how can I copy a file or at least get connected to the computer so it accept System.IO.File.Copy?
If you need a share with that you can access on every computer, you can try \\computername\c$
.
If your app has admin-rights, you can copy files to every location on the c:. Use \\computername\d$
for d:
and so on.
Hope this helps.
You need to p/invoke WNetUseConnection to get access to the computer first, then use a UNC path to access the file and use normal file I/O. Here is some sample C# code.
You would for example access c:\test.txt on a computer named MONKEY on your LAN via a path like this: @"\\MONKEY\c$\test.txt"
.