VB   发布时间:2022-04-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Generating a GUID with VB.NET大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

Introduction

This code generates Globally Unique Identifier (GUID),which can be used to uniqually identify elements in a database.

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

Possessing a unique identifier makes it easy to store and retrieve information. This is especially useful when working with a database because a GUID makes an excellent priMary key.

SQL Server integrates well with GUID usage. The SQL Server data type uniquEIDentifier stores a GUID value. You can either generate this value within SQL Server—using the NEWID() function—or you can generate the GUID outside of SQL Server and insert it manually.

The base System class in the .NET Framework includes the GUID value type. In addition,this value type includes methods to work with GUID values. In particular,the NewGUID method allows you to easily generate a new GUID.

Language and Platform

VB.NET 2005

Compiler

This code segment is for VB.NET 2005

Version

1.0.0.0

Code

    Private Sub GenerateGUID()
        Dim strGUID As String        
        strGUID = System.Guid.NewGuid.ToString()        
        messageBox.Show(strGUID )
    End Sub

大佬总结

以上是大佬教程为你收集整理的Generating a GUID with VB.NET全部内容,希望文章能够帮你解决Generating a GUID with VB.NET所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。