| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using System;
- namespace CommonTool
- {
- public class GetConnStr
- {
- public GetConnStr()
- {
- //string connStr = AppEnv.ReadConnectionConfig();
- //SnXmlNode conXmlNode = SnXmlNode.ParseGenericXml(connStr);
- //ConnStr = conXmlNode.GetChildValue("ConnectionStr");
- ConnStr = new GetRsdbNodeValue("ConnectionStr").ValueStr;
- }
- public string ConnStr { get; }
- }
- public class AppEnv
- {
- public static string ReadConnectionConfig()
- {
- return FileFuns.ReadEncryptedFile("RSDB.cfg", "qwertyuiopasdfgh");
- }
- public static string ConfigFile
- {
- get
- {
- //string text1 = LocalPath + "Config.rsc";
- string text1 = "Config.rsc";
- string text2 = FileFuns.GetFullPathFileName(text1);
- if (text2 != "")
- {
- text1 = text2;
- }
- else
- text1 = LocalPath + "Config.rsc";
- return text1;
- }
- }
- public static string LocalPath => AppDomain.CurrentDomain.BaseDirectory;
-
- }
- /// <summary>
- /// 获取配置文件RSDB中相应节点的str
- /// </summary>
- public class GetRsdbNodeValue
- {
- /// <summary>
- /// 节点
- /// </summary>
- public string XmlNodeStr { get; set; }
- /// <summary>
- /// 节点值
- /// </summary>
- public string ValueStr { get; }
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="xmlNodeStr">需要获取的节点</param>
- public GetRsdbNodeValue(string xmlNodeStr)
- {
- XmlNodeStr = xmlNodeStr;
- ValueStr =
- SnXmlNode.ParseGenericXml(FileFuns.ReadEncryptedFile("RSDB.cfg", "qwertyuiopasdfgh")).GetChildValue(XmlNodeStr);
- }
- }
- }
|