I have a Windows forms C# application.
I want to add an xml file to this .exe
This xml file must be part of the .exe file.
How can I do that and how can I access the xml file in the program.
What I have tried is this:
Stream st = Assembly.GetExecutingAssembly().GetManifestResourceStream("CApp.xmlfile.xml");
StreamReader reader = new StreamReader(st);
doc = XElement.Load(reader);
Build Action for xml file is "Embedded Resource"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…