五丰称屠宰重客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

29 lines
674 B

using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace B3ButcherWeightClient
{
public class LogUtil {
static string LogPath {
get {
return Application.StartupPath + "\\" + DateTime.Today.ToString("yyyyMMdd") + "ErrorLog.txt";
}
}
public static void WriteLog(string msg) {
try {
using (var writer = new StreamWriter(LogPath, true, Encoding.UTF8)) {
writer.WriteLine(msg);
writer.WriteLine();
writer.Close();
writer.Dispose();
}
} catch (Exception ex) {
MessageBox.Show(ex.Message);
}
}
}
}