简体   繁体   English

Perforce密码(P4PASSWD)无效或未设置。 如何使用P4.Net解决

[英]Perforce password (P4PASSWD) invalid or unset. how to solve using P4.Net

I did have some other issue with the API. 我的API确实有其他问题。 so I installed Microsoft Visual C++ 2010 Redistributable Package (x86) from 所以我从安装了Microsoft Visual C ++ 2010可再发行组件包(x86)

http://www.microsoft.com/download/en/details.aspx?id=5555 http://www.microsoft.com/download/en/details.aspx?id=5555

for solving those issues. 解决这些问题。 the issues were solved installing this package. 安装此软件包解决了这些问题。 But some of my clients are now having this error message after installing this.the error message is like this : 但是我的一些客户端现在在安装this之后出现此错误消息。错误消息是这样的:

Error running Perforce command! 运行Perforce命令时出错! Perforce password (P4PASSWD) invalid or unset. Perforce密码(P4PASSWD)无效或未设置。

the exception is coming from this line: 异常来自此行:

P4RecordSet recordd = p4.Run("workspaces", "-u", userName); P4RecordSet已记录= p4.Run(“ workspaces”,“ -u”,userName);

here userName is a valid username of perforce server 这里的userName是perforce服务器的有效用户名

There are lots of help regarding this issue with other language. 对于使用其他语言的此问题,有很多帮助。 But I could not get any help for P4.NET. 但是我无法获得有关P4.NET的任何帮助。 Any suggestion please. 请提出任何建议。

I found the solution. 我找到了解决方案。 main problem was while login a ticket value was returned at p4.password. 主要问题是在登录时在p4.password返回了票证值。 But I was assigning password to p4.password after that. 但是在那之后我给p4.password分配了密码。 It was just like that. 就是这样。

p4.Login(password);
p4.Password = password; // here password is the input.

so p4.password did not match with the ticket number. 因此p4.password与票证号不匹配。 So the password got unset. 因此密码未设置。 I just removed p4.password = password line. 我刚刚删除了p4.password = password行。 And later this code executed successfully 然后此代码成功执行

P4RecordSet recordd = p4.Run("workspaces", "-u", userName);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM