im wanting to make my program have to enter a serial and you dont have to enter anymore (Only once) if you want the full version, i have some code here, but i cant seem to get it to work properly, Can anyone help me? this is the last piece i have to do and its finished.
Code:Private Sub KryptonButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KryptonButton1.Click If KryptonTextBox1.Text = "" Then MsgBox("Whoops! - Please make sure that all of the information with the * is filled out, and then try again!", MsgBoxStyle.Critical, "Whoops!") Else If KryptonTextBox1.Text = "N5869-N2201-N4859-N7832" Then MsgBox("Thank you for registering, enjoy the full program! Noter will now restart to apply all changes!", MsgBoxStyle.Information, "Thank you!") Form2.OptionsToolStripMenuItem.Enabled = True Dim objStreamWriter As StreamWriter 'Pass the file path and the file name to the StreamWriter constructor. objStreamWriter = New StreamWriter("C:\NoterPRO.txt") 'Write a line of text. objStreamWriter.WriteLine("Serial encrypted") 'Close the file. objStreamWriter.Close() objStreamWriter.Close() Dim retval As String retval = Dir$("c:\NoterPRO.txt") If retval = "Serial.txt" Then Form2.OptionsToolStripMenuItem.Enabled = True KryptonTextBox1.Text = "You have already registerd Noter!" KryptonTextBox1.Enabled = False KryptonButton1.Enabled = False Application.Restart() End If End If End If End SubCode:Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim retval As String retval = Dir$("c:\NoterPRO.txt") If retval = "Serial.txt" Then OptionsToolStripMenuItem.Enabled = True Form3.KryptonTextBox1.Text = "You have already registerd Noter!" Form3.KryptonTextBox1.Enabled = False Form3.KryptonButton1.Enabled = False End If End Sub




Reply With Quote