March 21, 2008 at 1:58 pm
#187638
Member
i have started using properties to set pal version variables. The attached project is a VB 2005 project.
it uses System.Diagnostics.FileVersionInfo to read the file version of the paltalk.exe.
Private _PalMajorVer As Integer Public ReadOnly Property PalMajorVer() As Integer Get If _PalMajorVer = 0 Then Try If mdlPalInfo.PalPath "Not Found" Then 'This reads the file version information ' Paltalk calls this the Application version ' if you look in the About Pal window Dim VersionInfo As System.Diagnostics.FileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(mdlPalInfo.PalPath & "paltalk.exe") _PalMajorVer = VersionInfo.ProductMajorPart _PalMinorVer = VersionInfo.ProductMinorPart Else _PalMajorVer = 0 End If Catch _PalMajorVer = 0 End Try End If Return _PalMajorVer End Get End Property Private _PalMinorVer As Integer Public ReadOnly Property PalMinorVer() As Integer Get If _PalMinorVer = 0 Then Try If mdlPalInfo.PalPath "Not Found" Then 'This reads the file version information ' Paltalk calls this the Application version ' if you look in the About Pal window Dim VersionInfo As System.Diagnostics.FileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(mdlPalInfo.PalPath & "paltalk.exe") _PalMinorVer = VersionInfo.ProductMinorPart Else _PalMinorVer = 0 End If Catch _PalMinorVer = 0 End Try End If Return _PalMinorVer End Get End Property