简体   繁体   English

如何在C#中映射远程系统上的网络驱动器

[英]How to map a network drive on a remote system in C#

I am using MapNetworkDrive Method of the WshNetwork object. 我正在使用WshNetwork对象的MapNetworkDrive方法。 I am able to map a network shared folder as a drive on my computer through the code. 我可以通过代码将网络共享文件夹映射为计算机上的驱动器。 But my real objective is to map a network drive in a remote computer to a shared folder on my computer. 但是我的真正目的是将远程计算机中的网络驱动器映射到计算机上的共享文件夹。 How is this done? 怎么做?

You can use WMI to create a remote process and send a console command to map that drive 您可以使用WMI创建远程进程并发送控制台命令以映射该驱动器

You could also use PsExec if WMI does not work for you. 如果WMI不适合您,您也可以使用PsExec

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM