Прочетете на английски Редактиране

Споделяне чрез


UniqueId Constructors

Definition

Creates a new instance of this class.

Overloads

UniqueId()

Creates a new instance of this class with a new, unique Guid.

UniqueId(Byte[])

Creates a new instance of this class using a byte array that represents a Guid.

UniqueId(Guid)

Creates a new instance of this class using a Guid.

UniqueId(String)

Creates a new instance of this class using a string.

UniqueId(Byte[], Int32)

Creates a new instance of this class starting from an offset within a byte array that represents a Guid.

UniqueId(Char[], Int32, Int32)

Creates a new instance of this class starting from an offset within a char using a specified number of entries.

UniqueId()

Source:
UniqueId.cs
Source:
UniqueId.cs
Source:
UniqueId.cs

Creates a new instance of this class with a new, unique Guid.

C#
public UniqueId();

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

UniqueId(Byte[])

Source:
UniqueId.cs
Source:
UniqueId.cs
Source:
UniqueId.cs

Creates a new instance of this class using a byte array that represents a Guid.

C#
public UniqueId(byte[] guid);

Parameters

guid
Byte[]

A byte array that represents a Guid.

Exceptions

guid is null.

guid provides less than 16 valid bytes.

Remarks

Only the first 16 bytes of the array are used.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

UniqueId(Guid)

Source:
UniqueId.cs
Source:
UniqueId.cs
Source:
UniqueId.cs

Creates a new instance of this class using a Guid.

C#
public UniqueId(Guid guid);

Parameters

guid
Guid

A Guid.

Exceptions

guid is null.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

UniqueId(String)

Source:
UniqueId.cs
Source:
UniqueId.cs
Source:
UniqueId.cs

Creates a new instance of this class using a string.

C#
public UniqueId(string value);
C#
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
public UniqueId(string value);

Parameters

value
String

A string used to generate the UniqueId.

Attributes

Exceptions

value is null.

Length of value is zero.

Remarks

Any string non-zero length string is a valid value.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

UniqueId(Byte[], Int32)

Source:
UniqueId.cs
Source:
UniqueId.cs
Source:
UniqueId.cs

Creates a new instance of this class starting from an offset within a byte array that represents a Guid.

C#
public UniqueId(byte[] guid, int offset);
C#
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
public UniqueId(byte[] guid, int offset);

Parameters

guid
Byte[]

A byte array that represents a Guid.

offset
Int32

Offset position within the byte array that represents a Guid.

Attributes

Exceptions

guid is null.

offset less than zero or greater than the length of the array.

guid and offset provide less than 16 valid bytes.

Remarks

Only the first 16 bytes at the specified offset are used.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

UniqueId(Char[], Int32, Int32)

Source:
UniqueId.cs
Source:
UniqueId.cs
Source:
UniqueId.cs

Creates a new instance of this class starting from an offset within a char using a specified number of entries.

C#
public UniqueId(char[] chars, int offset, int count);
C#
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
public UniqueId(char[] chars, int offset, int count);

Parameters

chars
Char[]

A char array that represents a Guid.

offset
Int32

Offset position within the char array that represents a Guid.

count
Int32

Number of array entries to use, starting from offset.

Attributes

Exceptions

chars is null.

offset less than zero or greater than the length of the array.

-or-

count less than zero or greater than the length of the array minus offset.

count equals zero.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0