Omg =)
So you want internal of Guid.NewGuid()?
Here you are:
[SecuritySafeCritical, __DynamicallyInvokable]
public static Guid NewGuid()
{
Guid guid;
Marshal.ThrowExceptionForHR(Win32Native.CoCreateGuid(out guid), new IntPtr(-1));
return guid;
}
where Win32Native is a wrapper for Win32 API
[DllImport("ole32.dll")]
internal static extern int CoCreateGuid(out Guid guid);
SO what prevents you to develop your own solution?
Lest look at this guid: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
From which parts it was collated ? onle ypercase letters and digit, so:
string def = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
Random rnd = new Random();
Dictionary<int,int> guidGroups=new Dictionary<int,int>();
guidGroups.Add(0,8);
guidGroups.Add(1,4);
guidGroups.Add(2,4);
guidGroups.Add(3,4);
guidGroups.Add(4,12);
StringBuilder ret = new StringBuilder();
for(g=0;g<5;g++)
{
ret.Append("-");
for (int i = 0; i <guidgroups[g]> ret.Append(def.Substring(rnd.Next(def.Length), 1));
}
return ret.ToString();
This code might not work because i don't verify it, but i have wrote this code with one intent is to help you to develop some basic solution....
But on my opinion i do not prefer to develop vehicle if they are already exists