| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Nov 2006 Location: entrepreneurhosting.co.uk
Posts: 401
![]() ![]() | Need help in reading from a text file in VB i know this isn't complex and i've search around but can't find anything which works for me. But i'm wondering how i could read from a text file. i want to display the text into a vb 'text box' assume the .txt file is loacated at c:text/text.txt what would be the code i would need for this. Thanks again
__________________ Entrepreneur Forum, Business Forum - Fastest growing Business forum http://Z0P.com, http://0Q6.com - directories :) Electronic service My holding page for all my websites, includes blog :) |
| |
| | #2 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,963
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | VB6 or VB.net ?
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Regular Join Date: Nov 2006 Location: entrepreneurhosting.co.uk
Posts: 401
![]() ![]() | vb6 - sorry should of stated this
__________________ Entrepreneur Forum, Business Forum - Fastest growing Business forum http://Z0P.com, http://0Q6.com - directories :) Electronic service My holding page for all my websites, includes blog :) |
| |
| | #4 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,963
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Something along these lines: Assuming the file is C:\digi.txt and the textbox is named txt_output Code: Dim int_fh As Integer
Dim str_contents As String, str_file As String
int_fh = FreeFile
Open "C:\digi.txt" For Input As int_fh
Do While Not EOF(int_fh)
Line Input #int_fh, str_contents
Me.txt_output.SetFocus
str_file = str_file & str_contents ' concatenate
Loop
Close #int_fh
Me.txt_output.Text = str_file
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |