QQ自动登录里的一些控件知识
在这个程序里面有个读取计算机指定文件的知识:
private void button2_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
textBox1.Text = openFileDialog1.FileName;
}
就是点击这个btn,然后就去搜索计算机的文件,红色字体就是,然后就读取出他的路径名称。
还有就是下面的这3个知识点
private void button1_Click(object sender, EventArgs e)
{
if (listView1.Items.Count == 0)
{
MessageBox.Show("请先添加需要登录的QQ/TM号码", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return; }
for (int j = 0; j < listView1.Items.Count; j++)
{
if (listView1.Items[j].Checked==true)
System.Diagnostics.Process.Start(textBox1.Text,listView1.Items[j].SubItems[2].Text);
}
}
//这个方法,直要输入进去数字,就会触发
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
//e.KeyChar获取的是你按下键的字符
//e.KeyChar的值的形式是:ASII码+'输入的值'
e.Handled = e.KeyChar < '0' || e.KeyChar > '9'; //允许输入数字
if(e.KeyChar==(char)8) //允许输入回退键
{
e.Handled=false;
}
}
人各有命,上天注定,有人天生为王,有人落草为寇。脚下的路,如果不是你自己的选择,那么旅程的终点在哪,也没人知道。你会走到哪,会遇到谁,都不一定。

浙公网安备 33010602011771号