这些函数可以在WIN95以后的版本中使用。如果你用的开发工具含有微软的开发帮助文档,应该可以查到的。你的MSDN可能没有装全,资源共享的函数:NetShareAdd.关于共享资源的情况可以在本站查阅到相关的文章。可以看这一个问题:http://www.csdn.net/expert/TopicView.asp?id=7838//如何用netshareadd在WIN98下实现文件夹的共享
NET_API_STATUS NetShareAdd( LPWSTR servername, DWORD level,
LPBYTE buf, LPDWORD parm_err );
DWORD WNetAddConnection( LPTSTR lpRemoteName, // pointer to network device name
LPTSTR lpPassword, // pointer to password
LPTSTR lpLocalName // pointer to local device name);
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);
DWORD WNetAddConnection3(
HWND hwndOwner, // handle to an owner window for
// network provider dialog boxes
LPNETRESOURCE lpNetResource, // pointer to structure that
// specifies connection details
LPTSTR lpPassword, // pointer to password string
LPTSTR lpUserName, // pointer to user name string
DWORD dwFlags // set of bit flags that specify
// connection options
);
DWORD WNetCancelConnection(
LPTSTR lpName, // pointer to resource name to be disconnected
BOOL fForce // flag for unconditional disconnect);
DWORD WNetCancelConnection2(
LPTSTR lpName, // pointer to resource name to disconnect
DWORD dwFlags, // connection type flags
BOOL fForce // flag for unconditional disconnect);
DWORD WNetConnectionDialog(
HWND hwnd, // handle to window owning dialog box
DWORD dwType // resource type to allow connections to);
DWORD WNetConnectionDialog1(
LPCONNECTDLGSTRUCT lpConnectDlgStruc pointer to structure);
DWORD WNetDisconnectDialog(
HWND hwnd, // handle to window owning dialog box
DWORD dwType // resource type to disconnect from);
DWORD WNetDisconnectDialog1(
LPDISCDLGSTRUCT lpDiscDlgStruc // pointer to structure
);
DOS命令是NET,Net Use [devicename and *] [\\computer\sharename[\volume] [password] and *]] [/user:[domainnames\]username]
具体的可以用Net Use /?
Win API 是WNETADDCONNECTION、WNETADDCONNECTION2、WNETADDCONNECTION3.具体的可以参看MSDN的帮助。