473,466 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to find out if OS is Windows XP?

Hi,

I want to know i my application is running under Windows XP.
I can retrieve the platform and version from the OSVersion object. The
problem is that i can't map these into an operating system. I can't find it
on MSDN or Microsoft's homepage.

Fred
Jul 21 '05 #1
1 1098
Hi,
I have code taken form other site.....................

Public Function GetVersion() As String
Dim os_version As OperatingSystem = Environment.OSVersion
With os_version
Select Case .Platform
Case .Platform.Win32Windows
' Win32.
Select Case (.Version.Minor)
Case 0
Return "Windows 95"
Case 10
If .Version.Revision.ToString() = _
"2222A" Then
Return "Windows 98 Second " & _
"Edition"
Else
Return "Windows 98"
End If
Case 90
Return "Windows Me"
End Select
Case .Platform.Win32NT
' WinNT.
Select Case (.Version.Major)
Case 3
Return "Windows NT 3.51"
Case 4
Return "Windows NT 4.0"
Case 5
Select Case (.Version.Minor)
Case 0
Return "Windows 2000"
Case 1
Return "Windows XP"
Case 2
Return "Windows Server 2003"
End Select
Case Else
Return "Unknown"
End Select
Case Else
Return "Unknown"
End Select
End With
End Function
I hope this will help u..............

Regards,
Ritesh

--
Message posted via http://www.dotnetmonster.com
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mike Labosh | last post by:
In VB 6, the Form_QueryUnload event had an UnloadMode parameter that let me find out *why* a form is unloading, and then conditionally cancel the event. In VB.NET, the Closing event passes a...
2
by: scorpion53061 | last post by:
This excel find/replace code works great under Excel 2003 but bombs with an error (pasted below the code) in Excel 2000. Can anyone suggest an alternative to make both happy? I am using vb.net...
13
by: usenet | last post by:
How and where can one find out about the basics of VB/Access2003 syntax? I am a died in the wool C/C++/Java Linux/Unix programmer and I am finding it difficult to understand the program format...
7
by: Bryan | last post by:
Hi , I am using ADO (ADODB) with access database. Not sure what I am doing wrong.here. Can anyone please help me? string mdbFile = System.IO.Directory.GetCurrentDirectory() +" \\bTrack.mdb;"...
8
by: clyfish | last post by:
In cmd, I can use find like this. C:\>netstat -an | find "445" TCP 0.0.0.0:445 0.0.0.0:0 LISTENING UDP 0.0.0.0:445 *:* C:\> And os.system is OK....
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.