Super Valuable GUID Generator! Worth $299.95

Here’s a super high-value C# console application that’s going to corner the GUID creation market.

using System;
 using System.Windows.Forms;

namespace yafla.yaflaGuid 
{
  class GuidToClipboard 
  {
   [STAThread]
   static void Main(string[] args)
   { 
    string guidString
 = System.Guid.NewGuid().ToString("B");
    Clipboard.SetDataObject(guidString,
 true); 
    Console.WriteLine(guidString);
   }
  }
}

I’m constantly in need of GUIDs (“Can you spare a GUID please, sir?”), and generally use guidgen.exe, included with the Visual Studio tools. The problem with it, however, is two fold – it’s too many steps, and it includes a line feed on the end of the notepad copied guid. Annoying.

Finally I made the incredibly complex console application that you find above, generating a GUID (with no tailing linefeed), copying it to the clipboard for use elsewhere, and then spitting it out on the console (if I didn’t want the console, err, “feature”, this would be one unique line over the standard console wizard output).

Enjoy this revolution in GUID creation.