0
我试图使用下面的代码连接到perforce服务器。我得到的对象引用未设置为对象异常的实例。使用p4.net api连接到perforce服务器时出现异常
String conStr = "perforce2.ges.abc.com:1666";
String user = "John_Smith";
String password = "[email protected]";
String ws_client = @"E:\Perforce\Automation\Technical Books";
ServerAddress adr = new ServerAddress(conStr);
Server serv = new Server(adr);
P4Server ser = new P4Server(conStr, user, password, ws_client);
Connection con = new Connection(serv);
Options opconnect = new Options();
opconnect.Add("-p", "");
con.SetClient(ws_client);
con.Connect(null);
con.Login(password);
在con.Connect(null)中;行我得到对象引用没有设置异常。我在这里失踪的任何东西。
为什么不将选项传递给'.Connect'调用? –
我曾尝试将选项传递给.connect调用,但我得到pServer null异常。 –
您可以发布一个完整的调用堆栈(包括p4.net'.Connect'调用中的部分吗? –