Years ago, when I first learned to program in BASIC, I came across a sample program for reading a text file. The OPEN command with the file number looked quite confusing, so I never wrote the program. Later, when I learned Visual Basic, I was shocked to see that the same file operations existed in VB. The basic file-handling commands had not changed; just a few more features had been added.
With Visual Basic .NET, Microsoft introduced a new, object-oriented method for working with files. The System.IO namespace in the .NET framework provides several classes for working with text files, binary files, directories, and byte streams. I will look specifically at working with text files using classes from the System.IO namespace.
Basic methods
Before we jump into working with text files, we need to create a new file or open an existing one. That requires the System.IO.File class. This class contains methods for many common file operations, including copying, deleting, file attribute manipulation, and file existence. For our text file work, we will use the CreateText and OpenText methods.
WEEKLY .NET HOW-TOS
New .NET tutorials updated every Thusday with Cast Your .NET
CreateText
True to its name, the CreateText method creates a text file and returns a System.IO.StreamWriter object. With the StreamWriter object, you can then write to the file. The following code demonstrates how to create a text file:
Dim oFile as System.IO.File
Dim oWrite as System.IO.StreamWriter
oWrite = oFile.CreateText(“C:\sample.txt”)
OpenText
The OpenText method opens an existing text file for reading and returns a System.IO.StreamReader object. With the StreamReader object, you can then read the file. Let’s see how to open a text file for reading:
Dim oFile as System.IO.File
Dim oRead as System.IO.StreamReader
oRead = oFile.OpenText(“C:\sample.txt”)
Writing to a text file
The methods in the System.IO.StreamWriter class for writing to the text file are Write and WriteLine. The difference between these methods is that the WriteLine method appends a newline character at the end of the line while the Write method does not. Both of these methods are overloaded to write various data types and to write formatted text to the file. The following example demonstrates how to use the WriteLine method:
oWrite.WriteLine(“Write a line to the file”)
oWrite.WriteLine() ‘Write a blank line to the file
Formatting the output
The Write and WriteLine methods both support formatting of text during output. The ability to format the output has been significantly improved over previous versions of Visual Basic. There are several overloaded methods for producing formatted text. Let’s look at one of these methods:
oWrite.WriteLine(“{0,10}{1,10}{2,25}”, “Date”, “Time”, “Price”)
oWrite.WriteLine(“{0,10:dd MMMM}{0,10:hh:mm tt}{1,25:C}”, Now(), 13455.33)
oWrite.Close()
The overloaded method used in these examples accepts a string to be formatted and then a parameter array of values to be used in the formatted string. Let’s look at both lines more carefully.
The first line writes a header for our report. Notice the first string in this line is {0,10}{1,10}{2,25}. Each curly brace set consists of two numbers. The first number is the index of the item to be displayed in the parameter array. (Notice that the parameter array is zero based.) The second number represents the size of the field in which the parameter will be printed. Alignment of the field can also be defined; positive values are left aligned and negative values are right aligned.
The second line demonstrates how to format values of various data types. The first field is defined as {0,10:dd MMMM}. This will output today’s date (retrieved using the Now() function) in the format 02 July. The second field will output the current time formatted as 02:15 PM. The third field will format the value 13455.33 into the currency format as defined on the local machine. So if the local machine were set for U.S. Dollars, the value would be formatted as $13,455.33.
Listing A shows the output of our sample code.
Listing A
Date Time Price
22
July 10:58 AM $13,455.33
Reading from a text file
The System.IO.StreamReader class supports several methods for reading text files and offers a way of determining whether you are at the end of the file that's different from previous versions of Visual Basic.
Line-by-line
Reading a text file line-by-line is straightforward. We can read each line with a ReadLine method. To determine whether we have reached the end of the file, we call the Peek method of the StreamReader object. The Peek method reads the next character in the file without changing the place that we are currently reading. If we have reached the end of the file, Peek returns -1. Listing B provides an example for reading a file line-by-line until the end of the file.
Listing B
oRead = oFile.OpenText(-C:\sample.txt")
While oRead.Peek <> -1
LineIn = oRead.ReadLine()
End While
oRead.Close()
An entire file
You can also read an entire text file from the current position to the end of the file by using the ReadToEnd method, as shown in the following code snippet:
Dim EntireFile as String
oRead = oFile.OpenText(“C:\sample.txt”)
EntireFile = oRead.ReadToEnd()
This example reads the file into the variable EntireFile. Since reading an entire file can mean reading a large amount of data, be sure that the string can handle that much data.
One character at a time
If you need to read the file a character at a time, you can use the Read method. This method returns the integer character value of each character read. Listing C demonstrates how to use the Read method.
Listing C
Dim intSingleChar as Integer
Dim cSingleChar as String
oRead = oFile.OpenText(-C:\sample.txt")
While oRead.Peek <> -1
intSingleChar = oRead.Read()
' Convert the integer value into a character
cSingleChar = Chr(intSingleChar)
End While
Tap into the power
We've barely scratched the surface of the new file functionality included in .NET, but at least you have an idea of the power now available in the latest edition of Visual Basic .The abilities of the classes in the System.IO namespace are quite useful, but if you want to continue to use the traditional Visual Basic file operations, those are still supported.
Do you need help with Windows? 







1
soma - 13/07/04
also provides some codes for reading the text line by line.
» Report offensive content
2
nick - 19/02/05
wow this is great ivebenn looking for this code for ages
» Report offensive content
3
Ted Tomany - 07/05/05
Very informative article. Helps me a lot.
» Report offensive content
4
Howard Simon - 10/05/05
First of all, thanks for taking the time to place pieces of code on the internet such that people like myself can use other's knowledge to program. However, I am running into a problem. This method, along with the Print #1, allowed within VB in Excel macros is limited to ~32K size. What method can be used in an Excel macro environment that would exceed the 32K limitation?
» Report offensive content
5
asdf - 11/05/05
This has been a great help. However how do you "attempt" to read from a file. In other words how do you handle an exception when no file can be found?
Say if i want to open a file called "asdf.txt" but only if it exsists. If I try and do it with your code my program just crashes if it doesn't exist.
» Report offensive content
6
Andrew Kong - 15/11/05
I find your articles really helpful but I am trying to find out some more info about this readline() method...
I want to open a text file and search for a specific character in my case a "=". I also want to see if there is a string of characters beyond the =. The text file has many lines some with characters beyond the "=" some without...I want to count the amount of lines with characters beyond the "="
If you can help it would be greatly appreciated
» Report offensive content
7
Hany Mousatfa Khodair - 17/11/05
That was really helpfull and mostry Focused
Thank you very much
» Report offensive content
8
Gourisankara - 18/11/05
Hi every body,
i am developing VB.det post, how to call .txt file in my application.I tried this way but i didn't get the answer.
This is my code:
Dim EntireFile As String
read = File.OpenText("D:\sample.txt")
EntireFile = Read.ReadToEnd()
» Report offensive content
9
Harsha Vardhan - 01/12/05
sir i want full code in a sequential wise how to read n write a text file in vb.net as a beginner of vb.net
» Report offensive content
10
Barbara JoAn Varner - 30/01/06
your informatin is very informative as far as it goes. i have many more issues to solve
Attaching sublists to selected nodes of the main list. there are two text files each with data for the same players, 15 of them one is current data the other is history scores for from 3 to 10 years. I need to read both files and combine the data for each player and write it to a file sorted by year.
Building an ordered list (each sublist will be an ordered list)
Sorting a linked list (the main list will be sorted)
Building a doublely-linked list
Functionality to interactively add payer nodes
Functionality to edit and delete player data
Searching a linked list
Opening an external file for output and writing to the file
any ideas?
» Report offensive content
11
Rose Anne Coulter - 04/02/06
Excellent web site. Simple and easy to use. A bookmark I will keep.
» Report offensive content
12
praneth raj - 18/04/06
If i store data in text files in 3 different columns and i want to retreive data form a particular column. How is it possible to traverse along one particular column until it ends
Please reply i am in nedd of that
» Report offensive content
13
Bob man - 12/06/06
I to would like some info on how to get info from 3 columns. please email thanks
» Report offensive content
14
Brice - 12/07/06
great tut boys
» Report offensive content
15
vijay - 14/07/06
Dear Sir,
i want to read a text file line by line and at the same moment
i want each line to be written in new file,i.e i want to copy file line by line and want to give the new file name as older one
please help me
regards
vijay
» Report offensive content
16
Chaitra - 18/07/06
Hello,
Thank you very much for this code... It really works great.
However, I want to read only last line of the .txt file.
Is that possible???
REgards
Chaitra
» Report offensive content
17
sangeeta - 19/07/06
How do you search for files and folders mathing the string input by a given user in the textbox in vb .net?
» Report offensive content
18
Cory Sharshel - 28/07/06
Does anyone know if it is possible to read a file line by line starting at the end of the file and working towards the start of the file?
Regards
» Report offensive content
19
Mohan Kumar - 03/08/06
I Want to print a text file using with VB.Net (for Dot Matrix Printing)
and
How to set a right alignment in a text file?
» Report offensive content
20
Baseer - 03/08/06
i would like to Read a text file line by line and at the same moment write to it line by line? is it possible to do it without creating temp text files.. ?
» Report offensive content
21
Muktesh Shrivastav - 11/08/06
hi,
I want read a text file and search for a particular pattern appearing in it. using vb.net.
if it is possible please provide some code also for it
regards
muktesh
» Report offensive content
22
sanjay - 18/08/06
i want to change the font of text that i passed in writeline method ..
please do help
» Report offensive content
23
Balakrishnan - 26/08/06
Hi tis very nice..
i want 2 know if the file is existing means i want to append the file..
how can do tis..
» Report offensive content
24
Puneet - 29/08/06
its helpful
plz explain my code also
bw.Write(CStr(j))
what this line represents
» Report offensive content
25
dks - 29/08/06
to run a bat file using vb.net
» Report offensive content
26
oms - 14/09/06
how to copy inputs from GUI calculator to exe file of bc commands...means how to copy integer calculations to bc.exe command prompt to calculate with the bc commands...
first things is to open the exe file and then auto copy that integers to the exe file and auto calculate..
» Report offensive content
27
aruna - 21/09/06
hello sir
can u plz suggest me how to open a form in a text file
» Report offensive content
28
Kamlesh Gujarathi - 27/09/06
Easy way is to read the file is only in VB.NET is -
objFile = objFile.OpenText(“C:\MyFile.txt”)
While objFile.Peek <> -1
objFile.Read()
End While
Thanks
Kamlesh Gujarathi (TL)
ITShastra INDIA Pvt Ltd.
kamleshvgujarathi@yahoo.com
» Report offensive content
29
Joe - 27/09/06
this is the best way that I have found to read and write to a file...
» Report offensive content
30
Joe - 27/09/06
this is the best way that I have found to read and write to a file...
» Report offensive content
31
priyantha - 17/10/06
does anyone know about designing the link list to store text masages which from text file of through users (using vb.net)
» Report offensive content
32
Kaleem - 30/10/06
Friends,
I am developing software for Smart Device using VB.NET, I have a text file of 45 MB. When I search record it takes long time as I am using loop. I want to know how to create index to a text file and seek using Index which will give fast search.
Thanks in Advance.
» Report offensive content
33
Kaleem - 30/10/06
Friends,
I am developing software for Smart Device using VB.NET, I have a text file of 45 MB. When I search record it takes long time as I am using loop. I want to know how to create index to a text file and seek using Index which will give fast search.
Thanks in Advance.
» Report offensive content
34
Pankaj Sisodiya - 31/10/06
Thanks
» Report offensive content
35
JNorte - 05/11/06
To read last line i use this, and it work's for me.
» Report offensive content
36
zoma - 07/11/06
pls sir,
can anyone give me a sample login code using usrename and password that willl be able to access files instead of database,add new users to the text file and for new users to be able to sign in, generally reading and writing to a text file but using forms instead of a console application.
regards
» Report offensive content
37
krishna - 09/11/06
how to read a .upd file and display it in textbox using vb.net.if file is random access mode
» Report offensive content
38
Sandeep - 12/11/06
Thanks a lot
» Report offensive content
39
priyantha - 13/11/06
i want to know about create link list and how it will defrag and graphically represent the defragment process using grid.
» Report offensive content
40
Manoj Kumar - 15/11/06
any one help me to store every line of the text file into an array and to display it on RichTetBox control and any ideas on arranging the contents in alphabetical order.
Thanks in Advance.
» Report offensive content
41
kumar nitya nand - 22/11/06
This code may helps you all to read and write the file
» Report offensive content
42
Balakrishnan - 11/12/06
I want to search the particulare string in text file and change the string to another string.
» Report offensive content
43
Somasundaram - 10/01/07
How to get the .Doc file's contents Using VB.net...
I want to get the .txt and .Doc files. but here i wrote the code only for displaying the txt file's contents.But it wont display the .Doc files.
I select the Doc and txt fileNames in Listbox.but File's Contents has to display in Richtextbox.
so I've written the code for(.txt) files only.But i need (.Doc) file's contents also.So How to get the (.Doc files Contents).So pls some one Help me......
» Report offensive content
44
somasundaram - 10/01/07
How to get the .Doc file's contents Using VB.net...
I want to get the .txt and .Doc files. but here i wrote the code only for displaying the txt file's contents.But it wont display the .Doc files.
I select the Doc and txt fileNames in Listbox.but File's Contents has to display in Richtextbox.
so I've written the code for(.txt) files only.But i need (.Doc) file's contents also.So How to get the (.Doc files Contents).So pls some one Help me......
» Report offensive content
45
Teddy - 26/01/07
Can some one help how to access recent documents in vb.net
I have menu- with open, save , I want to see recent saved documents
» Report offensive content
46
manisha - 01/03/07
sir,
i wanted to store selected items of listbox in the file.
how to write(store) it in file i am not geting? Please guide me.
Thanks,
Manisha
» Report offensive content
47
Manisha - 02/03/07
please guide me for how to write data in a file.
Thanks,
Manisha
» Report offensive content
48
Sanjay - 05/03/07
Please Can anyone help regarding file handling querry is
how can i change font size while writing into word document with writeline method ....
Please help
» Report offensive content
49
Kishor A. Jagtap - 06/03/07
I want to Genrate a text File From the form
» Report offensive content
50
Jan Laureys - 14/03/07
Thanks for the info :)
» Report offensive content
51
dk - 30/03/07
Hello Sir
I am new in vb.net and i am working on reading and writing files project i have done how to write text in file and now i also want to display file text in message box or in different form like i stored name and age in one line and second line is name2 and age2 and so on ..and i put one combo box so it's displays all the name which already saved in test.txt file
now what i want to do here if user choose one name from combo box so i want to display only that name and age not anyother name and age in that test.txt file i mean if user choose name5 from combo box so i want to display name5 and age5 in message box or in text box
any help
wating for your kind rep.
» Report offensive content
52
Himanshu Anand - 02/04/07
i want to access a file(web.config) but i want to access some perticular values from that file, not the whole file.
So how can i serach for a keyword in whole file.
Apart from this i have to show these key word in a data grid.
Can anyone help me in doing this.
Any type of help will be highly appriciated.
Thanks in advance.
Himanshu.
» Report offensive content
53
Neeraj Kumar - 05/04/07
Hi
I wants to change the font size in text report.
But not able to do so.
Plz help me.
Thanks
» Report offensive content
54
aisya - 12/04/07
Could you please to tell me how to save data sql server to the text files....if you dont mind ...give samples code to import data from sql server and saves it at text files.... please...these my code
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
phoneStreamWriter.WriteLine(txtName.Text)
phoneStreamWriter.WriteLine(txtPhone.Text)
With txtName
.Clear()
.Focus()
End With
txtPhone.Clear()
End Sub
» Report offensive content
55
Sunitha - 17/04/07
Thnak a lot for this infomation.
» Report offensive content
56
Sunitha - 20/04/07
Some code to hep you for writing into a file.
» Report offensive content
57
Mark Jones - 23/04/07
Excellent, just what I was looking for
» Report offensive content
58
Ravfee - 23/04/07
thank for infomation
» Report offensive content
59
Raheem MA - 01/06/07
Great explanation about files concept for beginers of VB.Net. It helps me alot.
thanks for ur help.
» Report offensive content
60
Raheem MA - 01/06/07
Great Explanation, It helps alot for Beginers of VB.Net like me.
thanks ...
» Report offensive content
61
Vijay - 08/06/07
Thanks for the good stuff.!!
» Report offensive content
62
Satish - 08/06/07
good information
» Report offensive content
63
Ravikiran - 18/06/07
hi,
i wanted to know how to write in a text.txt file in a particular position i want fix the containt in a particular position as i want
» Report offensive content
64
Surbhi - 20/06/07
I need a code in VB which will read the .txt file and replace no. of spaces with one comma and then this file will be opened in excelsheet where at encounter of each comma the column will change.
Pls help me....!!!!
» Report offensive content
65
Ayaz Khan - 25/06/07
I need to read data from a text file and insert them into a table with the column provided in the text file. Please help me with this. Ayaz
» Report offensive content
66
Raj - 17/07/07
Thanks for the info :)..Its very use full
» Report offensive content
67
prabhat - 21/08/07
How to convert the readonly mode of a file to append mode??
is it possible??
plz help me.
» Report offensive content
68
prabhat - 21/08/07
How to convert the readonly mode of a file to append mode??
is it possible??
plz help me.
» Report offensive content
69
Shehan - 24/08/07
Thank you! This helped me a lot!
» Report offensive content
70
Shehan - 24/08/07
Thank you! This helped me a lot!
» Report offensive content
71
sikhan - 30/08/07
I am new in VB.Net codding, i have a project to read the particular folder in that folder have files to search n which will open in txt file in list box or txt box and search some data i.e. filename etc which will show in grid
( which is came through novel server)
so please help me regarding this and if you have infromation about please forward to my email address sikhan555@yahoo.com.
thanks in advance
regards
sikhan
» Report offensive content
72
sikhan - 30/08/07
I am new in VB.Net codding, i have a project to read the particular folder in that folder have files to search n which will open in txt file in list box or txt box and search some data i.e. filename etc which will show in grid
( which is came through novel server)
so please help me regarding this and if you have infromation about please forward to my email address sikhan555@yahoo.com.
thanks in advance
regards
sikhan
» Report offensive content
73
sonal - 08/10/07
Really very Useful
» Report offensive content
74
Chloe - 09/11/07
Hi all,
i am working on a project that read the database file from Access in VB.NET. Then I have to chop a original data from the column and fill the splitted data into new column.
For example, the data in the particular column is
ABC 1 2 1
So i have to split the numbers by ignoring the characters and assign it into new column. It's huge data.
Anyone could help?
Thanks in advance.
» Report offensive content
75
Jaya - 26/11/07
As I am a fresher in vb.net, i want to know how text reports can be created in this. And how values can be taken from the database?
» Report offensive content
76
Johnny - 05/12/07
Hey All I'm a begginer at vb.net all i wan't to know is how would I store some information from a simple combo box in a textfile or put the contents of the combobox into a .txt file if anybody can help
thanks
» Report offensive content
77
asrol - 17/01/08
How to delete specific data in text file ? Any body help me.
» Report offensive content
78
Nilesh(TigerN*) - 19/02/08
first i have Thanking you.
for help me in spliting.
» Report offensive content
79
tushar - 05/03/08
can we do this file creatino and writing in C# .NET
» Report offensive content
80
sharath - 12/03/08
can we use loops in writting a Line
» Report offensive content
81
jubertroldan - 26/03/08
i need help in replacing a specified line (with index) in a text file. please help. jubertroldan@yahoo.com thankyou
» Report offensive content
82
jerrychu - 30/03/08
Say, i got a txt file, the value inside is copy from excel. like
1 2
1 3
1 5
I got 100k lines record, I want to do some calculations, so I want to define a(i) for first colonum and b(i) for second column. so how should I do it? Thanks
» Report offensive content
83
John Madison - 02/04/08
Imports System
Imports System.IO
Dim oFile as System.IO.File
Dim oWrite as System.IO.StreamWriter
oWrite = oFile.CreateText(“C:\sample.txtâ€)
OpenText
The "oWrite = oFile.CreateText..." line gives me the error:
"Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated."
What am I doing wrong? I can never get VB.NET examples to work. Even the simple ones. It always seems that some vital peice of information gets left out.
Though at least this example mentioned the IMPORTS statement. Sometimes examples leave out what to import. Which makes it very confusing for someone who only programs in their spare time.
» Report offensive content
84
chandru - 02/04/08
how to read a particular line in the text file.
if anybody knows help me.
thanks,
chandru
» Report offensive content
85
pcpchandru - 02/04/08
how to read a particular line in the text file using vb.net 2005
if anybody knows help me.
thanks,
chandru
» Report offensive content
86
pcpchandru - 02/04/08
you have to create a file using filestream then onlt u will write a string on the particular file name.
» Report offensive content
87
James - 10/04/08
How do I read a text file and have it display line by line in VB.Net or show only certain lines like only show line 3 or 4
» Report offensive content
88
syam - 11/05/08
can you specify
best way to operate on files
both binary and text file
which are the main class to use
» Report offensive content
89
aseem - 12/05/08
i am trying to do doing programs in pocket pc device windows ce os how i can make tab controls and data reading possible in this device
» Report offensive content
90
sruthi.c - 14/05/08
how to read and dispaly any type of file say .doc,pdf,excelspreadsheet in a textbox in c# windowsforms
i am able to read and dispaly only text files not not the other file.
Please help.
» Report offensive content
91
stephen - 05/06/08
How can i read from text file one line at a time? I'm implementing a next and previous button which will only retrieve a single line everytime a button is pressed.. thank you..
» Report offensive content
92
stephen - 05/06/08
How can i read from text file one line at a time? I'm implementing a next and previous button which will only retrieve a single line everytime a button is pressed.. thank you..
» Report offensive content
93
Rajendra prasad - 09/07/08
How to search a file or folder when i give a input in textbox control that should be search Entire Drive and display the Actual path where it is located I am doing this Application in C#.net windows applicaion plz help me
» Report offensive content
94
wahid ali - 10/09/08
your code is not help me.
i want there is .txt file in my system.open the .txt it having white spaces.i want some text in a column till last row and comes into database.
» Report offensive content
95
aneroph - 15/09/08
None of these methods are working for me. i have been looking all over to figure out how to read and write in VB 2008 but i cant find a single tutorial that works. I am making a game and i want to be able to save high scores and names to a file and then when someone plays through i need to open up that file and compare their score with the other numbers saved and possibly insert it. i can do the "if" statements and what not but i cant find anything that works even to just save some text let alone ten different texts with names. someone please help
» Report offensive content
96
Rosh - 24/09/08
Hey,
None of the Codes are working for me.
Im new to VB.Net working on Win App.s.(VS-2005) Im tryuing to read a text file and display the contents in the text items of the App. form.
Can any one plz help.
» Report offensive content
97
Nader Hussain - 03/10/08
How do I define oFile? The object must be assigned a value. This is for a *.txt file.
» Report offensive content
98
Rozie - 08/10/08
How can i convert from vnet to text file..
please help...
thans..
» Report offensive content
99
vishals - 02/11/08
Hi I need help. I am having difficulty in reading and writing data from datagrid in vb.net from text files.
I have to first write the data entered to the text files.
and secondly to call same on the datagrid.
Thanks to advise the code.
» Report offensive content
100
Mironi - 14/11/08
Thanks for taking your time to help me and others.
These comments and codes helped me.
» Report offensive content
101
1 - 15/11/08
3
» Report offensive content
102
kunal - 12/01/09
how can i clear the contents of a file before writing to it...i see that i open the file using file.Open , but the text is appended at the beginning rather than overwriting it...
» Report offensive content
103
Jason Giandalia - 20/01/09
I am new to VB. Currently using VB 2008 Edition. Trying to read from a text file. That is not a problem but I am trying group by a certain name. Here is the text file I am trying to play with:
George
Gold
Sally
Silver
Bob
Bronze
Bruce
Bronze
Steve
Silver
Gwen
Gold
Superman
Silver
Joe
Silver
Bill
Bronze
Geraldine
Gold
Mike
Bronze
Basically I need to show in the following order: "Bronze" then "Silver" then "Gold"
I know this is probably a basic function but I have not been able to find anything.
If you have any advice, please let me know.
» Report offensive content
104
mehul akoliya (patel) - 28/01/09
please more example send my e-mail id ...............
i thank full for you bay
» Report offensive content
105
trijoed - 30/01/09
thanks a lot. Its helpfull for me. But, would u make your article shortly?
» Report offensive content
106
anusha - 11/02/09
your explanation is very clear. Thank u so much. It is very helpful to me to learn file operations in vb.net
» Report offensive content
107
mitra - 06/03/09
pls write the hint of code.
» Report offensive content
108
Alex_W - 10/03/09
I need to read a text file, find a line that contains "ComputerName=" then write this line to a string variable I can set to a label on my form. Does anyone have code for this?? Closest thing I have (which doesnt work) is coded:
» Report offensive content
109
kag-man - 13/05/09
please help how to read and write to a rext file using vb2005 " Windows Application "
» Report offensive content
110
Jack Bhanded - 19/05/09
Thank you Nityananda for great piece of code!
Regards,
Jack
» Report offensive content
111
Hussein - 26/05/09
Very helpful. Thank you so much!
» Report offensive content
112
susan - 03/06/09
can u send me the code how to read n write from textfiles using VB.net....
n from vb.net to access databases
» Report offensive content
113
dddd - 15/06/09
sfsdasdsd
» Report offensive content
114
Paresh - 18/06/09
Very useful. Thanks for sharing this information.
» Report offensive content