How to convert a GUID to a string in C#?

前端 未结 10 936
挽巷
挽巷 2020-12-15 02:20

I\'m new to C#.

I know in vb.net, i can do this:

Dim guid as string = System.Guid.NewGuid.ToString

In C#, I\'m trying to do

10条回答
  •  青春惊慌失措
    2020-12-15 03:09

    Did you write

    String guid = System.Guid.NewGuid().ToString;
    

    or

    String guid = System.Guid.NewGuid().ToString();
    

    notice the paranthesis

提交回复
热议问题