VB.NET Tutorial 42 - Reading Text Files (Visual Basic 2008/2010)

preview_player
Показать описание
This is a pretty simple and short tutorial that will teach you how to take the text from a text file and write it into a textbox using StreamReader. I probably should have created this tutorial a long time ago but never really thought about it.

For more information, check out the website:
Рекомендации по теме
Комментарии
Автор

Nice video! Thank you very much. I used this for a project at work and it came in very handy!

arsdu
Автор

@JasonBoomGames code w/e button you were gonna code and then click on the FORM's properties, under Misc you will see "accept button". whatever u select as accept button will run when the user presses enter.

unknowdud
Автор

thank you so much for uploading these tutorials, you saved my day dude, muchas gracias compa xD

mamezerox
Автор

nice tutorials, is there much to adding a browse button?

kennycelt
Автор

@ShayAxelod22 you split them with a : or some symbol and 0 would be the first text before the symbol and 1 would be the etc so you split the stuff with your symbol and make new strings using .split(0) or something like that

vinceguy
Автор

También del archivo").. Gracias por tus videos me sirvieron mucho y me suscribí !!

PichichoLa
Автор

Yeah that works fine too, but I wanted to create a video on using the streamreader.

TeachMeComputer
Автор

Hey, great tutorial but I have a few questions...
1. is there a way to only read the first line of the text file, then in a new textbox read the second line?
2. is it possible to keep the file location the same every time so the user does not have to type it in?
any help would be awesome, thanks

bloo
Автор

How can I get it to check how many lines there are in the text document?

MeGaHaCkErZzZ
Автор

Hi this is a really great tutorial like all of your's are, but I'm curious what would I have to change if I want it to automatically read the same file path every time? See I wrote a script for our domain controller that writes the logon name/machine name/IP address to a text file on a network share. So I want a vb program that once opened constantly reads that text file? If another user logs on and adds a line to the file, I want to see it live. Or I could write them as individuall files? Help!

Designandrew
Автор

great tutorial..but how do I fix this "NullReferrenceException occurred" problem with Textbox2.Text = objread.ReadToEnd....I made the text file from VB.Net would I have to enter the address of the file?

jedllorente
Автор

@8o8inSquares I've got them to be in the textbox but I don't really know how to use them

oinSquares
Автор

How do I read variables from the text file like:
var1=85
var2=stringLol

and use them?

oinSquares
Автор

Hello there,
i'v got a question.
is it also possible to make a video about:
opening a txt file, save it, rewrite it and to delete it ?

If i want to change the text it won't change it ..

thegreatlen
Автор

Can I make it read form the internet? I have a file on drop box that i want my program to read

bitslime
Автор

What if i want it so my button opens the text file, how do i do that?

ImPhusic
Автор

How can I make the program to read a specific line?

Olemassacre
Автор

if i want to read file containing nos in two columns and want to save the nos in a[i] and b[i] line by line ....how to do it?

HimangshuBhuyan
Автор

You'd need to pull the file, then read it. Really simple actually, Just look up FTP Visual Basic. Its as simple as requesting the file with the FTP credentials. I used that method as a makeshift update system. It pulled a file from the server, checked its version, and deleted it. That way I don't need to integrate live applications and server crap.

darkstars
Автор

how do you make this support url files?

TehMapleDude