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

编程入门 行业动态 更新时间:2024-10-24 04:36:24
本文介绍了登录失败,用户名未知或密码错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想使用模拟(< username,password>)将文件从PC复制到服务器. 当我编写以下代码并运行该代码时,抛出了登录失败,未知用户名或密码错误"的异常. 有人可以帮忙吗?

I want to copy a file from a pc to a server using impersonate (<username,password>). When I wrote the follwing code and run it exception was thrown "logon failure unknown username or bad password". Can anyone help?

using (new Tools.Impersonator(Serv_UName, "",Serv_Pwd)) { if (File.Exists(DestFileName)) { MessageBox.Show("already exists in destination"); return 1; } else { File.Copy(Src_FileName, DestFileName, true); return 0; } }

推荐答案

请参阅以下文章 使用C#的Windows模拟 [ ^ ] 您可能需要阅读域.... en.wikipedia/wiki/Windows_domain [ ^ ] wwwworkclue/os/Windows/AD/index.aspx [ ^ ] 如果其他所有方法都不成功 www.google/search?q=understanding+domains+windows [ ^ ] See the following article Windows Impersonation using C#[^] You may need to read up on domains.... en.wikipedia/wiki/Windows_domain[^] wwwworkclue/os/Windows/AD/index.aspx[^] If all else fails www.google/search?q=understanding+domains+windows[^]

您看到的错误消息非常清楚-您尚未提供可以正确进行身份验证的凭据. 您说您正在连接到服务器-那么您希望使用哪个帐户对服务器进行身份验证?服务器上的域帐户还是本地帐户? 您提供的参数是 The error message you are seeing is pretty clear - you haven''t provided credentials that it can correctly authenticate with. You say you are connecting to a server - so what account are you expecting to use to authenticate against the server? A domain account, or a local account on the server? The arguments you are providing are Serv_UName, "",Serv_Pwd

什么是中间论点?是域"吗?如果是这样,请尝试以下

What is the middle argument? Is it ''domain''? If so, try the following

Serv_UName, Serv_Name, Serv_Pwd

因此,如果我想使用帐户dmorley连接到名为SERVER1的服务器,它将显示为

So if I wanted to connect to a server called SERVER1 with account dmorley, it would read

using (new Tools.Impersonator("dmorley", "SERVER1", "S0mePa55word"))

您需要确保该帐户在您要连接的服务器上存在

You need to make sure that the account exists on the server you are connecting to

更多推荐

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

本文发布于:2023-10-23 02:01:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1519407.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:用户名   错误   密码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!