Ejemplo n.º 1
0
        private void RemoteClose_Click(object sender, EventArgs e)
        {
            string       username  = UserName.Text;
            string       password  = PassWords.Text;
            string       ipaddress = IPAddress0.Text + '.' + IPAddress1.Text + '.' + IPAddress2.Text + '.' + IPAddress3.Text;
            DialogResult r;

            r = MessageBox.Show("确认关机", "远程关机", MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
            if (r == DialogResult.Cancel)
            {
                return;
            }
            if (PCAS.disconnect(ipaddress, username, password) == true)
            {
                welcome.Visible = true;// Set the welcome page as invisible
                timer1.Enabled  = false;
                picture.Close();
            }
            else
            {
                MessageBox.Show("关机失败");
            }
        }