110,535
社区成员
发帖
与我相关
我的任务
分享
public class WriteHelper
{
static public string htmls { set; get; }
static public void GoLog()
{
if (!Directory.Exists(myurl+"Console.log"))
Directory.CreateDirectory(myurl + "Console.log");
TextWriter tw = new StreamWriter(Path.Combine(myurl,"Console.log"), true); //myurl 为软件运行目录
tw.Write(htmls);
tw.Close();
}
}
public class WriteHelper
{
static public string htmls { set; get; }
static public void GoLog()
{
object locker = new object();
lock(locker)
{
if (!Directory.Exists(myurl + "Console.log"))
Directory.CreateDirectory(myurl + "Console.log");
TextWriter tw = new StreamWriter(Path.Combine(myurl, "Console.log"), true); //myurl 为软件运行目录
tw.Write(htmls);
tw.Close();
}
}
}