using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.IO;
|
|
namespace APPCMPP2.AsiaINFO.SMS.APPCMPP2
|
{
|
/// <summary>
|
/// 没有派上用场。
|
/// </summary>
|
public class TempLog
|
{
|
//写日志
|
public void WriteLog(string str)
|
{
|
string sFilePath = @".\Syslog";
|
string sFileName = "sms.log";
|
sFileName = sFilePath + "\\" + sFileName;
|
if (!Directory.Exists(sFilePath))
|
{
|
Directory.CreateDirectory(sFilePath);
|
}
|
FileStream fs;
|
StreamWriter sw;
|
if (File.Exists(sFileName))
|
{
|
fs = new FileStream(sFileName, FileMode.Append, FileAccess.Write);
|
}
|
else
|
{
|
fs = new FileStream(sFileName, FileMode.Create, FileAccess.Write);
|
}
|
sw = new StreamWriter(fs);
|
sw.WriteLine(DateTime.Now.ToString() + " ----- " + str);
|
sw.Close();
|
fs.Close();
|
}
|
}
|
}
|