• 0

[VB]File Input and Current Directory


Question

I just need to know how I can access the CurrentDirectory. It's in C:\Users\Me\My Documents\VS2008\Projects\DES\input.txt, it won't always be that exact one so how do I get it to recognize where it is. I tryed Googleing it but I'm getting no where.

Try
			Using sr As StreamReader = New StreamReader(WHAT DO I NEED HERE + "input.txt")
				Dim line As String
				Do
					line = sr.ReadLine()
					'I'm outputting to a text box and I'll be doing more to it later.
					txtInput.Text = txtInput.Text + vbCrLf + line

				Loop Until line Is Nothing
			End Using
		Catch ex As Exception
			MsgBox("Invalid Input File", MsgBoxStyle.Exclamation, "ERROR")
		End Try

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.