Consider the following:
Guid globallyUnique1 = new Guid();
Guid globallyUnique2 = new Guid();
if (globallyUnique1 == globallyUnique2)
{
MessageBox.Show("This cannot be");
}
else
{
MessageBox.Show("Everything is well");
}
What is shown? Why?
random ramblings about mostly tech stuff...
1 comment:
"This cannot be"
because "new Guid()" create only an object Guid initialized to Guid.Empty.
If you want to have a new intialized and unique Guid, you need to use the Guid.NewGuid() static method.
Post a Comment