感谢您的快速回复。但我只是坚持登录。我使用以下代码尝试登录:
bool success = LogonUser("username", "000.000.000.000", "#####",2 ,0 , out userToken);
但是因为失败而异常
即时通讯使用用户名和密码,我用来通过mstsc登录。
我编写代码将文件从远程机器复制到本地机器,反之亦然。
但我不知道如何指定凭据才能这样做..
我的代码如下:
string sourceFile = System.IO.Path.Combine(globalInfo.GlobalServerPath, sourcePath ));
string destFile = System.IO.Path.Combine(globalInfo.GlobalPath, destPath)
string[] files = System.IO.Directory.GetFiles(sourceFile);
foreach (string s in files)
{
string fileName = System.IO.Path.GetFileName(s);
fileName = System.IO.Path.Combine(destFile, fileName);
System.IO.File.Copy(s, fileName, true);
}
这里我收到错误:无法登录..
换行
string [] files = System.IO.Directory.GetFiles(sourceFile);
我正在连接远程机器。
请帮忙