[英]embed xml in custom controls
i create a custom Control and using the XML file now i need to have just one dll file to use that to another project can you help me to embed xml file to my custom control project? 我创建一个自定义控件并使用XML文件,现在我只需要一个dll文件即可将其用于另一个项目,您能帮我将xml文件嵌入到我的自定义控件项目中吗?
my programming language is c#.net 我的编程语言是c#.net
If you are using Visual Studio (My version is 2008, if you have 2010, this might be slightly different.) 如果您使用的是Visual Studio(我的版本是2008,如果是2010,则可能略有不同。)
XmlFile
with no dots, this is your handle to the file. XmlFile
的名称,不XmlFile
,这是您处理文件的方式。 Then somewhere in your project you will use this line, or something like it to access your file. 然后,在项目中的某处,您将使用此行或类似的行来访问文件。
XElement root = XElement.Parse(Properties.Resources.XmlFile);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.