I will be using Microsoft Visual Studio 2005.
The code is as following:
First we will use the namespace "System.IO" as we will be viewing output from the text file.
using System.IO;
then the code will be in braces like this.
{
String line=Null;
System.IO.Textreader readfile=New Streamreader("C:\\" + textbox1.Text);
line=readfile.ReadToEnd();
textbox2.Text(line);
readfile.close();
readfile=Null;
}
There may be some errors in this code as i am new to this particularly if readfile.close() gives error then remove the brackets.The name of the file you write in the text box1 must already exist the entire data of the file will be displayed in text box2.to create a file.
{
create.file("C:\\" + textbox1.Text);
}
You can also use combobox to display data of textfile.
Edited by Roger, 07 July 2011 - 01:58 PM.


Sign In
Create Account

Back to top









