/// <summary> /// 讀取多語言的資源文件 /// </summary> /// <param name="frmName">窗體的Name</param> /// <param name="lang">要顯示的語言(如ZH或EN)</param> /// <returns></returns> public static Hashtable ReadResource(string frmName,string lang){ Hashtable result = new Hashtable();
XMLReader reader = null; FileInfo fi = new FileInfo("resources/AppResource_" + lang + ".XML"); if (!fi.Exists) reader = new XmlTextReader("resources/AppResource.XML"); else reader = new XmlTextReader("resources/AppResource_" + lang + ".XML");
XmlDocument doc = new XMLDocument(); doc.Load(reader);