public UcSysManage() { InitializeComponent(); if (File.Exists(cmcfgfile)) { cfgfile = new LTP.Utility.INIFile(cmcfgfile); string val = cfgfile.IniReadValue("dbo", "dbosp"); if (val.Trim() == "1") { radbtnDBO_SP.Checked = true; } else { radbtnDBO_SQL.Checked = true; } string val2 = cfgfile.IniReadValue("loginfo", "save"); if (val2.Trim() == "1") { chkLoginfo.Checked = true; } else { chkLoginfo.Checked = false; } } }
/// <summary> /// 得到字段类型字符串 /// </summary> /// <param name="typeNum"></param> /// <returns></returns> private string GetColumnType(string typeNum) { string type = typeNum; if (File.Exists(datatypefile)) { dtfile = new LTP.Utility.INIFile(datatypefile); type = dtfile.IniReadValue("AccessDbTypeMap", typeNum); } //switch (typeNum) //{ // case "3": // type = "int"; // break; // case "5": // type = "float"; // break; // case "6": // type = "money"; // break; // case "7": // type = "datetime"; // break; // case "11": // type = "bool"; // break; // case "130": // type = "varchar"; // break; //} return(type); }
private void NewProject_Load(object sender, EventArgs e) { if (File.Exists(cmcfgfile)) { cfgfile = new LTP.Utility.INIFile(cmcfgfile); string lastpath = cfgfile.IniReadValue("Project", "lastpath"); if (lastpath.Trim() != "") { txtProPath.Text = lastpath; } } }
/// <summary> /// 是否采用sp的方式获取数据结构信息 /// </summary> /// <returns></returns> private bool IsDboSp() { if (File.Exists(cmcfgfile)) { cfgfile = new LTP.Utility.INIFile(cmcfgfile); string val = cfgfile.IniReadValue("dbo", "dbosp"); if (val.Trim() == "1") { isdbosp = true; } } return(isdbosp); }
/// <summary> /// 写日志 /// </summary> /// <param name="loginfo"></param> public static void WriteLog(string loginfo) { if (File.Exists(cmcfgfile)) { LTP.Utility.INIFile cfgfile = new LTP.Utility.INIFile(cmcfgfile); string val = cfgfile.IniReadValue("loginfo", "save"); if (val.Trim() == "1") { StreamWriter sw = new StreamWriter(logfilename, true); sw.WriteLine(DateTime.Now.ToString() + ":" + loginfo); sw.Close(); } } }
/// <summary> /// 写日志 /// </summary> /// <param name="loginfo"></param> public static void WriteLog(System.Exception ex) { if (File.Exists(cmcfgfile)) { LTP.Utility.INIFile cfgfile = new LTP.Utility.INIFile(cmcfgfile); string val = cfgfile.IniReadValue("loginfo", "save"); if (val.Trim() == "1") { StreamWriter sw = new StreamWriter(logfilename, true); sw.WriteLine(DateTime.Now.ToString() + ":"); sw.WriteLine("错误信息:" + ex.Message); sw.WriteLine("Stack Trace:" + ex.StackTrace); sw.WriteLine(""); sw.Close(); } } }
/// <summary> /// 是否已经下载过RSS数据 /// </summary> /// <returns></returns> private bool IsHasLoaded() { if (File.Exists(cmcfgfile)) { cfgfile = new LTP.Utility.INIFile(cmcfgfile); string Contents = cfgfile.IniReadValue("updaterss", "today"); if (Contents == DateTime.Today.ToString("yyyyMMdd")) { return(true); } else { return(false); } } else { return(false); } }