Vraagje, want ik snap het niet

Status
Niet open voor verdere reacties.

Guitarfreak12

Gebruiker
Lid geworden
22 aug 2011
Berichten
338
Hallo Iedereen!
Ik ben een beginner in VB en ik heb een vraagje:
Ik wil een programma dat ik zelf gemaakt heb iets wat in textbox1 staat in een tekstbestand opslaat.
Hier is de code:

TextBox1.SelectAll()
Dim file As System.IO.FileStream
file = System.IO.File.Create("C:\Open.txt")
MsgBox("Succesfully writed to C:\")

Maar als ik het bestand dan open, is hij leeg, terwijl Textbox1 in het programma gewoon vol is!
Kan iemand mij helpen?
Groetjes, Thijs
 
Je maakt het txt bestand aan maar je schrijft er niet naar toe.

Probeer dit eens.


Code:
   Dim objwriter As New System.IO.StreamWriter("C:\Open.txt")
        objwriter.Write(TextBox1.Text)
        objwriter.Close()
 
En ter info

Zo kan het ook anders om.
Van Txt naar textbox.

Code:
   'Specify file
        Dim myfile As String = ("C:\Open.txt")

        'Check if file exists
        If System.IO.File.Exists(myfile) = True Then
            'Read the file
            Dim objReader As New System.IO.StreamReader(myfile)

            'Save file contents to textbox
            TextBox1.Text = objReader.ReadToEnd
            objReader.Close()
        Else
            MsgBox("File not found!")
        End If
 
Oke,

2 buttons en een textbox op een form.
Met button1 maak ik het bestand aan en zet de tekst uit textbox1 in het txt bestand Open

Met button 2 haal ik de tekst uit het txt bestand wat je net gemaakt hebt weer terug mocht het nodig zijn naar textbox1.
Maar button 2 was alleen maar ter info ,mocht je willen dat je de tekst uit het bestand in textbox1 wil terug zetten meer niet.

Alles in button1 heb je nodig om een txt bestand met de naam Open te maken met de tekst uit textbox1

Code:
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim objwriter As New System.IO.StreamWriter("C:\Open.txt")
        objwriter.Write(TextBox1.Text)
        objwriter.Close()
        MsgBox("Succesfully writed to C:\")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        'Specify file
        Dim myfile As String = ("C:\Open.txt")

        'Check if file exists
        If System.IO.File.Exists(myfile) = True Then
            'Read the file
            Dim objReader As New System.IO.StreamReader(myfile)

            'Save file contents to textbox
            TextBox1.Text = objReader.ReadToEnd
            objReader.Close()
        Else
            MsgBox("File not found!")
        End If
    End Sub
 
Heb je misschien heel de code gekopieerd , incl button tekst ?

Als er al in je form een button 1 staat kan dit niet.

Dan staat er misschien nu 2 keer een button 1 of button 2 in je code.

Geeft dan ook deze error.
 
Hier is de code van mijn hele programma, misschien kan je er wat mee (Let niet op de serials, want dat is maar voor de gein, want ik he een setup gemaakt met die zelfgemaakte serials, dus niks illegaals!)
Public Class Form2

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox2.Text = Int(Rnd() * 4)
Select TextBox2.Text
Case 0
TextBox2.Text = "6756833531-9577018389-8148460043"
Case 1
TextBox2.Text = "3211038966-6985477066-7965300569"
Case 2
TextBox2.Text = "9888636018-4812144622-8919136184"
Case 3
TextBox2.Text = "4251192771-2693084771-2505632432"
Case 4
TextBox2.Text = "1227627534-7330103083-2215711880"
Case 5
TextBox2.Text = "4523714307-3601885184-5534355972"
Case 6
TextBox2.Text = "1390079244-9112050060-3613822610"
Case 7
TextBox2.Text = "2656207689-5160941824-9994162208"
Case 8
TextBox2.Text = "5691072919-8943938177-3268988794"
Case 9
TextBox2.Text = "2876069568-8357685427-5374022186"
End Select
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Exit()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Int(Rnd() * 4)
Select Case TextBox1.Text
Case 0
TextBox1.Text = "CRACK"
End Select
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.SelectAll()
TextBox1.Copy()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox2.SelectAll()
TextBox2.Copy()
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
'Specify file
Dim myfile As String = ("C:\Serial.txt")

'Check if file exists
If System.IO.File.Exists(myfile) = True Then
'Read the file
Dim objReader As New System.IO.StreamReader(myfile)

'Save file contents to textbox
TextBox1.Text = objReader.ReadToEnd
objReader.Close()
MsgBox("Succesfully writed to C:\Serial.txt")
Else
MsgBox("File not found!")
End If
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub


Private Sub RestartApplicationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Restart()
End Sub

Private Sub QuitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Exit()
End Sub

Private Sub ToolStripTextBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub CopyDataFromCompanyBoxToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyDataFromCompanyBoxToolStripMenuItem.Click
TextBox1.SelectAll()
TextBox1.Copy()
End Sub

Private Sub CopyDataFromSerialBoxToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyDataFromSerialBoxToolStripMenuItem.Click
TextBox2.SelectAll()
TextBox2.Copy()
End Sub

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

Private Sub QuirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QuirToolStripMenuItem.Click
Application.Exit()
End Sub

Private Sub RestartToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem.Click

End Sub

Private Sub MinimizeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinimizeToolStripMenuItem.Click
MsgBox("Maded by Thijs Laagland")
End Sub

Private Sub GoToWebbrowserToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form3.Show()
End Sub

Private Sub GoToWebbrowserToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form3.Show()
End Sub

Private Sub GoToCalculatorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoToCalculatorToolStripMenuItem.Click
Form4.Show()
End Sub

Private Sub StoreRegistrationInformationToATXTFileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'Specify file
Dim myfile As String = ("C:\Serial.txt")

'Check if file exists
If System.IO.File.Exists(myfile) = True Then
'Read the file
Dim objReader As New System.IO.StreamReader(myfile)

'Save file contents to textbox
TextBox1.Text = objReader.ReadToEnd
objReader.Close()
Else
MsgBox("File not found!")
End If
End Sub

Private Sub GoToWebbrowserToolStripMenuItem_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoToWebbrowserToolStripMenuItem.Click
Form3.Show()
End Sub

Private Sub MenuStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked

End Sub

Private Sub HelpToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpToolStripMenuItem.Click
MsgBox("This keygen allows you to generate companies and serials, generate serials to a .TXT file, the keygen includes a calculator, webbrowser and many more! You can send me some serials an i will put it in the keygen for you! Mail me at guitarfreak12@hotmail.nl")
End Sub

Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Handles(Button5.Click)
Dim objwriter As New System.IO.StreamWriter("C:\Open.txt")
objwriter.Write(TextBox1.Text)
objwriter.Close()
MsgBox("Succesfully writed to C:\")
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Handles(Button7.Click)
'Specify file
Dim myfile As String = ("C:\Open.txt")

'Check if file exists
If System.IO.File.Exists(myfile) = True Then
'Read the file
Dim objReader As New System.IO.StreamReader(myfile)

'Save file contents to textbox
TextBox1.Text = objReader.ReadToEnd
objReader.Close()
Else
MsgBox("File not found!")
End If
End Sub
End Class
 
Er staat 2 keer button 5

Code:
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Exit()

End Sub


Code:
Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Handles(Button5.Click)

als er _1 achter Click staat is het de 2e van een button.

Denk dat dat je fout melding is
 
Kun je je project even online zetten. Dan pas ik 'm wel ff voor je aan ;)

En volgens mij was ik deze vraag al een keer tegen gekomen?? :confused:
 
Maar ja, iedereen heel erg bedankt, het is gelukt!
En voor iedereen die de code wil zien die ik nu heb gebruikt, hier is ie:
Public Class Form2

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Exit()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
TextBox1.SelectAll()
TextBox1.Copy()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
TextBox2.SelectAll()
TextBox2.Copy()
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim saveFileDialog1 As New SaveFileDialog()
saveFileDialog1.Filter = "Serial file|*.serial"
saveFileDialog1.Title = "Save a Serial file"
saveFileDialog1.ShowDialog()
Dim writer As New IO.StreamWriter(saveFileDialog1.FileName)
writer.WriteLine(TextBox1.Text & vbNewLine & TextBox2.Text)
writer.Close()
MsgBox("Succesfully writed!")
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub


Private Sub RestartApplicationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Restart()
End Sub

Private Sub QuitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Exit()
End Sub

Private Sub ToolStripTextBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub CopyDataFromCompanyBoxToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
TextBox1.SelectAll()
TextBox1.Copy()
End Sub

Private Sub CopyDataFromSerialBoxToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
TextBox2.SelectAll()
TextBox2.Copy()
End Sub

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

Private Sub QuirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QuirToolStripMenuItem.Click
Application.Exit()
End Sub

Private Sub RestartToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem.Click
MsgBox("This is a special keygen, because you can generate a serial file by yourself, and open serial files of course!")
End Sub

Private Sub MinimizeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinimizeToolStripMenuItem.Click
MsgBox("Maded by Thijs Laagland")
End Sub

Private Sub GoToWebbrowserToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form3.Show()
End Sub

Private Sub GoToWebbrowserToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form3.Show()
End Sub

Private Sub GoToCalculatorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoToCalculatorToolStripMenuItem.Click
Form4.Show()
End Sub

Private Sub StoreRegistrationInformationToATXTFileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'Specify file
Dim myfile As String = ("C:\Serial.txt")

'Check if file exists
If System.IO.File.Exists(myfile) = True Then
'Read the file
Dim objReader As New System.IO.StreamReader(myfile)

'Save file contents to textbox
TextBox1.Text = objReader.ReadToEnd
objReader.Close()
Else
MsgBox("File not found!")
End If
End Sub

Private Sub GoToWebbrowserToolStripMenuItem_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoToWebbrowserToolStripMenuItem.Click
Form3.Show()
End Sub

Private Sub MenuStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked

End Sub

Private Sub HelpToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim dlg As New OpenFileDialog()

' Show all files
dlg.Filter = "Serial Files|*.serial"

dlg.ShowDialog()

End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub Button7_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Dim fileReader As String
If My.Computer.FileSystem.FileExists("C:\Serial.serial") Then
fileReader = My.Computer.FileSystem.ReadAllText("C:\Serial.serial", _
System.Text.Encoding.UTF32)
MsgBox(fileReader)
Else
MsgBox("Can't find the file, search?", MsgBoxStyle.YesNo Or MsgBoxStyle.Critical)
If vbYes Then
Dim dlg As New OpenFileDialog()

' Show all files
dlg.Filter = "Serial Files|*.serial"

dlg.ShowDialog()
fileReader = My.Computer.FileSystem.ReadAllText(dlg.FileName)
MsgBox(fileReader)
End If
End If
End Sub

Private Sub GenerateSerialFileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GenerateSerialFileToolStripMenuItem.Click
Dim saveFileDialog1 As New SaveFileDialog()
saveFileDialog1.Filter = "Serial file|*.serial"
saveFileDialog1.Title = "Save an Serial file"
saveFileDialog1.ShowDialog()
Dim writer As New IO.StreamWriter(saveFileDialog1.FileName)
writer.WriteLine(TextBox1.Text & vbNewLine & TextBox2.Text)
writer.Close()
MsgBox("Succesfully writed!")
End Sub

Private Sub LookAtASerialFileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LookAtASerialFileToolStripMenuItem.Click
Dim fileReader As String
If My.Computer.FileSystem.FileExists("C:\Serial.serial") Then
fileReader = My.Computer.FileSystem.ReadAllText("C:\Serial.serial", _
System.Text.Encoding.UTF32)
MsgBox(fileReader)
Else
MsgBox("Can't find the file, search?", MsgBoxStyle.YesNo Or MsgBoxStyle.Critical)
If vbYes Then
Dim dlg As New OpenFileDialog()

' Show all files
dlg.Filter = "Serial Files|*.serial"

dlg.ShowDialog()
fileReader = My.Computer.FileSystem.ReadAllText(dlg.FileName)
MsgBox(fileReader)
End If
End If
End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
End Sub

Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox2.Text = ""
End Sub
End Class
Ik wil ook best wel een downloadlink maken voor degenen die dat willen zodat ze kunnen zien hoe hij werkt, als dat mag van de moderators, want het is en blijft uiteindelijk toch een keygenerator, alleen kun je serial files downloaden en zelf maken!
 
Laatst bewerkt:
O ja, ik heb een nieuwe form ingevoegd, met deze code:
Public Class Form5

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox2.SelectAll()
TextBox2.Copy()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.SelectAll()
TextBox1.Copy()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim dlg As New OpenFileDialog()

' Show all files
dlg.Filter = "Serial Files|*.serial"

dlg.ShowDialog()
'Specify file
Dim myfile As String = (dlg.FileName)

'Check if file exists
If System.IO.File.Exists(myfile) = True Then
'Read the file
Dim objReader As New System.IO.StreamReader(myfile)

'Save file contents to textbox
TextBox1.Text = objReader.ReadLine < 1 >
TextBox2.Text = objReader.ReadLine < 2 >
objReader.Close
End If
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.Hide()
End Sub
End Class
Hij geeft nu een error aan bij objreader.Close
Weet iemand hoe dit kan?
 
Omdat dit niet bestaat:

[cpp]objReader.ReadLine < 1 >[/cpp]

Wat probeer je te doen?
 
Graag gedaan :)

Kun je

1. De vraag op opgelost zetten;
2. De code die leidde tot de oplossing hier plaatsen? :)
 
Public Class Form2

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox2.Text = Int(Rnd() * 4)
Select TextBox2.Text
Case 0
TextBox2.Text = "6756833531-9577018389-8148460043"
Case 1
TextBox2.Text = "3211038966-6985477066-7965300569"
Case 2
TextBox2.Text = "9888636018-4812144622-8919136184"
Case 3
TextBox2.Text = "4251192771-2693084771-2505632432"
Case 4
TextBox2.Text = "1227627534-7330103083-2215711880"
Case 5
TextBox2.Text = "4523714307-3601885184-5534355972"
Case 6
TextBox2.Text = "1390079244-9112050060-3613822610"
Case 7
TextBox2.Text = "2656207689-5160941824-9994162208"
Case 8
TextBox2.Text = "5691072919-8943938177-3268988794"
Case 9
TextBox2.Text = "2876069568-8357685427-5374022186"
End Select
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Exit()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Int(Rnd() * 4)
Select Case TextBox1.Text
Case 0
TextBox1.Text = "CRACK"
End Select
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.SelectAll()
TextBox1.Copy()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox2.SelectAll()
TextBox2.Copy()
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
'Specify file
Dim myfile As String = ("C:\Serial.txt")

'Check if file exists
If System.IO.File.Exists(myfile) = True Then
'Read the file
Dim objReader As New System.IO.StreamReader(myfile)

'Save file contents to textbox
TextBox1.Text = objReader.ReadToEnd
objReader.Close()
MsgBox("Succesfully writed to C:\Serial.txt")
Else
MsgBox("File not found!")
End If
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub


Private Sub RestartApplicationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Restart()
End Sub

Private Sub QuitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Exit()
End Sub

Private Sub ToolStripTextBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub CopyDataFromCompanyBoxToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyDataFromCompanyBoxToolStripMenuItem.Click
TextBox1.SelectAll()
TextBox1.Copy()
End Sub

Private Sub CopyDataFromSerialBoxToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyDataFromSerialBoxToolStripMenuItem.Click
TextBox2.SelectAll()
TextBox2.Copy()
End Sub

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

Private Sub QuirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QuirToolStripMenuItem.Click
Application.Exit()
End Sub

Private Sub RestartToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem.Click

End Sub

Private Sub MinimizeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinimizeToolStripMenuItem.Click
MsgBox("Maded by Thijs Laagland")
End Sub

Private Sub GoToWebbrowserToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form3.Show()
End Sub

Private Sub GoToWebbrowserToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form3.Show()
End Sub

Private Sub GoToCalculatorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoToCalculatorToolStripMenuItem.Click
Form4.Show()
End Sub

Private Sub StoreRegistrationInformationToATXTFileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'Specify file
Dim myfile As String = ("C:\Serial.txt")

'Check if file exists
If System.IO.File.Exists(myfile) = True Then
'Read the file
Dim objReader As New System.IO.StreamReader(myfile)

'Save file contents to textbox
TextBox1.Text = objReader.ReadToEnd
objReader.Close()
Else
MsgBox("File not found!")
End If
End Sub

Private Sub GoToWebbrowserToolStripMenuItem_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoToWebbrowserToolStripMenuItem.Click
Form3.Show()
End Sub

Private Sub MenuStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked

End Sub

Private Sub HelpToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpToolStripMenuItem.Click
MsgBox("This keygen allows you to generate companies and serials, generate serials to a .TXT file, the keygen includes a calculator, webbrowser and many more! You can send me some serials an i will put it in the keygen for you! Mail me at guitarfreak12@hotmail.nl")
End Sub


Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Handles(Button5.Click)
Dim objwriter As New System.IO.StreamWriter("C:\Open.txt")
objwriter.Write(TextBox1.Text)
objwriter.Close()
MsgBox("Succesfully writed to C:\")
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Handles(Button7.Click)
'Specify file
Dim myfile As String = ("C:\Open.txt")

'Check if file exists
If System.IO.File.Exists(myfile) = True Then
'Read the file
Dim objReader As New System.IO.StreamReader(myfile)

'Save file contents to textbox
TextBox1.Text = objReader.ReadToEnd
objReader.Close()
Else
MsgBox("File not found!")
End If
End Sub
End Class

hmmm toch even kijken of dit legaal is of niet.
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan