Hi friend i have one requiremnt can you help me
we need to pick up a txt file from our local system ssuppose c:\textfile,.txt
in txt file if we have 4 lines
text 1
text 2
text 3
text4
i need to need pick only the 2and 3 lines and need to paste it in the web application specific textboxs
text2 --textbox 1
text3 --textbox 2
sample code i have tried in console
can any one help me through web applicaton the same thing
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.IO;
- namespace textfilereading {
- class Program {
- static void Main(string[] args) {
-
- TextReader tr = new StreamReader(@ "G:\tetfile.txt");
-
- int NumberOfLines = 15;
-
- string[] ListLines = new string[NumberOfLines];
-
- for (int i = 1; i < NumberOfLines; i++) {
- ListLines[i] = tr.ReadLine();
- }
-
- Console.WriteLine(ListLines[5]);
-
- Console.WriteLine(ListLines[1]);
- Console.ReadLine();
-
- tr.Close();
- }
- }
- }