任何人都可以建议什么是调用进程的更好方法,而无需在 c# menustrip 中的每个菜单项中进行编码
private void SetupUserToolStripMenuItem_Click(object sender, EventArgs e)
{
UserMenu += "Setup User";
UserRights=ValidateUser(UserMenu);
if (UserRights == 1)
{
frmDataReader frmDR = new frmDataReader();
frmDR.Show();
}
else
{
MessageBox.Show("No Permission");
}
private void SetupMasterToolStripMenuItem_Click(object sender, EventArgs e)
{
//MessageBox.Show(menuStrip1. ToolStripMenuItem);
UserMenu += "Setup Master";
UserRights=ValidateUser(UserMenu);
if (UserRights == 1)
{
frmDataReader frmDR = new frmDataReader();
frmDR.Show();
}
else
{
MessageBox.Show("No Permission");
}