I am new at using the P4api in C#.I have found a library p4api.dll.It shows that there is a class named P4Revision.But when I try to create an instance of that class,it says that no constructor there.Is there any other way to get the revision number as well as last user updated the file? Thanks in advance
Asked
Active
Viewed 1,646 times
1
-
I've used P4.Net a few times and don't remember a class named P4Revision. Can you post the code that you've written so far? – Mike O'Connor Jun 27 '11 at 16:13
-
actually the code i have done wont help here.Because other part of that API is quite well.But I was asked to show the last revision number of any file and the person name who updated it and modified date,time,etc. I could not get any help here from the API.so no code there except p4Connection,submit,edit,integ,etc.which are working totally fine – Abdullah Saurav Jun 28 '11 at 03:59
1 Answers
2
I had a look, using .NET Reflector, at p4api.dll
and could not find a class named P4Revision
. I'm looking at the CLR 2.0 from the Sourceforge project page.
The P4.NET is made up of two components, a 1-to-1 wrapper around the official C++ API called p4api.dll
and a C# consumer called p4dn.dll
.
You will be able to the get information you want by running the fstat
command using P4Connection.Run(string Command, params string[] Args)
. Test the command using the P4 command line.
HTH.

Dennis
- 20,275
- 4
- 64
- 80
-
Suppose I have a GUI showing a file "file.xml".That file has been updated by another user in perforc server depot. If my GUI has a button name "Get Latest update of the file",what should I do to get the latest revision of "file.xml" through my application?I have to use the contents of the last updated file. I can submit file using p4API. this can be done using P4PendingChangelist.submit().What will be the codes? – Abdullah Saurav Jul 07 '11 at 09:10
-
You want to a sync command using the `P4Record` for "file.xml". I cannot remember the if there is an actual sync method you can call or if we had that functionality in our source control wrapper. ... So you may need to call the `P4Conenction.Run(string command)` with the following `sync //.../file.xml`. – Dennis Jul 07 '11 at 09:17
-