private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked)
{
textBox2.PasswordChar = '\0';
}
else { textBox2.PasswordChar = '*'; }
}
private void listBox1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
if (listBox1.SelectedItems.Count != 0)
{
删除ToolStripMenuItem.Enabled = true;
}
else
{
删除ToolStripMenuItem.Enabled = false;
}
this.contextMenuStrip1.Show(listBox1, e.Location);
}
}
private void 删除ToolStripMenuItem_Click(object sender, EventArgs e)
{
listBox1.Items.Remove(listBox1.SelectedItem);
string str = JsonConvert.SerializeObject(listBox1.Items, Formatting.Indented);
File.WriteAllText("登陆日志.txt", str);
listBox1.ClearSelected();
}