}
}
}
MenuItem menuItemTc = new MenuItem("退出");
mainMenu1.MenuItems.Add(x1, menuItemTc);
menuItemTc.Click += new EventHandler(this.menuItem1_Click);
Menu = mainMenu1;
string strtext = " 当前版本号:" + Application.ProductVersion.ToString();
this.Text = "用户登录授权动态菜单系统 登录人员:" + lc_yhxms + strtext;
}
自定义菜单事件的代码:
private void menuItem1_Click(object sender, System.EventArgs e)
{
MenuItem menucdml = (MenuItem)sender;
XElement xmlFile = XElement.Load(@"ftp://100.100.0.1/yhcd1/XMLCdsj.xml");
string lc_cdml = string.Empty;
foreach (var p in xmlFile.Elements("cdbm"))
{
if (menucdml.Text == (string)p.Attribute("cdmc"))
{
lc_cdml = (string)p.Attribute("zxml");
break;
}
}
if (menucdml.Text != "退出")
{
try
|