|
Este artículo proviene de un motor de traducción automática. Mueva el puntero sobre las frases del artículo para ver el texto original. Más información.
|
Traducción
Original
|
Guid (Estructura)
Espacio de nombres: System
Ensamblado: mscorlib (en mscorlib.dll)
El tipo Guid expone los siguientes miembros.
| Nombre | Descripción | |
|---|---|---|
![]() ![]() ![]() ![]() | Guid(Byte[]) | |
![]() ![]() ![]() ![]() | Guid(String) | |
![]() ![]() ![]() ![]() | Guid(Int32, Int16, Int16, Byte[]) | |
![]() ![]() ![]() ![]() | Guid(Int32, Int16, Int16, Byte, Byte, Byte, Byte, Byte, Byte, Byte, Byte) | |
![]() | Guid(UInt32, UInt16, UInt16, Byte, Byte, Byte, Byte, Byte, Byte, Byte, Byte) |
| Nombre | Descripción | |
|---|---|---|
![]() ![]() ![]() ![]() | CompareTo(Guid) | |
![]() ![]() | CompareTo(Object) | |
![]() ![]() ![]() ![]() | Equals(Guid) | |
![]() ![]() ![]() ![]() | Equals(Object) | |
![]() ![]() ![]() ![]() | GetHashCode | |
![]() ![]() ![]() ![]() | GetType | |
![]() ![]() ![]() ![]() ![]() | NewGuid | |
![]() ![]() ![]() ![]() | Parse | |
![]() ![]() ![]() ![]() | ParseExact | |
![]() ![]() ![]() ![]() | ToByteArray | |
![]() ![]() ![]() ![]() | ToString() | |
![]() ![]() ![]() ![]() | ToString(String) | |
![]() ![]() | ToString(String, IFormatProvider) | |
![]() ![]() ![]() ![]() | TryParse | |
![]() ![]() ![]() ![]() | TryParseExact |
| Nombre | Descripción | |
|---|---|---|
![]() ![]() ![]() ![]() ![]() | Equality | |
![]() ![]() ![]() ![]() ![]() | Inequality |
| Nombre | Descripción | |
|---|---|---|
![]() ![]() ![]() ![]() | IComparable.CompareTo | |
![]() ![]() ![]() ![]() | IFormattable.ToString |
using System; using System.Runtime.InteropServices; // Guid for the interface IMyInterface. [Guid("F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4")] interface IMyInterface { void MyMethod(); } // Guid for the coclass MyTestClass. [Guid("936DA01F-9ABD-4d9d-80C7-02AF85C822A8")] public class MyTestClass : IMyInterface { public void MyMethod() {} public static void Main( string []args ) { GuidAttribute IMyInterfaceAttribute = (GuidAttribute) Attribute.GetCustomAttribute(typeof(IMyInterface), typeof(GuidAttribute)); System.Console.WriteLine("IMyInterface Attribute: " + IMyInterfaceAttribute.Value ); // Use the string to create a guid. Guid myGuid1 = new Guid(IMyInterfaceAttribute.Value ); // Use a byte array to create a guid. Guid myGuid2 = new Guid(myGuid1.ToByteArray()); if (myGuid1.Equals(myGuid2)) System.Console.WriteLine("myGuid1 equals myGuid2"); else System.Console.WriteLine("myGuid1 does not equal myGuid2" ); // Equality operator can also be used to determine if two guids have same value. if ( myGuid1 == myGuid2 ) System.Console.WriteLine( "myGuid1 == myGuid2" ); else System.Console.WriteLine( "myGuid1 != myGuid2" ); } } // The example displays the following output: // IMyInterface Attribute: F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4 // myGuid1 equals myGuid2 // myGuid1 == myGuid2
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (no se admite el rol Server Core), Windows Server 2008 R2 (se admite el rol Server Core con SP1 o versiones posteriores; no se admite Itanium)
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.


