Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 240191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:38:46+00:00 2026-05-11T20:38:46+00:00

What is the best to determine the Microsoft OS that is hosting your ASP.NET

  • 0

What is the best to determine the Microsoft OS that is hosting your ASP.NET application using the System.Environment.OSVersion namespace

I need an example for Windows XP, Windows Server 2003 and Windows Vista

Here is what I am trying to accomplish using pseudocode

switch(/* Condition for determining OS */)
{
    case "WindowsXP":
        //Do Windows XP stuff
        break;
    case "Windows Server 2003":
        //Do Windows Server 2003 stuff
        break;
    case "Windows Vista":
        //Do Windows Vista stuff
        break;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:38:46+00:00Added an answer on May 11, 2026 at 8:38 pm

    The following should work. But why do you care? Is just for informational purposes in logging or are you looking for actual capabilities being present on the target platform?

    if (Environment.OSVersion.Version.Major == 5)
    {
        if (Environment.OSVersion.Version.Minor == 1)
        {
                 // XP
        }
        else if (Environment.OSVersion.Version.Minor == 2)
        {
                 // Server 2003.  XP 64-bit will also fall in here.
        }
    }
    else if (Environment.OSVersion.Version.Major >= 6)
    {
            // Vista on up
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm accessing a Microsoft Access 2002 database (MDB) using ASP.NET through the OdbcConnection class,
What is the best way to determine user logout on IIS server in C#/Asp.Net?
I am building an ASP.NET UI on an existing system, which consists of separate
What is the best way to determine which Controller class a Kohana application is
I'm trying to determine how best to architect a .NET Entity Framework project to
My organization is getting ready to implement a new system, which is a asp.net
What is the best way to determine available bandwidth in .NET? We have users
What is the best way to determine how many window handles an application is
I am trying to determine the best way to create a treeview list in
What is the best way to determine the number of elements in an array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.