WNetCancelConnection2(...)并取消所有连接? [英] WNetCancelConnection2(...) and canceling all connections?

查看:516
本文介绍了WNetCancelConnection2(...)并取消所有连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WNetAddConnection2(...)连接到远程文件夹,当我有另一个进程查看同一个文件夹时,我收到1219的错误。我想关闭与该远程的所有连接在我开始我之前的文件夹。有没有办法
那样做?据我了解,WNetCancelConnection2(...)将取消一个连接,但我怎么能对所有这些连接?

解决方案

嗨Enrac,


感谢您在此处发帖。


>>我正在使用  WNetAddConnection2(...)连接到远程文件夹,当我有另一个进程查看同一个文件夹时,我得到一个1219的错误。我想在启动我之前关闭该远程文件夹的所有连接。
有办法吗?据我了解,WNetCancelConnection2(...)将取消一个连接,但我怎么能对所有这些连接?


对于这种情况,我建议你打电话每次从新进程调用WNetAddConnection2之前的WNetCancelConnection2函数。


WNetCancelConnection2 方法取消与远程文件夹的现有网络连接。您也可以调用该函数来删除当前未连接的记忆网络连接。


或者您可以发送Net use命令删除该远程文件夹的所有连接。


希望这可以帮助你。


最好的问候,


Sera Yu


I am using WNetAddConnection2(...) to connect to a remote folder, and when I have another process looking at the same folder, I get an error of 1219. I'd like to close all connections to that remote folder before I initiate mine. Is there a way to do that? As I understand it WNetCancelConnection2(...) will cancel one connection, but how could I do it to all of them?

解决方案

Hi Enrac,

thanks for posting here.

>>I am using WNetAddConnection2(...) to connect to a remote folder, and when I have another process looking at the same folder, I get an error of 1219. I'd like to close all connections to that remote folder before I initiate mine. Is there a way to do that? As I understand it WNetCancelConnection2(...) will cancel one connection, but how could I do it to all of them?

For this case, I suggest you call WNetCancelConnection2 function before you call WNetAddConnection2 from a new process each time.

WNetCancelConnection2 method cancels the existing network connection to the remote folder. You can also call the function to remove remembered network connections that are not currently connected.

Or you could send Net use command to delete all connections to this remote folder.

Hope this could be help of you.

Best Regards,

Sera Yu


这篇关于WNetCancelConnection2(...)并取消所有连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆