我在磁盘 C:\folder 上有共享网络文件夹。
当我使用 WNetAddConnection2 时,我收到错误 1200。我的代码是:
DWORD dwResult;
NETRESOURCE nr;
nr.dwType = RESOURCETYPE_ANY;
nr.lpLocalName = (LPWSTR)"folder";
nr.lpRemoteName = (LPWSTR)"\\\\ASYA\\folder";
nr.lpProvider = NULL;
dwResult = WNetAddConnection2(&nr,NULL,(LPCWSTR) "Nastya",CONNECT_UPDATE_PROFILE);
if (dwResult == NO_ERROR)
wprintf(L"Connection added to %s\n", nr.lpRemoteName);
else
wprintf(L"WNetAddConnection2 failed with error: %u\n", dwResult);
我的错误是什么?我怎么解决这个问题?