I use Perforce Api (.net c#) works.
source...
//--------Connect--------
Perforce.P4.Server server = new Perforce.P4.Server(new Perforce.P4.ServerAddress("111.222.333.444"));
Perforce.P4.Repository rep = new Perforce.P4.Repository(server);
Perforce.P4.Connection con = rep.Connection;
con.UserName = "PSY";
string password = "gangnamstyle";
con.Client = new Perforce.P4.Client();
Perforce.P4.Options opconnect = new Perforce.P4.Options();
opconnect.Add("-p", password);
con.Connect(opconnect);
con.Login(password);
//--------How to ?--------
string ws_client = @"C:\ClientPath\";
string depot = "//depot/";
Perforce.P4.P4Server p4Server = new Perforce.P4.P4Server(server.Address.Uri, con.UserName, password, ws_client);
Perforce.P4.P4Command com = new Perforce.P4.P4Command(p4Server);
//--------Disconnect---------
con.Disconnect();
Perforce commands of this "Get Latest Revision"
If you already have the workspace for
c:\clientPath
setup on your machine and assuming it has the namemyWorkspace
(as in the "Workspace" column in the "Workspaces" tab in p4v), then: