使用vb.net创建一个uuid [英] to create a uuid using vb.net

查看:125
本文介绍了使用vb.net创建一个uuid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


我想用vb创建一个uuid,net怎么做

hi
I want to create a uuid using vb,net how to do it

推荐答案

GUID识别对象例如接口和类对象。 GUID由一组8个hexadecimaldigits组成,后面跟着三组每组4个十六进制数字,后面跟着一组12个十六进制数字。



在下面的脚本中,Imanually生成GUID,我可以稍后在应用程序中使用VB.NET:

GUIDs identify objects such asinterfaces and class objects. A GUID consists of one group of 8 hexadecimaldigits, followed by three groups of 4 hexadecimal digits each, which arefollowed by one group of 12 hexadecimal digits.

In the following script, Imanually generate the GUID that I can use later in the application by usingVB.NET:
Private Sub GenerateGUID()

        Dim sGUID As String
        sGUID = System.Guid.NewGuid.ToString()
        MessageBox.Show(sGUID)

    End Sub



In例如,我定义了一个字符串变量sGUID来保存我将生成的aGUID。然后我将sGUID的值设置为System.Guid.NewGuid方法返回的值(使用System.Guidnamespace),并使用ToString()将结果转换为字符串。结果显示在消息框中。


In the example, I define a string variable, sGUID, to hold aGUID that I will generate. Then I set the value of sGUID to the value returned bythe System.Guid.NewGuidmethod (using the System.Guidnamespace) and convert the result to a string using ToString(). The result is displayed in a messagebox.


GUID不是UUID。



请参阅StackOverflow文章,如何在C-sharp中生成UUID ,因为字节顺序的差异真正的UUID和微软的GUID。
GUIDs are not UUIDs.

See the StackOverflow article, How can I generate UUID in C-sharp, for the differences in byte ordering between real UUIDs and Microsoft's GUIDs.


这篇关于使用vb.net创建一个uuid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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