/// <summary>/// 寫日志,方便測試(看網站需求,也可以改成把記錄存入數據庫)/// </summary>/// <param name="sWord">要寫入日志里的文本內容</param>public static void LogResult(string sWord){string strPath = HttpContext.Current.Server.MapPath("log");strPath = strPath + "\\" + DateTime.Now.ToString().Replace(":", "") + ".txt";StreamWriter fs = new StreamWriter(strPath, false, System.Text.Encoding.Default);fs.Write(sWord);fs.Close();}
?
其中:Log文件夾要存在服務器的根目錄下。