Click here to Skip to main content
15,914,109 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: if statement Pin
chrismerrill22-Apr-05 8:38
chrismerrill22-Apr-05 8:38 
GeneralRe: if statement Pin
Suman Singh23-Apr-05 11:48
professionalSuman Singh23-Apr-05 11:48 
GeneralRe: if statement Pin
ADY00724-Apr-05 5:33
ADY00724-Apr-05 5:33 
GeneralTo Mr. Dave.... Pin
vishalmishra22-Apr-05 7:09
vishalmishra22-Apr-05 7:09 
GeneralRe: To Mr. Dave.... Pin
Dave Kreskowiak22-Apr-05 7:19
mveDave Kreskowiak22-Apr-05 7:19 
GeneralROOT Pin
ADY00722-Apr-05 5:32
ADY00722-Apr-05 5:32 
GeneralRe: ROOT Pin
Dave Kreskowiak22-Apr-05 7:20
mveDave Kreskowiak22-Apr-05 7:20 
GeneralRe: ROOT Pin
ADY00722-Apr-05 7:31
ADY00722-Apr-05 7:31 
This textfile is for: my program is to be registered first and i made it, when you click on the button register, automatically the text that has been inputed into the textbox will be transported in the textfile. then when the second time the user opens the program the program will check if theres something in the textfile. if the textfile is not empty then you dont need to register the second time.

This is my register button:

Private Sub btnreg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreg.Click
Dim sw As String = ("C:\Adrian\Registration Test\Register.txt")
Dim s As System.IO.StreamWriter = New System.IO.StreamWriter(sw)
Dim obj As frmprogram
Dim text As String

text = txtbox.Text

If text = "" Then
MessageBox.Show("Invalid Entry", "Registration Error", MessageBoxButtons.OK, MessageBoxIcon.Warning)
s.Close()
End If

If text = "" = False Then
MessageBox.Show("You have registered for the program. Now close the registration menu and start using the program. Have Fun!!", "Registration Completed", MessageBoxButtons.OK, MessageBoxIcon.Information)
s.WriteLine(txtbox.Text)
s.Close()
End If

End Sub
End Class

Then this is the program form which will read from the textfile:

Private Sub frmprogram_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Activated
Dim obj As New Registration
Dim obj1 As frmprogram
Dim sw As System.IO.StreamReader
sw = New System.IO.StreamReader("C:\Adrian\Registration Test\Register.txt")
Dim s As String

s = sw.ReadLine
sw.Close()

If s = "" = True Then
obj.ShowDialog()
End If

If s = "" = False Then
lbltop.Text = "Hello" & " " & s
End If
End Sub
End Class

GeneralRe: ROOT Pin
Dave Kreskowiak23-Apr-05 15:55
mveDave Kreskowiak23-Apr-05 15:55 
GeneralExport a Dataset to a csv file. Pin
UniBond22-Apr-05 4:43
UniBond22-Apr-05 4:43 
GeneralRe: Export a Dataset to a csv file. Pin
chrismerrill22-Apr-05 5:52
chrismerrill22-Apr-05 5:52 
GeneralRe: Export a Dataset to a csv file. Pin
UniBond23-Apr-05 7:51
UniBond23-Apr-05 7:51 
GeneralHowTo Bind An ImageButton to a DataSource.Help!!! Pin
22-Apr-05 4:20
suss22-Apr-05 4:20 
GeneralRe: HowTo Bind An ImageButton to a DataSource.Help!!! Pin
Dave Kreskowiak22-Apr-05 5:14
mveDave Kreskowiak22-Apr-05 5:14 
Generali Pin
Anonymous22-Apr-05 4:09
Anonymous22-Apr-05 4:09 
GeneralRe: i Pin
toxcct22-Apr-05 4:32
toxcct22-Apr-05 4:32 
Generalcollections doubt Pin
carlos_rocha22-Apr-05 3:56
carlos_rocha22-Apr-05 3:56 
GeneralRe: collections doubt Pin
Dave Kreskowiak22-Apr-05 5:12
mveDave Kreskowiak22-Apr-05 5:12 
GeneralRe: collections doubt Pin
carlos_rocha22-Apr-05 7:42
carlos_rocha22-Apr-05 7:42 
GeneralRe: collections doubt Pin
Dave Kreskowiak22-Apr-05 13:17
mveDave Kreskowiak22-Apr-05 13:17 
GeneralRe: collections doubt Pin
rwestgraham22-Apr-05 14:11
rwestgraham22-Apr-05 14:11 
GeneralRe: collections doubt Pin
carlos_rocha25-Apr-05 22:31
carlos_rocha25-Apr-05 22:31 
GeneralRe: collections doubt Pin
rwestgraham26-Apr-05 13:09
rwestgraham26-Apr-05 13:09 
GeneralRe: collections doubt Pin
carlos_rocha26-Apr-05 22:19
carlos_rocha26-Apr-05 22:19 
GeneralRe: collections doubt Pin
rwestgraham1-May-05 10:19
rwestgraham1-May-05 10:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.