Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string line;
- // Read the file and display it line by line.
- System.IO.StreamReader file =
- new System.IO.StreamReader("c:\test.txt");
- while((line = file.ReadLine()) != null)
- {
- Console.WriteLine (line);
- }
- file.Close();
- Dim theLine as String
- Dim fsFile As New FileStream(inputFile, FileMode.Open) 'File Stream for the Input File
- Dim fsImport As New FileStream(outputFile, FileMode.OpenOrCreate) 'File Stream for the Output File
- Dim srFile As New StreamReader(fsFile) 'Stream Reader for Input File
- Dim swfile As New StreamWriter(fsImport) 'Stream Writer for Output File
- Do While srFile.Peek <> -1 'Do While it's not the last line of the file
- theLine = srFile.ReadLine 'Read the line
- Messagebox.Show(theLine, "Line-by-Line!")
- Loop
Add Comment
Please, Sign In to add comment