Tuesday, August 2, 2011

Sophisticated code for Read a file and find string in C#

string[] tiffiles = Directory.GetFiles(splittedTifFilePath.ToString(), "*.tif", System.IO.SearchOption.TopDirectoryOnly);

StreamReader streamReader = new StreamReader(files[count]);

string text = streamReader.ReadToEnd();

streamReader.Close();

mrun.Add(text.Substring(text.IndexOf("MRUN:"), 20).Split(':').Last().Replace(" ",""));

No comments:

Post a Comment