GUID(Global unique identifier)全局唯一标识符,它是由网卡上的标识数字(每个网卡都有唯一的标识号)以及 CPU 时钟的唯一数字生成的的一个16字节的二进制值。





public void InsertIntoDB()
{
try
{
Guid CID = Guid.NewGuid();
CurrencyRow row = new CurrencyRow();
row.CurrencyID = CID.ToString();
row.CurrencyName = this.txt_Currency.Text.Trim();
db.CurrencyCollection.Insert(row);
this.Alert("货币信息录入成功!");
}
catch
{
db.RollbackTransaction();
this.Alert("货币信息录入失败,请稍后再试!");
}
}