static void Main(string[] args) { string folder = ConfigurationManager.AppSettings["Ext:XmlCommandFolder"]; XmlCommandManager.InitXML(folder); string StrSQL = XmlCommandManager.GetCommand("DeskTop:GetConfig").CommandText; string strSQL1 = XmlCommandManager.GetCommand("GetUser:Query").CommandText; Console.WriteLine(StrSQL); Console.WriteLine(strSQL1); Console.ReadKey(); }
/// <summary> /// 初始化XML文件 /// </summary> /// <param name="Folder"></param> public static void InitXML(string Folder) { if (false == string.IsNullOrEmpty(Folder)) { string[] folders = Folder.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < folders.Length; i++) { folders[i] = System.IO.Path.Combine(RuntimeFolder, folders[i]); } XmlCommandManager.LoadCommnads(folders); } }