PlatformID 列挙体とは? わかりやすく解説

PlatformID 列挙体

アセンブリサポートされるオペレーティング システム (プラットフォーム) を識別します。

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public Enumeration PlatformID
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public enum PlatformID
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public enum class PlatformID
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public enum PlatformID
SerializableAttribute 
ComVisibleAttribute(true) 
public enum PlatformID
メンバメンバ
解説解説
使用例使用例

PlatformID クラス使用して、現在実行しているオペレーティング システム識別するコード例次に示します

' This example demonstrates the PlatformID enumeration.
Imports System

Class Sample
   Public Shared Sub Main()
      Dim msg1 As String
 = "This is a Windows operating system."
      Dim msg2 As String
 = "This is a Unix operating system."
      Dim msg3 As String
 = "ERROR: This platform identifier is invalid."
      
      ' Assume this example is run on a Windows operating system.
      Dim os As OperatingSystem = Environment.OSVersion
      Dim pid As PlatformID = os.Platform
      Select Case pid
         Case PlatformID.Win32NT, PlatformID.Win32S, _
              PlatformID.Win32Windows, PlatformID.WinCE
            Console.WriteLine(msg1)
         Case PlatformID.Unix
            Console.WriteLine(msg2)
         Case Else
            Console.WriteLine(msg3)
      End Select
   End Sub 'Main
End Class 'Sample
'
'This example produces the following results:
'
'This is a Windows operating system.
'
// This example demonstrates the PlatformID enumeration.
using System;

class Sample 
{
    public static void Main()
 
    {
    string msg1 = "This is a Windows operating system.";
    string msg2 = "This is a Unix operating system.";
    string msg3 = "ERROR: This platform identifier is invalid.";

// Assume this example is run on a Windows operating system.

    OperatingSystem os = Environment.OSVersion;
    PlatformID     pid = os.Platform;
    switch (pid) 
        {
        case PlatformID.Win32NT:
        case PlatformID.Win32S:
        case PlatformID.Win32Windows:
        case PlatformID.WinCE:
            Console.WriteLine(msg1);
            break;
        case PlatformID.Unix:
            Console.WriteLine(msg2);
            break;
        default:
            Console.WriteLine(msg3);
            break;
        }
    }
}
/*
This example produces the following results:

This is a Windows operating system.
*/
// This example demonstrates the PlatformID enumeration.
using namespace System;
int main()
{
   String^ msg1 = L"This is a Windows operating system.";
   String^ msg2 = L"This is a Unix operating system.";
   String^ msg3 = L"ERROR: This platform identifier is invalid.";
   
   // Assume this example is run on a Windows operating system.
   OperatingSystem^ os = Environment::OSVersion;
   PlatformID pid = os->Platform;
   switch ( pid )
   {
      case PlatformID::Win32NT:
      case PlatformID::Win32S:
      case PlatformID::Win32Windows:
      case PlatformID::WinCE:
         Console::WriteLine( msg1 );
         break;

      case PlatformID::Unix:
         Console::WriteLine( msg2 );
         break;

      default:
         Console::WriteLine( msg3 );
         break;
   }
   return 1;
}

/*
This example produces the following results:

This is a Windows operating system.
*/
// This example demonstrates the PlatformID enumeration.
import System.*;

class Sample
{
    public static void main(String[]
 args)
    {
        String msg1 = "This is a Windows operating system.";
        String msg2 = "This is a Unix operating system.";
        String msg3 = "ERROR: This platform identifier is invalid.";
        // Assume this example is run on a Windows operating system.
        OperatingSystem os = Environment.get_OSVersion();
        PlatformID pid = os.get_Platform();
        switch (pid) {
            case PlatformID.Win32NT:
            case PlatformID.Win32S:
            case PlatformID.Win32Windows:
            case PlatformID.WinCE:
                Console.WriteLine(msg1);
                break;
            case PlatformID.Unix:
                Console.WriteLine(msg2);
                break;
            default:
                Console.WriteLine(msg3);
                break;
        }
    } //main
} //Sample
/*
    This example produces the following results:

    This is a Windows operating system.
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からPlatformID 列挙体を検索した結果を表示しています。
Weblioに収録されているすべての辞書からPlatformID 列挙体を検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からPlatformID 列挙体 を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「PlatformID 列挙体」の関連用語

PlatformID 列挙体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



PlatformID 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS