Seeing if a file exists

devil666

Member
Joined
Dec 2, 2006
Messages
8
Programming Experience
1-3
hello!

I need to see if a text file exists...

can someone give me the code to read a text file, or the equal opposite of this:
VB.NET:
Expand Collapse Copy
Dim strName As New System.IO.FileStream(Application.StartupPath & "\" & Me.TextBox1.Text & ".txt", IO.FileMode.OpenOrCreate, IO.FileAccess.ReadWrite)
Dim sw As New IO.StreamWriter(strName)
sw.WriteLine("User Name: " & Me.TextBox1.Text)
sw.WriteLine()
sw.WriteLine("Password: " & Me.MaskedTextBox1.Text)
sw.Close()
sw.Dispose()
MyBase.Close()
 
Back
Top