// 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:
<Public/Private> Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (ByRef lpVersionInformation As OSVERSIONINFO) As Boolean
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
Obtains extended information about the version of the operating system that is currently running.
ByRef is a VB keyword that specifies a variable to be passed as a parameter BY REFERENCE. In other words, the pointer to the variable is passed and any change to its value made within the function or sub will change its value outside the function/sub.
4/25/2007 10:19:29 AM - josep1er@cmich.edu-141.209.229.179
Contains OS version information.
6/25/2009 6:43:15 PM - -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).