The System.Guid type exposes several shared and instance methods that can help you work with GUIDs, that is, those 128-bit numbers that serve to uniquely identify elements and that are ubiquitous in Windows programming. The most important member is the NewGuid shared method is useful for generating a new unique identifier:
' Create a new GUID.
Dim guid1 As Guid = Guid.NewGuid
' By definition, you'll surely get a different output here.
There are two things you can do with a Guid object: you can convert it to a Byte array with the ToByteArray method, and you can compare two Guid values for equality using the Equals method (inherited from System.Object):
' Convert to an array of bytes.
Dim bytes() As Byte = guid1.ToByteArray
Dim b As Byte
For Each b In bytes
Console.Write(b.ToString & " ")
' => 239 1 161 57 143 200 172 70 185 64 222 29 59 15 190 205
' Compare two GUIDs.
If Not guid1.Equals(guid2) Then
Console.WriteLine("GUIDs are different.")