.NET原生GUID转换 [英] .NET Native GUID conversion

查看:111
本文介绍了.NET原生GUID转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个喂养资料给我一个外部的数据库。其中保存其数据为原生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 更多信息

推荐答案

如果我理解正确的问题,我发帖说这样做是<一个扩展方法href="http://stackoverflow.com/questions/5745512/how-to-read-a-net-guid-into-a-java-uuid/10149822#10149822">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.

这篇关于.NET原生GUID转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆