#region 写日志
/// <summary>
/// 写日志
/// </summary>
/// <param name="title"></param>
/// <param name="info"></param>
public static void writeLogo(string title, string info)
{
try
{
#region 如果文件夹不存在则创建,获取附件地址
string UserPath = System.Web.HttpContext.Current.Server.MapPath("log").ToString();
if (!Directory.Exists(UserPath))
{
//创建文件夹
Directory.CreateDirectory(UserPath);
}
#endregion
StreamWriter writer = File.AppendText(System.Web.HttpContext.Current.Server.MapPath("log\\ServerLog1.txt"));
writer.Write(title);
writer.WriteLine((DateTime.Now.ToString()) + " " + info);
writer.Close();
}
catch { }
}
#endregion
/// <summary>
/// 写日志
/// </summary>
/// <param name="title"></param>
/// <param name="info"></param>
public static void writeLogo(string title, string info)
{
try
{
#region 如果文件夹不存在则创建,获取附件地址
string UserPath = System.Web.HttpContext.Current.Server.MapPath("log").ToString();
if (!Directory.Exists(UserPath))
{
//创建文件夹
Directory.CreateDirectory(UserPath);
}
#endregion
StreamWriter writer = File.AppendText(System.Web.HttpContext.Current.Server.MapPath("log\\ServerLog1.txt"));
writer.Write(title);
writer.WriteLine((DateTime.Now.ToString()) + " " + info);
writer.Close();
}
catch { }
}
#endregion