Guid trong System.Guid tạo ra số ngẫu nhiên duy nhất nhưng mà chuỗi này dài 36 ký tự, trong thực tế khi cần tạo chuỗi guid ngắn thì có thể dùng hàm sau: protected string CreateShortGuid() { byte[] buffer = Guid.NewGuid().ToByteArray(); return BitConverter.ToInt64(buffer, 0).ToString(); } có thể dùng: BitConverter.ToUInt32(buffer, 0) Ví dụ: 1 guid là … Continue reading