locksystem.pas

来自「网络教室delphi源码」· PAS 代码 · 共 125 行

PAS
125
字号
unit LockSystem;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,Buttons;

type
  TLockSystemF = class(TForm)
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton4: TRadioButton;
    RadioButton5: TRadioButton;
    RadioButton6: TRadioButton;
    RadioButton7: TRadioButton;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  LockSystemF: TLockSystemF;
  s_selcount: smallint;
implementation
   uses main;
{$R *.DFM}

procedure TLockSystemF.BitBtn1Click(Sender: TObject);
  var
   i:smallint;
begin
 if  RadioButton1.Checked=true then  //锁定师生电脑
  begin

  end;

  if  RadioButton2.Checked=true then  //锁定教师电脑
  begin

  end;

  if  RadioButton3.Checked=true then  //锁定学生电脑
  begin
  for i:=0 to s_selcount-1 do
    begin
    if form1.ListView1.Items[s_student[i]].imageindex=1 then
     begin
   form1.ListView1.Items[s_student[i]].imageindex:=2;
   wsh_socket[s_student[i]].SendStr('/*wsh*/:' + #13 + #10 + '锁定学生');
     end;
    end;
   close;
  end;

  if  RadioButton4.Checked=true then  //解锁学生电脑
  begin
    for i:=0 to s_selcount-1 do
    begin
    if form1.ListView1.Items[s_student[i]].imageindex=2 then
       begin
   form1.ListView1.Items[s_student[i]].imageindex:=1;
   wsh_socket[s_student[i]].SendStr('/*wsh*/:' + #13 + #10 + '解锁学生');
       end;
    end;
   close;
  end;

  if  RadioButton5.Checked=true then  //强制学生退出网络教室
  begin
    for i:=0 to s_selcount-1 do
    begin
    if form1.ListView1.Items[s_student[i]].imageindex=1 then
     begin
   form1.ListView1.Items[s_student[i]].imageindex:=0;
   wsh_socket[s_student[i]].SendStr('/*wsh*/:' + #13 + #10 + '退出教室');
   wsh_socket[s_student[i]].close;
     end;
    end;
   close;
  end;

  if  RadioButton6.Checked=true then  //远程重新启动学生电脑
  begin
   for i:=0 to s_selcount-1 do
    begin
    if form1.ListView1.Items[s_student[i]].imageindex=1 then
     begin
   form1.ListView1.Items[s_student[i]].imageindex:=0;
   wsh_socket[s_student[i]].SendStr('/*wsh*/:' + #13 + #10 + '重新启动');
   wsh_socket[s_student[i]].close;
     end;
    end;
   close;

  end;

  if  RadioButton7.Checked=true then  //远程关闭学生电脑
  begin
     for i:=0 to s_selcount-1 do
    begin
    if form1.ListView1.Items[s_student[i]].imageindex=1 then
     begin
   form1.ListView1.Items[s_student[i]].imageindex:=0;
   wsh_socket[s_student[i]].SendStr('/*wsh*/:' + #13 + #10 + '关闭系统');
   wsh_socket[s_student[i]].close;
     end;
    end;
   close;
  end;
end;

procedure TLockSystemF.FormShow(Sender: TObject);
begin
  RadioButton1.Checked:=true;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?