February 9, 2016 HomeC# QuestionsHow to Generate GUID in C#/CSharp How to Generate GUID in C#/CSharp By Krishnaa C# Questions 0 Comments To generate a GUID in C#/CSharp, we make use of GUID class. Example is given below. using System; namespace Hello_World { class Program { static void Main(string[] args) { Guid myGuid = Guid.NewGuid(); Console.WriteLine(myGuid.ToString()); } } } ; You May Also Like: How to Generate Random Number in C#/CSharp How to Get Current Month in String Format in C#/CSharp How to Trim a String in C#/CSharp How to Get Computer Name in C#/CSharp How to Sort An Array in C#/CSharp