开发者

Mount Network Drive Locally in MFC(VC++)?

开发者 https://www.devze.com 2023-01-30 15:59 出处:网络
How to Mount Network Drive Locally in MFC(VC++) ? C开发者_开发问答urrently I am using WNetAddConnection2 to mount drive but it mount drive on network, I want to mount it has locally.

How to Mount Network Drive Locally in MFC(VC++) ? C开发者_开发问答urrently I am using WNetAddConnection2 to mount drive but it mount drive on network, I want to mount it has locally.

Any help is appreciated. Thanks.


Do you mean that you want to use a drive letter to attach a network share? I would call the system command net, like so:

net use X: \server\share /PERSISTENT:NO

where X is the drive letter you want to use. The PERSISTENT flag prevents it from remounting on boot. When you're finished, call net again with:

net use X: /DELETE

and it will umount the share.

0

精彩评论

暂无评论...
验证码 换一张
取 消