Skip to content

Winforms App local LAN PC login issue

NeCroFire

Asked Oct 15, 2010, 1:02 AM EDT1 answer
Share
LinkedInX
Hi

I have a app that copies files to a different machine on our network. It's a simple XP machine we use for daily backups. However, you need to login to the machine before you can do anything. So the app doesn't work unless I first open a shared folder with Explorer on the backup PC and enter my logon details. Once I've logged onto the Backup PC, the app runs fine. But if I don't logon first, the app throws an exception stating that it can't access the destination folder.

Now I can't seem to find a way to add network credentials to the copy process, so I figured I need to give it to the app somehow??

I want to avoid having to setup a FTP server as I feel it's unnecessary for something that should be relatively simple.


So I need my app to "login" to the Backup PC before it tries to copy the files.

Any help would be appreciated.
Thanks

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    I can suggest you , map the shared folder to you computer.
    System.Diagnostics.Process.Start("net.exe", "use Z: \\Server\URI\path\ /USER:<username> <password>" );
    Once you have done your process, then disconnect it  automatically.
    System.Diagnostics.Process.Start("net.exe", "use /delete Z:" ); How to use the Simple File Sharing feature to share files in Windows XP
     
    Hope this helps you.
     
    0