Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Help]GUID
#1
Can Anyone give me the Code To Generate a GUID
and Make it Appear in The Textbox1
Yes, ive tried google but, seriously nothing has worked >.<
Thanks[:
Reply
#2
Code:
Public Class Form1
Dim theGUID As String

Private Sub Button_Click
theGUID = System.Guid.NewGuid.ToString()
TextBox1.Text = theGUID
End Sub

End Class

Pretty easy..
Reply
#3
Doesnt Work =/
Reply
#4
Works perfectly fine for me? Paste your exact code & I'll take a look.
Reply
#5
Code:
Public Class Form1
    Dim GUID As String


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        GUID = System.Guid.NewGuid.ToString()
        TextBox1.Text = GUID
End Sub
End Class
Picture:
[As Dubstep Code]
[Image: guidgen.jpg]
Reply
#6
This code will get the GUID value using a RegisteryKey

First we will import Microsoft.Win32(Put this above the class declaration):
Code:
Imports Microsoft.Win32

Now for the GUID Value code:
Code:
Dim regKey As RegistryKey
Dim GUID As String
regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Cryptography", True)
GUID = regKey.GetValue("MachineGuid")
regKey.Close()

The GUID will be stored in the variable "GUID".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)