It seems the call is Connection.GetP4EnvironmentVar( "P4PORT" ), but to be able to interrogate a connection I need to connect to a server and hence need a P4PORT in advance, and so have a chicken and egg situation. What is the best practice in this situation? Look in "HKCU\SOFTWARE\perforce\environment" ?
The goal is to run a C# app that can read the P4 env variables to grab P4PORT.
Cheers John