当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET OperatingSystem.Platform属性代码示例

本文整理汇总了VB.NET中System.OperatingSystem.Platform属性的典型用法代码示例。如果您正苦于以下问题:VB.NET OperatingSystem.Platform属性的具体用法?VB.NET OperatingSystem.Platform怎么用?VB.NET OperatingSystem.Platform使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在System.OperatingSystem的用法示例。


在下文中一共展示了OperatingSystem.Platform属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。

示例1: PlatformVersionDemo

' Example for the OperatingSystem.Platform and 
' OperatingSystem.Version properties.
Module PlatformVersionDemo
    
    ' Create an OperatingSystem object, and display the Platform
    ' and Version properties.
    Sub BuildOSObj( pID As PlatformID, ver As Version )

        Dim opSys       As New OperatingSystem( pID, ver )
        Dim platform    As PlatformID = opSys.Platform
        Dim version     As Version = opSys.Version

        Console.WriteLine( "   Platform: {0,-15} Version: {1}", _
            platform, version )
    End Sub 
        
    Sub BuildOperatingSystemObjects( )

        ' The Version object does not need to correspond to an 
        ' actual OS version.
        Dim verNull     As New Version( )
        Dim verString   As New Version( "3.5.8.13" )
        Dim verMajMin   As New Version( 6, 10 )
        Dim verMMBld    As New Version( 5, 25, 5025 )
        Dim verMMBVer   As New Version( 5, 6, 7, 8 )
            
        ' All PlatformID members are shown here.
        BuildOSObj( PlatformID.Win32NT, verNull )
        BuildOSObj( PlatformID.Win32S, verString )
        BuildOSObj( PlatformID.Win32Windows, verMajMin )
        BuildOSObj( PlatformID.WinCE, verMMBld )
        BuildOSObj( PlatformID.Win32NT, verMMBVer )
    End Sub 
        
    Sub Main( )
        Console.WriteLine( _
            "This example of OperatingSystem.Platform " & _
            "and OperatingSystem.Version " & vbCrLf & _
            "generates the following output." & vbCrLf )
        Console.WriteLine( _
            "Create several OperatingSystem objects " & _
            "and display their properties:" & vbCrLf )

        BuildOperatingSystemObjects( )
            
        Console.WriteLine(vbCrLf & _
            "The operating system of the host computer is: " & _
            vbCrLf )

        BuildOSObj( _
            Environment.OSVersion.Platform, _
            Environment.OSVersion.Version )
    End Sub 
End Module 

' This example of OperatingSystem.Platform and OperatingSystem.Version
开发者ID:VB.NET开发者,项目名称:System,代码行数:56,代码来源:OperatingSystem.Platform

输出:

Create several OperatingSystem objects and display their properties:

Platform: Win32NT         Version: 0.0
Platform: Win32S          Version: 3.5.8.13
Platform: Win32Windows    Version: 6.10
Platform: WinCE           Version: 5.25.5025
Platform: Win32NT         Version: 5.6.7.8

The operating system of the host computer is:

Platform: Win32NT         Version: 5.1.2600.0


注:本文中的System.OperatingSystem.Platform属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。