C# how to create a Guid value?

后端 未结 11 2149
旧时难觅i
旧时难觅i 2020-11-27 09:58

One field of our struct is Guid type. How to generate a valid value for it?

11条回答
  •  醉话见心
    2020-11-27 10:37

    If you want to create a "desired" Guid you can do

    var tempGuid = Guid.Parse("");
    

    where would be something like 1A3B944E-3632-467B-A53A-206305310BAE.

提交回复
热议问题