作者:VB.NET开发
项目:Syste
Module Example
Public Sub Main()
Dim originalGuid As Guid = Guid.NewGuid()
' Create an array of string representations of the GUID.
Dim stringGuids() As String = { originalGuid.ToString("B"),
originalGuid.ToString("D"),
originalGuid.ToString("X") }
' Parse each string representation.
Dim newGuid As Guid
For Each stringGuid In stringGuids
If Guid.TryParse(stringGuid, newGuid) Then
Console.WriteLine("Converted {0} to a Guid", stringGuid)
Else
Console.WriteLine("Unable to convert {0} to a Guid",
stringGuid)
End If
Next
End Sub
End Module