調用的相關例程
private void buttonSetAllowProgram_Click(object sender, EventArgs e)
{
try
{
AllowedProgram allowedProgram = new AllowedProgram();
allowedProgram.Program = textBoxProgramFilePath.Text.Trim();
if (checkBoxEnable.Checked)
{
allowedProgram.Mode = TMode.ENABLE;
}
else
{
allowedProgram.Mode = TMode.DISABLE;
}
allowedProgram.Scope = (TScope)comboBoxScope.SelectedItem;
allowedProgram.Address = textBoxAddress.Text.Trim();
allowedProgram.Set();
MessageBox.Show("OK", "Information", MessageBoxButtons.OK);
}
catch (Exception e1)
{
MessageBox.Show(e1.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void buttonDelAllowProgram_Click(object sender, EventArgs e)
{
try
{
AllowedProgram allowedProgram = new AllowedProgram();
allowedProgram.Program = textBoxProgramFilePath.Text.Trim();
allowedProgram.Delete();
MessageBox.Show("OK", "Information", MessageBoxButtons.OK);
}
catch (Exception e1)
{
MessageBox.Show(e1.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}