用C#读写XML实例?怎么写? c#XML 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 转化成公式?加入dataset控件, 名字修改为dsXML string c1 = null; string c2 = null; dsXML.ReadXml(System.Windows.Forms.Application.StartupPath + @"\\test1.xml"); c1 = dsXML.Tables["CondItem"].Rows[0]["vLeft"].ToString(); c2 = dsXML.Tables["CondItem"].Rows[0]["vRight"].ToString(); 补充: str = c1+"=="+c2; MessageBox.Show(str); str就是:hr_hi_edu.reducation =='04' 包括写:string c1 = null; string c2 = null; string str; string s = "<?xml version=\"1.0\" encoding=\"gb2312\" ?> <Condition> <CondItem iItem=\"1\" vLeft=\"hr_hi_edu.reducation\" vMidOper=\"EQ\" vRight=\"'04'\" vBracketLeft=\"\" vBracketRight=\"\" vRelation=\"\" /> </Condition>"; FileStream fs = new FileStream(System.Windows.Forms.Application.StartupPath + "\\test2.xml", FileMode.Create); StreamWriter sw = new StreamWriter(fs); sw.Write(s); sw.Flush(); sw.Close(); fs.Close(); dsXML.ReadXml(System.Windows.Forms.Application.StartupPath + @"\\test2.xml"); c1 = dsXML.Tables["CondItem"].Rows[0]["vLeft"].ToString(); c2 = dsXML.Tables["CondItem"].Rows[0]["vRight"].ToString(); str = c1+"=="+c2; MessageBox.Show(str); 【求教】WPF 按钮响应函数处理时间长,多次点击如何取消后续事件? 为什么WCF远程传输DataSet序列化后速度变慢? 讨论 - RichTextBox 和 WebBrowser 哪个效率更高 ? smtp密码的编码方式是不是改了? 看c#高级编程第3版的一点疑问 关于DATAVIEW的问题 有两个既简单又不简单的问题 怎样让WebForm居中显示 在C#中用SerialPort类通信的问题 一个小问题 请问怎么得知软件读取了本地什么信息? 关于VS2010问题,急。。
加入dataset控件, 名字修改为dsXML
string c1 = null;
string c2 = null;
dsXML.ReadXml(System.Windows.Forms.Application.StartupPath + @"\\test1.xml");
c1 = dsXML.Tables["CondItem"].Rows[0]["vLeft"].ToString();
c2 = dsXML.Tables["CondItem"].Rows[0]["vRight"].ToString();
MessageBox.Show(str);
str就是:hr_hi_edu.reducation =='04'
string c2 = null;
string str;
string s = "<?xml version=\"1.0\" encoding=\"gb2312\" ?> <Condition> <CondItem iItem=\"1\" vLeft=\"hr_hi_edu.reducation\" vMidOper=\"EQ\" vRight=\"'04'\" vBracketLeft=\"\" vBracketRight=\"\" vRelation=\"\" /> </Condition>";
FileStream fs = new FileStream(System.Windows.Forms.Application.StartupPath + "\\test2.xml", FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
sw.Write(s);
sw.Flush();
sw.Close();
fs.Close();
dsXML.ReadXml(System.Windows.Forms.Application.StartupPath + @"\\test2.xml");
c1 = dsXML.Tables["CondItem"].Rows[0]["vLeft"].ToString();
c2 = dsXML.Tables["CondItem"].Rows[0]["vRight"].ToString();
str = c1+"=="+c2;
MessageBox.Show(str);