|
|
|
Just copy and paste the following code into Form code window |
Click here to copy the following block | Private Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 End Type
Private Declare Function GetVersionExA Lib "kernel32" _ (lpVersionInformation As OSVERSIONINFO) As Integer
Private Sub Form_Load() MsgBox GetOSVersion End Sub
Public Function GetOSVersion() As String Dim osinfo As OSVERSIONINFO Dim retvalue As Integer
osinfo.dwOSVersionInfoSize = 148 osinfo.szCSDVersion = Space$(128) retvalue = GetVersionExA(osinfo)
With osinfo Select Case .dwPlatformId Case 1 Select Case .dwMinorVersion Case 0 GetOSVersion = "Windows 95" Case 10 GetOSVersion = "Windows 98" Case 90 GetOSVersion = "Windows Mellinnium" End Select Case 2 Select Case .dwMajorVersion Case 3 GetOSVersion = "Windows NT 3.51" Case 4 GetOSVersion = "Windows NT 4.0" Case 5 If .dwMinorVersion = 0 Then GetOSVersion = "Windows 2000" Else GetOSVersion = "Windows XP" End If End Select Case Else getVersion = "Failed" End Select
End With End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|