花花草草

博客园 首页 新随笔 联系 订阅 管理
System.Reflection.Assembly   thisExe;   
thisExe   
=   System.Reflection.Assembly.GetExecutingAssembly();   
System.IO.Stream   file   
=     
thisExe.GetManifestResourceStream(
"OACONTROL.Notice.Text.XML");   

 

 

Xml.XmlDocument   doc   =new     Xml.XmlDocument;   
doc.Load(
this.GetType().Module.Assembly.GetManifestResourceStream("test.xml"));   
//从资源文件中获取xml.注意:test.xml,应按照命名规则写,如:此资源存放在MyProject.Test命名空间,那么应是:MyProject.Test.text.xml 

 



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1628891

posted on 2007-06-26 11:24  sosoguy  阅读(700)  评论(0)    收藏  举报