string vsPath = @"C:\InterFace\";
if (!System.IO.Directory.Exists(vsPath))
System.IO.Directory.CreateDirectory(vsPath);
try
{
DateTime currentTime = System.DateTime.Now;
vsPath = vsPath + "GS_InterFace_CodeOutPutLog" + currentTime.ToString("yyyyMMdd") + ".txt";
System.IO.StreamWriter sw = new System.IO.StreamWriter(vsPath, true, System.Text.Encoding.Default);
sw.WriteLine("记录时间:{0}", DateTime.Now.ToString());
sw.WriteLine("信息文本:{0}", logMessage);
sw.WriteLine("---------------------------------------------------------------------------------------------");
sw.Flush();
sw.Close();
}
catch (Exception ex)
{
}
if (!System.IO.Directory.Exists(vsPath))
System.IO.Directory.CreateDirectory(vsPath);
try
{
DateTime currentTime = System.DateTime.Now;
vsPath = vsPath + "GS_InterFace_CodeOutPutLog" + currentTime.ToString("yyyyMMdd") + ".txt";
System.IO.StreamWriter sw = new System.IO.StreamWriter(vsPath, true, System.Text.Encoding.Default);
sw.WriteLine("记录时间:{0}", DateTime.Now.ToString());
sw.WriteLine("信息文本:{0}", logMessage);
sw.WriteLine("---------------------------------------------------------------------------------------------");
sw.Flush();
sw.Close();
}
catch (Exception ex)
{
}