?
Solved

Easy question on text box

Posted on 1999-01-08
5
Medium Priority
?
200 Views
Last Modified: 2010-05-03
Im new to vb so how do you open a text file into a text box.
im mean like put the text of file stuff.txt in to text1.text

I need the code for Visual Basic 3
Thanks
0
Comment
Question by:centaurs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
a111a111a111 earned 80 total points
ID: 1455029
Let me make a small code for you.
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1455030
Sub Command1_Click ()
Dim FName, allLine, GetLine, NL' Declare variables.
    NL = Chr(13) & Chr(10)
        FName = "c:\autoexec.bat"
        Open FName For Input As #1   ' Open file.
    Do While Not EOF(1) ' Check for end of file.
        Input #1, GetLine
        allLine = allLine & GetLine & NL
    Loop
    text1.Text = allLine  ' Place the text in the textbox.
    Close #1  ' Close the file
    End Sub

' Note: Make sure that your textbox properties have MultiLine = true

'If you need any more help here let me know.

'also you can email to me at :

'shayplace@hotmail.com
0
 

Author Comment

by:centaurs
ID: 1455031
That worked great thanks. Hey by any chance do you know how to send and receve packets with data to a remote machine like:

localhost send "HI"  remotehost (124.768.94.56)then in a text box the remote host will see HI.

Got any ideas if you can help me on this one ill raise the points to 100.

Thanks
0
 

Author Comment

by:centaurs
ID: 1455032
OH yeah it has to be in VB3 format i cant use a higher version.
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1455033
If you have a problem with the:

Input #1, GetLine
change it to :
Line Input #1, GetLine
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question