OPening a file on a remote computer
OS: Windows Language: C开发者_StackOverflow社区#/C/C++
Does anyone know how to open a file in Remote computer. I could find few samples for unix but not for windows. Thanks for your help.
You simply specify the UNC name of the file in your fopen() statement. Like //server/share/filename. The remote machine must be configured to support file sharing and the user account under which your program runs must have sufficient access rights. If "remote" means through the Internet then you have to use one of the standard Internet protocols. FTP or HTTP are typical.
You can use PsExec to execute commands on a remote computer, on a specific session if you like.
PowerShell is another alternative. You can call PowerShell scripts from within C#.
精彩评论