c# xml 的AppendChild问题 - .NET技术 / C#
C# code:
//代码如下:正常运行,就是添加到xml里后,显示没有 "</PlugInFile>"
try
{
string path = Application.StartupPath + (@"\PlugIn.xml");
XmlDocument doc = new XmlDocument();
doc.Load(path);
XmlNode node = doc.SelectSingleNode("PlugIn/PlugInConfig");
if (node == null)
return;
XmlElement ent = doc.CreateElement("PlugInFile");
ent.SetAttribute("text", 123);
ent.SetAttribute("ImpementInterface", 123);
ent.SetAttribute("ClassName", 123);
// XmlElement notexml = doc.CreateElement("Note");
// notexml.InnerText = this.txtnote.Text;
// node.AppendChild(notexml);
node.AppendChild(ent);
doc.Save(path);
MessageBox.Show("YES");
}
catch (Exception ex)
{ MessageBox.Show(ex.Message); }
xml数据:
XML code:
<?xml version="1.0" encoding="utf-8"?>
<PlugIn>
<Plug
相关问答:
txt 和XML 格式相应
不借助DataSet
导入读取TXT文件
然后直接写入XML(同一文件,不同数据,递增原数据没有被覆盖情况下增加数据.)
教个要点或最好是有个代码提示的
过路好汉 帮个忙撒^^
不会,帮楼主 ......
有一10*10矩阵,除去第一个点(0,0)和最后一点(9,9),还有八个点为1,其他都为0,要求用二维数组表示。八个点是随机生成的,编写相关程序表示矩阵所有可能情况。
真心求教各位高手,哎!本人太菜了!呵呵!
......
在根目录/lib中存放一个log.c,log.h,并用下面的语句:
gcc -c log.c
ar crv liblog.a log.o
编译出一个liblog.a静态库,然后在文件夹:/testfile中创建一个test.c和testc.c,test.c中引用了testc.c中定义的方法 ......
挺繁琐,之前发的帖子,分值太低现在重发一个。欢迎各位大侠~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[] ......