21
1
using System;
2
3
public class Program
4
{
5
public static void Main()
6
{
7
//Create a random, new guid
8
Guid guid = Guid.NewGuid();
9
Console.WriteLine(guid);
10
11
byte[] guidBytes = guid.ToByteArray();
12
byte[] first4Bytes = BitConverter.GetBytes((UInt32) 0815);
13
14
//Overwrite the first 4 Bytes
15
Array.Copy(first4Bytes, guidBytes, 4);
16
17
//Create new guid based on current values
18
Guid guid2 = new Guid(guidBytes);
19
Console.WriteLine(guid2);
20
}
21
}
Cached Result