我试图用 p4 api .net 打开我的会话,但命令不起作用。
ServerAddress adr = new ServerAddress(p.conStr);
Server serv = new Server(adr);
P4Server ser = new P4Server(p.conStr, p.user, p.password, p.ws_client);
Connection con = new Connection(serv);
string password = "Password";
con.Login(password);
对象 con.timeout 计数值:
"base {System.SystemException} = {"La référence d'objet n'est pas définie à une instance d'un objet."}"
我认为问题在于不可能这样做,因为如果我们通过传递命令来使用命令行 w 进程,p4 -p xx.xxx.xxx.x:xxxx login
而不是传递密码。
我还尝试使用System.Diagnostics.Process
以下代码传递命令:
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "p4.exe";
startInfo.Arguments = "p4 -p 10.215.100.7:1666 login";
process.StartInfo = startInfo;
process.Start();
请帮帮我