简体   繁体   中英

How to get Perforce (P4Api.net) Workspace Path

var P4USER = p4Config.P4USER;
var P4PORT = p4Config.P4PORT;
var P4CLIENT = p4Config.P4CLIENT;
var P4PASSWD = p4Config.P4PASSWD;

Perforce.P4.Server srv = new Perforce.P4.Server(new ServerAddress(P4PORT));
Perforce.P4.Repository p4 = new Perforce.P4.Repository(srv);
p4.Connection.UserName = P4USER;
p4.Connection.SetClient(P4CLIENT);
p4.Connection.Connect(new Perforce.P4.Options());
p4.Connection.Login(P4PASSWD);

I using P4Api.net and login done. but how can I get my worksapce path ? 在此处输入图片说明

I found solution , so I answer by my self.

string P4CLIENT = "YourWorkSpaceName";    
Client c = p4.GetClient(P4CLIENT);
//here
Console.WriteLine(c.Root);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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