Convert byte[] or object to GUID

前端 未结 5 1836
别那么骄傲
别那么骄傲 2021-02-12 10:20

I assigned some value to object data type like,

object objData =dc.GetDirectoryEntry().Properties[\"objectGUID\"].Value;

this object retun the

5条回答
  •  梦谈多话
    2021-02-12 11:12

    byte[] binaryData = objData as byte[];
    string strHex = BitConverter.ToString(binaryData);
    Guid id = new Guid(strHex.Replace("-", ""))
    

提交回复
热议问题