Saber el sistema operativo del equipo

Este código lo utilizo cuando desarrollo en ASP, algunas veces debes de saber el sistema operativo ya que los equipos Mac tiene diferentes rutas o formato.


       
        Dim sistema_operativo As OperatingSystem = Environment.OSVersion
        Dim plataforma As PlatformID = sistema_operativo.Platform
        Select Case plataforma
            Case PlatformID.Win32NT, PlatformID.Win32S, _
                 PlatformID.Win32Windows, PlatformID.WinCE
                 Me.label1.Text = "plataforma Windows"
            Case PlatformID.Unix
                 Me.label1.Text = "plataforma unix"
            Case PlatformID.MacOSX
                 Me.label1.Text = "plataforma mac"
            Case PlatformID.Xbox
                 Me.label1.Text  = "plataforma xbox"
            Case Else
                 Me.label1.Text  = "plataforma no reconocida"
        End Select

Publicar un comentario

0 Comentarios