// This must be used if OSVERSIONINFO is defined as a struct
[ DllImport( "kernel32" )]
static extern bool GetVersionEx( ref OSVERSIONINFO osvi );
// This must be used if OSVERSIONINFO is defined as a class
[ DllImport( "kernel32" )]
static extern bool GetVersionEx( [In, Out] OSVERSIONINFO osvi );
VB.Net Signatures:
' This must be used if OSVERSIONINFO is defined as a struct
<DllImport("kernel32")> _
Private Shared Function GetVersionEx(ByRef osvi As OSVERSIONINFO) As Boolean
End Function
' This must be used if OSVERSIONINFO is defined as a class
<DllImport("kernel32")> _
Private Shared Function GetVersionEx(<[In](), Out()> ByVal osvi As OSVERSIONINFO) As Boolean
End Function
Friend Function IsWinVista() As Boolean
Dim osInfo As System.OperatingSystem = System.Environment.OSVersion
Return (osInfo.Platform = PlatformID.Win32NT AndAlso osInfo.Version.Major = 6)
End Function
Friend Function IsWinXP() As Boolean
Dim osInfo As System.OperatingSystem = System.Environment.OSVersion
Return (osInfo.Platform = PlatformID.Win32NT AndAlso osInfo.Version.Major = 5 AndAlso osInfo.Version.Minor >= 1)
End Function
Contains OS version information.
25/06/2009 18:43:15 - -74.212.48.23
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).
NEW: ANTS Memory Profiler 5 just released!
Memory Profiling made simple!
Download your free trial now. This download also contains the FREE PInvoke.net VS Add-in