public static void lerArquivo(int idUser) { try { //StreamReader file = new StreamReader("C:/Users/dbsbo/Desktop/amendoim2.txt"); //string line = null; jobs = ""; maquinas = ""; DAO dao = new DAO(); List<VelMaqJobsSku> lstRtn = dao.returnVelMaqJobsSku(idUser); //while ((line = file.ReadLine()) != null) //{ // string[] vgene = line.Split(','); // jobs = vgene[0].Substring(0, 3); // maquinas = vgene[0].Substring(3, 1); //} int i = 0; foreach (var item in lstRtn) { Jobs = item.Sku.Descricao; Maquinas = item.Maq.Descricao; item.Indice = i++; } //int tamanho = (Jobs.Length / Maquinas.Length); Algoritimo.lst = lstRtn; int tamanho = Jobs.Length / Maquinas.Length; Algoritimo.jobs = Jobs.Substring(0, tamanho); //file.Close(); } catch (Exception e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } }