string lc_cdmc = textBox1.Text;
string lc_zxml = textBox2.Text;
if (xdnode.GetNodeCount(true) != 0) //说明所选节点有下级菜单项
{
lc_zxml = "0"; //所选节点有下级菜单项lc_zxml(执行命令)无意义用"0"表示
textBox2.Text = "0";
}
xdnode.Text = lc_cdmc;
XElement xmlFile = XElement.Load(@"ftp://100.100.0.1/yhcd1/XMLCdsj.xml");
try
{
foreach (var cl in xmlFile.Elements("cdbm"))
{
if (cl.Value.ToString() == xdnode.Tag.ToString())
{
cl.SetAttributeValue("cdmc", lc_cdmc); //修改元素属性
cl.SetAttributeValue("zxml", lc_zxml);
}
}
xmlFile.Save(@"C:\XMLCdsj.xml");
string lc_xml = @"C:\XMLCdsj.xml";
Network network = new Network();
network.UploadFile(lc_xml,@"ftp://100.100.0.1/yhcd1/XMLCdsj.xml", "administrator", "1234567", false, 500);
MessageBox.Show("菜单项修改成功 !", "系统提示", MessageBoxButtons.OK,
MessageBoxIcon.Asterisk);
}
catch (Exception el)
{
|