User Defined Guide Definition

I want to define a User Define Guid in C #. I want to insert this into my Guid object:

ddddddddddddddddddddddddddddddddd

When I do this:

Guid user = "dddddddddddddddddddddddddddddddd";

I get err: the system cannot convert from String to System.Guid. What should I do here?

+5
source share
4 answers

It looks like you want:

Guid user = Guid.Parse("dddddddddddddddddddddddddddddddd");

Note that when you print the pointer again, it will be formatted differently:

// Prints dddddddd-dddd-dddd-dddd-dddddddddddd
Console.WriteLine(user);

Guid(string), Parse - , , , int.Parse .. , Guid.Parse .NET 4 - .NET, . , , , .

+11

a GUID 32 ,

Guid user = new Guid("aa4e075f-3504-4aab-9b06-9a4104a91cf0");

Guid user = Guid.NewGuid();
+5

Guid.Parse :

Guid user = Guid.Parse("dddddddddddddddddddddddddddddddd");
+4

Try:

Guid user = new Guid("dddddddddddddddddddddddddddddddd");

Hope this helps!
N.z.

+2
source

All Articles