本文整理汇总了VB.NET中System.OperatingSystem类的典型用法代码示例。如果您正苦于以下问题:VB.NET OperatingSystem类的具体用法?VB.NET OperatingSystem怎么用?VB.NET OperatingSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OperatingSystem类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Example
Module Example
Public Sub Main()
Dim os As OperatingSystem = Environment.OSVersion
Console.WriteLine("Current OS Information:")
Console.WriteLine()
Console.WriteLine("Platform: {0:G}", os.Platform)
Console.WriteLine("Version String: {0}", os.VersionString)
Console.WriteLine("Version Information:")
Console.WriteLine(" Major: {0}", os.Version.Major)
Console.WriteLine(" Minor: {0}", os.Version.Minor)
Console.WriteLine("Service Pack: '{0}'", os.ServicePack)
End Sub
End Module
' If run on a Windows 8.1 system, the example displays output like the following:
' Current OS Information:
'
' Platform: Win32NT
' Version String: Microsoft Windows NT 6.2.9200.0
' Version Information:
' Major: 6
' Minor: 2
' Service Pack: ''
' If run on a Windows 7 system, the example displays output like the following:
' Current OS Information:
'
' Platform: Win32NT
' Version String: Microsoft Windows NT 6.1.7601 Service Pack 1
' Version Information:
' Major: 6
' Minor: 1
' Service Pack: 'Service Pack 1'