UniqueId.TryGetGuid Method (Byte[], Int32)


Tries to get the value of the UniqueId as a Guid and store it in the given byte array at the specified offest.

Namespace:   System.Xml
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)

public bool TryGetGuid(
	byte[] buffer,
	int offset


Type: System.Byte[]

byte array that will contain the Guid.

Type: System.Int32

Position in the byte array to start inserting the Guid value.

Return Value

Type: System.Boolean

true if the value stored in this instance of UniqueId is a Guid; otherwise false.

Exception Condition

buffer is null.


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


buffer and offset provide less than 16 valid bytes.

This method is unsafe.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft