远程连接命名管道
环境windows8.1,64bit,CS, VS2012
参考:http://stackoverflow.com/questions/719353/win32-named-pipes-and-remote-clients
我参考了stackoverflow的方法,误打误撞得实现了用命名管道从计算机B连接计算机A。A与B连在一个交换机上,没有使用domain。A、B机器没有使用相同用户名。
按照stackoverflow的文章,只用WNetUseConnection或单独用LogonUser()就可以远程连接了。实际上,必须2个function一起用,少一个都不行!!按照LogonUser()解释" log a user on to the local computer. The local computer is the computer from which LogonUser was called. ",它只在执行代码的计算机上有效。
1. 为什么必须用LogonUser()呢???
2. 为什么必须用WNetUseConnection()??