Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27348

Loading a textfile to a textbox?

$
0
0
Hi everyone. I am migrating a vb6 prog to vb net, and was wondering if loading a textfile to a textbox was similar in vb net.

I used this code in vb 6.

VB Code:
  1. Public Sub LoadMsgStatus()
  2. Dim sFileText As String
  3.     Dim iFileNo As Integer
  4.       iFileNo = FreeFile
  5.           'open the file for reading
  6.       Open App.Path & "\MsgSwitch.txt" For Input As #iFileNo
  7.     'change this filename to an existing file!  (or run the example below first)
  8.           'read the file until we reach the end
  9.       Do While Not EOF(iFileNo)
  10.         Input #iFileNo, sFileText
  11.  
  12.           'close the file (if you dont do this, you wont be able to open it again!)
  13.       Close #iFileNo
  14.  
  15. End Sub

I am going to use something else for the path, but was wondering if there any changes to load it in vb net? Thank you!!

Viewing all articles
Browse latest Browse all 27348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>