/// <summary> /// 配置値取得 /// </summary> private bool GetProductValue() { bool ret = true; NdnXmlConfig xmlConfig; xmlConfig = new NdnXmlConfig(NCConst.CONFIG_FILE_DIR + NCUtility.GetAppConfig()); if (!xmlConfig.ReadXmlData("config", "Product", ref product)) { ret = false; } return(ret); }
/// <summary> /// 配置値取得 /// </summary> private bool GetConfigValue() { bool ret = true; NdnXmlConfig xmlConfig; string appName = Path.GetFileNameWithoutExtension(System.Windows.Forms.Application.ExecutablePath); xmlConfig = new NdnXmlConfig(string.Format(NCConst.CONFIG_FILE_DIR, appName) + NCUtility.GetAppConfig()); if (!xmlConfig.ReadXmlData("config", "home2", ref home2)) { ret = false; } return(ret); }
/// <summary> /// 取得数据库连接 /// </summary> /// <returns></returns> protected bool GetConnectionString() { NdnXmlConfig xmlConfig; xmlConfig = new NdnXmlConfig(NCConst.CONFIG_FILE_DIR + NCUtility.GetAppConfig()); string strConnectionString = null; string str = "ConnectionString"; if (xmlConfig.ReadXmlData("database", str, ref strConnectionString)) { string[] temp = strConnectionString.Split(';'); if (temp.Length > 0) { for (int idx = 0; idx < temp.Length; idx++) { if (temp[idx].IndexOf("Password="******"Password="******""); strPassword = NCCryp.Decrypto(temp[idx]); } else if (temp[idx].IndexOf("Data Source=") > -1) { temp[idx] = temp[idx].Replace("Data Source=", ""); strDataSource = temp[idx]; } else if (temp[idx].IndexOf("Initial Catalog=") > -1) { temp[idx] = temp[idx].Replace("Initial Catalog=", ""); strDbName = temp[idx]; } else if (temp[idx].IndexOf("User ID=") > -1) { temp[idx] = temp[idx].Replace("User ID=", ""); strUserName = temp[idx]; } } return(true); } } return(false); }
/// <summary> /// 初期化 /// </summary> public CmWinServiceAPI() { try { string constr = null; NdnXmlConfig xmlConfig; string path = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "Config"); string dbpath = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "DB"); xmlConfig = new NdnXmlConfig(Path.Combine(path, "HPSTest.Config")); if (!xmlConfig.ReadXmlData("database", "ConnectionString", ref constr)) { string msg = string.Format(NCMessage.GetInstance("").GetMessageById("CM0440E", ""), "サンプル間隙(秒)"); NCLogger.GetInstance().WriteErrorLog(msg); } Connection = new OleDbConnection(string.Format(constr, dbpath)); Connection.Open(); } catch (Exception e) { NCLogger.GetInstance().WriteExceptionLog(e); } }
/// <summary> /// 配置値取得 /// </summary> private bool GetConfigValue() { bool ret = true; NdnXmlConfig xmlConfig; string path = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "Config"); xmlConfig = new NdnXmlConfig(Path.Combine(path, "HPSTest.Config")); if (!xmlConfig.ReadXmlData("config", "Skin", ref Skin)) { ret = false; } if (!xmlConfig.ReadXmlData("config", "company", ref company)) { ret = false; } if (!xmlConfig.ReadXmlData("config", "home", ref home)) { ret = false; } if (!xmlConfig.ReadXmlData("config", "home2", ref home2)) { ret = false; } if (!xmlConfig.ReadXmlData("config", "ServerUrl", ref ServerUrl)) { ret = false; } if (!xmlConfig.ReadXmlData("config", "UserName", ref UserName)) { ret = false; } if (!xmlConfig.ReadXmlData("config", "Password", ref Password)) { ret = false; } return(ret); }