StreamReader dFile = null; dFile = new StreamReader("Broj2.txt"); char[] SPACE = new char[] {' ' }; string a = dFile.ReadLine(); string[] data = a.Split(SPACE); int[] niz = new int[3]; niz[0] = Convert.ToInt32(data[0]); niz[1] = Convert.ToInt32(data[1]); niz[2] = Convert.ToInt32(data[2]); while ( ) { a = dFile.ReadLine(); data = a.Split(SPACE); }
// Read each line of the file into a string array. Each element // of the array is one line of the file. string[] lines = System.IO.File.ReadAllLines("Broj2.txt"); int[] niz = new int[3]; foreach (string line in lines) { string[] data = line.Split(' '); niz[0] = Convert.ToInt32(data[0]); niz[1] = Convert.ToInt32(data[1]); niz[2] = Convert.ToInt32(data[2]); }
while(dFile.ReadLine()) { a = dFile.ReadLine(); data = a.Split(SPACE); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)