string strLine = null; string strText = null; FileStream FileInput = new FileStream("C:\\test.txt", FileMode.Open); StreamReader sr = new StreamReader(FileInput); while (sr.Peek() != -1) { strLine = sr.ReadLine(); strText += strLine; } String strString = strText; String[] myArr = strString.Split(' '); int i = 0; string a; //string[] strShow = null; foreach (String myList in myArr) { if (myList != "") { a = myList + "|"; if ((a.Contains("0") == true) || (a.Contains("1") == true) || (a.Contains("2") == true) || (a.Contains("3") == true) || (a.Contains("4") == true) || (a.Contains("5") == true) || (a.Contains("6") == true) || (a.Contains("7") == true) || (a.Contains("8") == true) || (a.Contains("9") == true)) { Response.Write(a); strConn.UPFilePayment_Ins_Del(a, "INSERT"); //Array.Resize(ref strShow, i + 1); //strShow[i] = a; //i = i + 1; } else { // i = i + 1; } i = i + 1; } } //for (int j = 2; j < strShow.Length; j++) //{ // string s = strShow[j]; // Response.Write(s); //} sr.Close(); FileInput.Close(); //int i = 0; //foreach (string line in File.ReadAllLines("test.txt")) //{ // string[] parts = line.Split(' '); // foreach (string part in parts) // { // Console.WriteLine("{0}:{1}", // i, // part); // Response.Write("(" + i + ")" + part + "
"); // } // i++; // For demonstration. //}