How can we do create process in C# as we do in C++ by using CreateProcess API?
System.Diagnostics.Process.Start()
But launching Uuidgen just to get the right formatting, if that's what
you have in mind, seems a bit extreme.
Guid.NewGuid(); doesn't generates the GUID in the format which i want i.e with "0x" appended.
It's trivial to do your own formatting. For example
byte[] guidBytes = Guid.NewGuid().ToByteArray();
Console.WriteLine(
"{{ 0x{0:x8}, 0x{1:x4}, 0x{2:x4}, {{ 0x{3:x2}, 0x{4:x2}, 0x{5:x2},
0x{6:x2}, 0x{7:x2}, 0x{8:x2}, 0x{9:x2}, 0x{10:x2} }} }}",
BitConverter.ToUInt32( guidBytes, 0 ),
BitConverter.ToUInt16( guidBytes, 4 ),
BitConverter.ToUInt16( guidBytes, 6 ),
guidBytes[8], guidBytes[9], guidBytes[10], guidBytes[11],
guidBytes[12], guidBytes[13], guidBytes[14], guidBytes[15] );
Mattias