.NET原生GUID转换NET、GUID

2023-09-04 00:08:49 作者:福大運好

我有一个喂养资料给我一个外部的数据库。其中保存其数据为原生GUID格式和我的其他数据源提供标准的.NET GUID格式字符串。

I have an external database that is feeding information to me. One saves their data as native GUID format and my other data source supplies standard .NET GUID format string.

有一个整洁的方式,从原生GUID转换为 GUID结构?

Is there a tidy way to convert from Native GUID to GUID Structure?

也没有任何验证位,以确定是否提供的值是土生土长的GUID或不?我似乎无法找到任何(如果有)。

Also is there any validation bit to determine if a provided value is a Native GUID or not? I can't seem to find any if there is one.

所不同的是,如下所示:

The difference is as follows:

typedef struct _GUID 
{  
   DWORD Data1;  
   WORD Data2;  
   WORD Data3;  
   BYTE Data4[8];
} GUID;

数据1,数据2和数据3得到他们的字节顺序颠倒,但DATA4保持不变,请参见的http:// EN .wikipedia.org /维基/ Globally_unique_identifier 更多信息

推荐答案

如果我理解正确的问题,我发帖说这样做是How读一个.NET的Guid成Java的UUID 。

If I understand the question correctly, I posted extension methods that do this in How to read a .NET Guid into a Java UUID.

 
精彩推荐
图片推荐