vbdotnet.it

Tricks & tips, workaround, forum and ideas with .Net

About the author

Enrico Rossini è il gestore di questo blog.
E-mail me Send mail

Recent posts

Recent comments

Contributi

Best 6 ~ 6 users ~ 6 comments

Info legali

Le opinioni espresse in questo blog sono strettamente personali e ogni persona è responsabile dei commenti che inserisce. I marchi citati sono delle rispettive aziende.

© Copyright 2010

Advertising


Versione del sistema operativo in uso

Come si può identificare il sistema operativo che viene eseguito sul computer? Questo codice ti aiuta ad individuarlo.

   1: Public Function GetOSVersion() As String
   2:     Select Case Environment.OSVersion.Platform
   3:         Case PlatformID.Win32S
   4:             Return "Win 3.1"
   5:         Case PlatformID.Win32Windows
   6:             Select Case Environment.OSVersion.Version.Minor
   7:                 Case 0
   8:                     Return "Win95"
   9:                 Case 10
  10:                     Return "Win98"
  11:                 Case 90
  12:                     Return "WinME"
  13:                 Case Else
  14:                     Return "Unknown"
  15:             End Select
  16:         Case PlatformID.Win32NT
  17:             Select Case Environment.OSVersion.Version.Major
  18:                 Case 3
  19:                     Return "NT 3.51"
  20:                 Case 4
  21:                     Return "NT 4.0"
  22:                 Case 5
  23:                     Select Case _
  24:                         Environment.OSVersion.Version.Minor
  25:                         Case 0
  26:                             Return "Win2000"
  27:                         Case 1
  28:                             Return "WinXP"
  29:                         Case 2
  30:                             Return "Win2003"
  31:                     End Select
  32:                 Case 6
  33:                     Return "Vista/Win2008Server"
  34:                 Case Else
  35:                     Return "Unknown"
  36:             End Select
  37:         Case PlatformID.WinCE
  38:             Return "Win CE"
  39:     End Select
  40: End Function

Buon lavoro!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by enrico on Monday, June 08, 2009 3:15 PM
Permalink | Comments (0) | Post RSSRSS comment feed