I found this method -- System.Diagnostics.Process.Start -- to log into a user's computer and in my case in order to download a file.
In a command window you can say something like: net user z:\\IPaddress\SharedFolder password /user:computerName\userName
I tried doing this using the System.Diagnostics.Process.Start but I get this error: Error message: System.ComponentModel.Win32Exception: The system cannot find the file specified at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start(String fileName) at FTPProgramWinApp2.Form1.ListFilesOnServer(String locationOfFolder, String password, String user) in C:\AAAWorkspace\FTPProgramWinApp2\Form1.cs:line 1745
I then changed the beginning to: C:/WINDOWS/System32/net.exe
But got the same error. What should I use in the () of System.Diagnostics.Process.Start
Let's say I want to see what files are in 123.456.78.901's computer under the folder "shared" where their username is "hello" and their computer name is "mycomp" and finally their password is "p123". My original way would have been: net use z: \\123.456.78.901\shared p123 /user:mycomp\hello
(if this code is not in the best forum to get an answer please let me know where to put it, or if you can move it for me. thanks!)
Visual C#8
|