How to use Guids in C#?

后端 未结 5 1583
名媛妹妹
名媛妹妹 2021-01-30 19:38

This Code:

Something = new Guid() 

is returning:

00000000-0000-0000-0000-000000000000

all the time

5条回答
  •  囚心锁ツ
    2021-01-30 19:54

    It's in System.Guid.

    To dynamically create a GUID in code:

    Guid messageId = System.Guid.NewGuid();
    

    To see its value:

    string x = messageId.ToString();
    

提交回复
热议问题