连接一下试试就知道了。
可以用WNetAddConnection
DWORD WNetAddConnection(
LPTSTR lpRemoteName, // pointer to network device name
LPTSTR lpPassword, // pointer to password
LPTSTR lpLocalName // pointer to local device name
);
在代码里这样用:
if(WNetAddConnection("\\\\192.168.1.1","password","administrator")==NO_ERROR)MessageBox("\\\\192.168.1.1路径有效");
Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Long