locked
GUID RRS feed

  • Question

  • What is the best way to get a GUID in C#.
    Harry T Ulmer
    Saturday, February 19, 2011 8:26 PM

Answers

  • You can create a GUID using the Guid class and its NewGuid() method System.Guid.NewGuid() This post from MSDN explaining this http://msdn.microsoft.com/en-us/library/system.guid.newguid.aspx
    Ali Hamdar (alihamdar.com - www.ids.com.lb)
    • Proposed as answer by Thuru VMVP Sunday, February 20, 2011 5:19 AM
    • Marked as answer by harrytu Sunday, February 20, 2011 6:02 AM
    Saturday, February 19, 2011 9:33 PM

All replies

  • You can create a GUID using the Guid class and its NewGuid() method System.Guid.NewGuid() This post from MSDN explaining this http://msdn.microsoft.com/en-us/library/system.guid.newguid.aspx
    Ali Hamdar (alihamdar.com - www.ids.com.lb)
    • Proposed as answer by Thuru VMVP Sunday, February 20, 2011 5:19 AM
    • Marked as answer by harrytu Sunday, February 20, 2011 6:02 AM
    Saturday, February 19, 2011 9:33 PM
  • What is the best way to get a GUID in C#.
    Harry T Ulmer

          string id = Guid.NewGuid().ToString();
          MessageBox.Show(id);
    

    Balaji Baskar
    http://codesupport.wordpress.com
    Click on "Vote As Helpful" and "Mark As Answer" if this has helped you.
    Sunday, February 20, 2011 2:15 AM