登录失败:在远程计算机中创建文件夹时未知的用户名或密码错误

时间:2016-11-16 05:52:26

标签: c# .net windows-share

我正在尝试在远程计算机上创建一个文件夹(计算机在同一网络中)。我正在使用代码,当我尝试删除代码时,我收到以下错误消息:

  

登录失败:未知用户名或密码错误。

任何人都可以建议我如何在远程计算机(在同一网络中)创建文件夹吗?

enter image description here

string path = @"\\16.166.187.121\c$\testingfolder\Features\Temp\";
if (!Directory.Exists(path))
{
    DirectoryInfo di = Directory.CreateDirectory(path);
}

1 个答案:

答案 0 :(得分:0)

我猜您的凭证有问题。 请看这里:How to provide user name and password when connecting to a network share