|
■No101468 (魔界の仮面弁士 さん) に返信
> 検索したら、すぐにヒットしましたよ。
ありがとうございます!
public int Connect() {
NETRESOURCE netResource = new NETRESOURCE();
netResource.dwScope = 0;
netResource.dwType = 1;
netResource.dwDisplayType = 0;
netResource.dwUsage = 0;
netResource.lpLocalName = "";
netResource.lpRemoteName = _path;
netResource.lpProvider = "";
int ret = 0;
try {
ret = WNetCancelConnection2(_path, 0, true);
ret = WNetAddConnection2(ref netResource, _psw, _usr, 0);
} catch (Exception exp) {
return -1;
}
_isConnect = true;
return ret;
}
このtryの中に指定処理を入れたらいい感じですか?
|