加载程序集中内嵌资源

Assembly asm = Assembly.Load(xmlSpaceName);
Stream sm = asm.GetManifestResourceStream(xmlSpaceName+"."+className);
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.Load(sm);
System.Xml.XmlNode xmlNode1 = xmlDoc.SelectSingleNode(point);
result = xmlNode1.InnerText;

xmlSpaceName 为程序集名称

className 为xml文件名称

欢迎指正:haizi2014@qq.com
原文地址:https://www.cnblogs.com/hcfan/p/4551666.html