如何让计算机从网络中断开!

redfoxnuaa 2000-06-13 12:34:00
本人有的程序的要求是,当计算机开始运行这个程序的时候,就从网络中断开。关闭程序的时候,就恢复网络。就是本机,不是远程控制!
...全文
132 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hhzh426 2000-06-13
  • 打赏
  • 举报
回复
老兄,错了,你的过程是将网络上的共享目录的映射断开或增加一个网络路径的本地映射!
蝈蝈俊 2000-06-13
  • 打赏
  • 举报
回复
WNetCancelConnection2
The WNetCancelConnection2 function breaks an existing network connection. It can also be used to remove remembered network connections that are not currently connected. This function supersedes WNetCancelConnection.

DWORD WNetCancelConnection2(
LPTSTR lpName, // pointer to resource name to disconnect
DWORD dwFlags, // connection type flags
BOOL fForce // flag for unconditional disconnect
);


The WNetAddConnection2 function makes a connection to a network resource. The function can redirect a local device to the network resource.

The WNetAddConnection2 function supersedes the WNetAddConnection function. If you pass a handle to a window that the provider of network resources can use as an owner window for dialog boxes, use the WNetAddConnection3 function.

DWORD WNetAddConnection2(
LPNETRESOURCE lpNetResource, // points to structure that
// specifies connection details
LPCTSTR lpPassword, // points to password string
LPCTSTR lpUsername, // points to user name string
DWORD dwFlags // set of bit flags that specify
// connection options
);


1,593

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧