Click here to Skip to main content
Click here to Skip to main content

Make the programs work on a specific windows version

, 27 Sep 2010
Rate this:
Please Sign up or sign in to vote.
        private void Form1_Load(object sender, EventArgs e)
        {
            if (!IsWin7())
            {
                Application.Exit();
            }
        }
        bool IsWin7()
        {
            return Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor == 1;
        }
        bool IsWinVista()
        {
            return Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor == 0;
        }
 
others windows versions:
Server 2008 R2
Major=6
Minor=1
 
Server 2008
Major=6
Minor=0
 
Server 2003
5
2
 
XP
5
1
 
2000
5
0
 
NT4
4
0
 
ME
4
90
 
98
4
10

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

alrosan
Software Developer
Jordan Jordan
No Biography provided

Comments and Discussions

 
GeneralThe subject is misleading PinmemberDaveAuld25-Sep-10 8:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 27 Sep 2010
Article Copyright 2010 by alrosan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid