Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I havent done vb.net in awhile been doing php but anyways now im back for more ! :p anyway im trying to take the first lets say 15 letters per line of a .txt file and display each in a text box. Its a part of a larger program im developing. Thanks any suggestions as to what syntax i should be reviewing/learning? lol
Posted
lots of examples under StreamReader

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted (edited)

Dim sr As StreamReader = New StreamReader("C:\me.txt")

Dim line As String

 

 

Do Until line = Nothing

line = sr.ReadLine()

TextBox1.Text = TextBox1.Text & vbCrLf & line

 

Loop

 

 

 

textbox shows nothing. It is set to multiline etc..any suggestions?

 

 

 

 

 

 

 

 

***update***

nevermind figured it out 2min's after posting :rolleyes:

 

Dim sr As StreamReader = New StreamReader("C:\me.txt")

Dim line As String

 

 

Do

line = sr.ReadLine()

TextBox1.Text = TextBox1.Text & vbCrLf & line

 

Loop Until line = Nothing

 

 

sr.Close()

 

 

 

 

Now my problem comes with getting a file that open to be read only cause i only want to read it and in this particular program the file will be in use by another program and it gives me an error stating its in use. I just need to read it and update the textbox in the program.

 

Nevermind I got it..geeze lol i need to think deeply before posting @_@

Edited by neodammer

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...