Forum Discussion
morde
11 years agoContributor
Thank you Sivan :)
I was actually searching for the C# code and way to do so from VisualStudio and not from TC (althogh it's nice to know it's available from there too).
Eventually I found a way, not a neat one though...
DirectoryInfo latestDir = new DirectoryInfo(tcDirs[0]);
// a loop search for the newest directory....
string tcFileFullName = latestDir.FullName + "\\bin\\TestComplete.exe";
FileVersionInfo tcFile = FileVersionInfo.GetVersionInfo(tcFileFullName);
return tcFile.FileVersion.ToString();
Thanks again for your answer
I was actually searching for the C# code and way to do so from VisualStudio and not from TC (althogh it's nice to know it's available from there too).
Eventually I found a way, not a neat one though...
DirectoryInfo latestDir = new DirectoryInfo(tcDirs[0]);
// a loop search for the newest directory....
string tcFileFullName = latestDir.FullName + "\\bin\\TestComplete.exe";
FileVersionInfo tcFile = FileVersionInfo.GetVersionInfo(tcFileFullName);
return tcFile.FileVersion.ToString();
Thanks again for your answer