domingo, 29 de enero de 2012

Read txt file with c#


 public ArrayList ReadtxtFile(string txtPath)
        {
            StreamReader objReader = new StreamReader(txtPath);
            string sLine = "";
            ArrayList arrText = new ArrayList();

            while (sLine != null)
            {
                sLine = objReader.ReadLine();
                if (sLine != null)
                {
                    if (sLine != "")
                        arrText.Add(sLine);
                }
            }
            objReader.Close();
            return arrText;

        }

No hay comentarios: