_Type.GUIDとは? わかりやすく解説

Type.GUID プロパティ

Type関連付けられている GUID取得します

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

解説解説

GUID は、GuidAttribute 属性使用して型に関連付けられています。

使用例使用例

パブリック メソッドを持つクラス MyClass1作成しMyClass1対応する Type オブジェクト作成してType クラスGUID プロパティ使用して Guid 構造体取得する例を次に示します

Imports System

Class MyGetTypeFromCLSID

    Public Class MyClass1

        Public Sub MyMethod1()
        End Sub 'MyMethod1

    End Class 'MyClass1

    Public Shared Sub Main()
        ' Get the type corresponding to the class MyClass.
        Dim myType As Type = GetType(MyClass1)
        ' Get the object of the Guid.
        Dim myGuid As Guid = CType(myType.GUID,
 Guid)
        Console.WriteLine(("The name of the class is "
 + myType.ToString()))
        Console.WriteLine(("The ClassId of MyClass is "
 + myType.GUID.ToString()))
    End Sub 'Main 
End Class 'MyGetTypeFromCLSID
using System;

class MyGetTypeFromCLSID
{
    public class MyClass1
    {
        public void MyMethod1()
        {
        }
    }
    public static void Main()
    {
        // Get the type corresponding to the class MyClass.
        Type myType = typeof(MyClass1);
        // Get the object of the Guid.
        Guid myGuid =(Guid) myType.GUID;
        Console.WriteLine("The name of the class is "+myType.ToString());
        Console.WriteLine("The ClassId of MyClass is "+myType.GUID);  
              
    }
}
using namespace System;
ref class MyGetTypeFromCLSID
{
public:
   ref class MyClass1
   {
   public:
      void MyMethod1(){}
   };
};

int main()
{
   
   // Get the type corresponding to the class MyClass.
   Type^ myType = MyGetTypeFromCLSID::MyClass1::typeid;
   
   // Get the Object* of the Guid.
   Guid myGuid = (Guid)myType->GUID;
   Console::WriteLine( "The name of the class is {0}",
 myType );
   Console::WriteLine( "The ClassId of MyClass is {0}", myType->GUID
 );
}
import System.*;

class MyGetTypeFromCLSID
{
    public class MyClass1
    {
        public void MyMethod1()
        {
        } //MyMethod1
    } //MyClass1

    public static void main(String[]
 args)
    {
        // Get the type corresponding to the class MyClass.
        Type myType = MyClass1.class.ToType();

        // Get the object of the Guid.
        Guid myGuid = (Guid)(myType.get_GUID());
        Console.WriteLine("The name of the class is "
 + myType.ToString());
        Console.WriteLine("The ClassId of MyClass is " + myType.get_GUID());
    } //main
} //MyGetTypeFromCLSID
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

_Type.GUID プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

COM オブジェクトに、Type.GUID プロパティへのバージョン依存しないアクセス用意されています。

このプロパティは、CLS準拠していません。  

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

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「_Type.GUID」の関連用語

_Type.GUIDのお隣キーワード
検索ランキング

   

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



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

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

©2024 GRAS Group, Inc.RSS