using BaseLibRWFile; using System; using System.Windows.Forms; namespace BaseLibRWFile { public class Msg { public static Log newLog = new Log(); public static bool Show(string ChineseContent, string EnglishContent = "Null", string OtherContent = "Null", string caption = "提示", MessageBoxButtons msgbtn = MessageBoxButtons.OK, MessageBoxIcon msgicon = MessageBoxIcon.Warning,bool bHelpBtn = false) { string strContent; switch (GlobalPara.CurrentLanguage) { case Language.English: strContent = EnglishContent; break; case Language.Chinese: strContent = ChineseContent; break; case Language.Other: strContent = OtherContent; break; default: strContent = ChineseContent; break; } if (MessageBox.Show(strContent, caption, msgbtn, msgicon,MessageBoxDefaultButton.Button2,0, bHelpBtn) == DialogResult.OK) { SaveLog("ErrorLog", ChineseContent); return true; } else { SaveLog("ErrorLog", ChineseContent); return false; } } public static void SaveLog(string strFileName, string strChinese) { string strDate; strDate = DateTime.Now.ToString("yyyyMMdd") + ".txt"; string strFilePath = GlobalPara.ProDataFilePath + "\\Logs\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\"; strFileName = strFileName + "_" + strDate; newLog.SaveTxt(strFilePath, strFileName, strChinese); } } }