Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello.i have a text file in which the names of the sutdents occur at various placec .there is the text written "names" and then the name of one student follows it.similarlly at another place this text "Names" comes with the name of the student followed.i want to fetch the name of the student one by one i.e. first name is to be fetched then i have to do some commands then after that commands i have to fetch another name and do the same commands.....like this i have to continue....my problem is that how to fetch the name of the student one by one and put them in the text box that is placed in the vb6 form.please help in details as i mm not much familiar with file reading in vb6.
Posted

There are lots of tutorials on reding/writing files with VB6. See, for instance "How to read simple text files"[^].
:)
 
Share this answer
 
 
Share this answer
 
v2
Please follow below steps to read the contents of the file Template.txt present in the Templates folder of the root Directory of the website.

1. create FileStream object, first parameter is the path to the file.
Dim fs As New FileStream(HttpContext.Current.Server.MapPath("~\Templates\Template.txt"), FileMode.Open, FileAccess.ReadWrite, FileShare.None)
Dim sr As New StreamReader(fs)

Dim sbMailText As New StringBuilder(sr.ReadToEnd())//Reads all the contents of the file into StringBuilder object.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900