Ejemplo n.º 1
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            // 检查UUID是否一致
            String            localUUID = Utility.getUUID();
            SqlDataAdapter    da        = new SqlDataAdapter("select * from users where 用户ID='" + mySystem.Parameter.userID + "'", Parameter.connUser);
            SqlCommandBuilder cb        = new SqlCommandBuilder(da);
            DataTable         dt        = new DataTable("user");

            da.Fill(dt);
            if (dt.Rows.Count >= 1)
            {
                String remoteUUID = dt.Rows[0]["token"].ToString();
                if (remoteUUID == "")
                {
                    dt.Rows[0]["token"] = localUUID;
                }
                else if (localUUID != remoteUUID)
                {
                    timer2.Stop();
                    MessageBox.Show("该账号已在别处登陆,您已下线", "下线提醒", MessageBoxButtons.OK);
                    ExitBtn.PerformClick();
                }
            }
        }
Ejemplo n.º 2
0
 private void AcntList_FormClosed(object sender, FormClosedEventArgs e)
 {
     ExitBtn.PerformClick();
 }
Ejemplo n.º 3
0
 private void exitToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ExitBtn.PerformClick();
 }