VC程序,取消共享文件夹
怎样用VC做个一个程序,取消已共享的文件夹啊。就是自己共享的文件夹,现在使它不共享,怎样用程序控制啦。麻烦各位大小指点,尽量能给出一个实例。谢谢啦。
[解决办法]
NetShareAdd Shares a resource on a server.
NetShareCheck Queries whether a server is sharing a device.
NetShareDel Deletes a share name from a server's list of shared resources.
NetShareEnum Retrieves share information about each shared resource on a server.
NetShareGetInfo Retrieves information about a specified shared resource on a server.
NetShareSetInfo Sets a shared resource's parameters.
[解决办法]
- C/C++ code
#define UNICODE#include <windows.h>#include <stdio.h>#include <lm.h>void wmain( int argc, TCHAR *argv[ ]){ NET_API_STATUS res; if(argc<3) printf("Usage: NetShareDel server share\n"); else { // // Call the NetShareDel function to delete the share. // res=NetShareDel(argv[1], argv[2], 0); // // Display the result of the call. // if(res==0) printf("Share Removed.\n"); else printf("Error: %u\n", res); } return;}
[解决办法]
[解决办法]
把这个下载下来看看吧
http://www.pudn.com/downloads90/sourcecode/windows/system/detail345331.html
[解决办法]