日期:2014-05-17 浏览次数:20466 次
string path = "c:\\mm.xml"; Assembly assembly = Assembly.LoadFile("c:\\JRJ.XTrend.Theme.dll"); XElement root = new XElement("Types", assembly.GetTypes().Select(x => new XElement("TypeName",x.Name))); root.Save(path);
------解决方案--------------------
举例
string path = "c:\\mm.xml"; Assembly assembly = Assembly.LoadFile("c:\\JRJ.XTrend.Theme.dll"); XElement root = new XElement("Types", assembly.GetTypes().Select(x => new XElement("Type", new XAttribute("Name",x.Name), new XElement("Methods",x.GetMethods().Select(m=>new XElement("Method",new XAttribute("Name",m.Name))))))); root.Save(path);