我写了一些代码来连接远程服务器上的一些共享。如果WNetAddConnection2返回ERROR_SESSION_CREDENTIAL_CONFLICT(1219),我会先通过WNetCancelConnection2取消连接(返回NO_ERROR)。然后重新连接。但是WNetAddConnection2仍然返回1219。为什么会这样以及如何解决?这是我的代码BOOLADDirectorySearch::IPCConnect(CStringstrServerName,CStringstrDomainName,CStringstrUserName,CStringstrPassWord)