本文原址:http://zhengguomail.blog.163.com/blog/static/23910181200910443933884/
FileInfo version = new FileInfo(LogPath + "yb.txt");
FileStream Version_data = version.Open(FileMode.Open);
StreamReader Context = new StreamReader(Version_data, System.Text.Encoding.Default);
String contents = Context.ReadLine();
String contents2 = "";
StreamWriter log = new StreamWriter(LogPath + "jk.txt", true);
while (contents!=null && contents!="")
{
contents2 = contents2 + ";" + contents.Substring(contents.IndexOf("= /"") + 3, contents.IndexOf("/";") - contents.IndexOf("= /"") - 3);
contents = Context.ReadLine();
}
log.WriteLine(contents2);
log.Close();
StreamWriter log2 = new StreamWriter(LogPath + TimeUtil.getDate() + "SMTATTIMEError2.txt", true);
log2.WriteLine("time:" + System.DateTime.Now.ToLongTimeString());
log2.Close();