Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit MohantyRank #112 · 20K reputationPosted Apr 17, 2023, 1:25 AM EDT
Jerome Gabriel171 reputationPosted Apr 17, 2023, 12:47 AM EDT
Hi,
UUID it the same at GUID. To generate GUID with C# :
Brahma Prakash ShuklaRank #633 · 3.8K reputationPosted Apr 17, 2023, 6:51 AM EDT
You can generate UUID (Universally Unique Identifier) format in C# using the
Guidclass in ASP.NET.Here's an example code snippet to generate UUID format in C#:
// Generate UUID Guid uuid = Guid.NewGuid(); string uuidString = uuid.ToString();The
Guid.NewGuid()method generates a new UUID, and theToString()method converts it to a string representation. The resultinguuidStringwill be a string in UUID format, for example:"6f8c33a2-e2d8-4e69-a1f9-7f0b9388c7a5"You can use this UUID for various purposes such as identifying records in a database, creating unique filenames, or generating secure tokens for authentication.
Tuhin PaulRank #7 · 71.9K reputationPosted Apr 18, 2023, 2:00 AM EDT
To generate UUID (Universally Unique Identifier) format in ASP.NET C#, you can use the Guid class, which provides a convenient way to generate UUIDs.
using System; public class Example { public static void Main() { // Generate a new UUID Guid uuid = Guid.NewGuid(); // Print the UUID in string format Console.WriteLine(uuid.ToString()); } }This code uses the Guid.NewGuid() method to generate a new UUID, and then prints it out in string format using the ToString() method. The resulting UUID will be a 128-bit value represented as a string of 32 hexadecimal digits, separated by hyphens into five groups (8-4-4-4-12).
Abhishek YadavRank #217 · 11.3K reputationPosted Apr 18, 2023, 7:42 AM EDT
Guid uuid = Guid.NewGuid();