⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guanji.pas

📁 这是一个非常好的教师和学生沟通用的电子教室!
💻 PAS
字号:
unit Guanji;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls, Buttons, Mask, XPMenu, TFlatPanelUnit,
  TFlatSpeedButtonUnit, XP_Button;

type
  TGuanjif = class(TForm)
    FlatPanel1: TFlatPanel;
    FlatPanel2: TFlatPanel;
    Bevel1: TBevel;
    Label1: TLabel;
    CheckBox1: TCheckBox;
    Edit1: TMaskEdit;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    XPMenu1: TXPMenu;
    FlatSpeedButton1: TFlatSpeedButton;
    XP_Button1: TXP_Button;
    XP_Button2: TXP_Button;
    XP_Button3: TXP_Button;
    procedure FormActivate(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Guanjif: TGuanjif;

implementation
uses main;
{$R *.DFM}

procedure TGuanjif.FormActivate(Sender: TObject);
begin
  Edit1.Enabled := false;
end;

procedure TGuanjif.CheckBox1Click(Sender: TObject);
begin
  Edit1.Enabled := not Edit1.Enabled;
end;

procedure TGuanjif.BitBtn1Click(Sender: TObject);
var
  i: smallint;
begin
  if CheckBox1.Checked = false then
  begin
    for i := 0 to student_count - 1 do
    begin
         //s_index := s_student[i];
      if (form1.ListView1.Items[i].imageindex <> 0) and (form1.listView1.Items[i].Selected = true) then
      begin
        form1.ListView1.Items[i].ImageIndex:=0;
        wsh_socket[i].SendStr('/*csh*/:' + #13 + #10 + '关闭系统');
        sleep(1);
      end;
      wsh_socket[i].Close;
    end;
  end
  else
  begin
    for i := 0 to student_count - 1 do
    begin
         //s_index := s_student[i];
      if (form1.ListView1.Items[i].imageindex = 1) and (form1.listView1.Items[i].Selected = true) then
      begin
        wsh_socket[i].SendStr('/*csh*/:' + #13 + #10 + '定时关机' + Edit1.Text);
        sleep(1);
        form1.ListView1.Items[i].imageindex := 6;
      end;
    end;
  end;

end;

procedure TGuanjif.BitBtn3Click(Sender: TObject);
var
  i: smallint;
begin
  for i := 0 to student_count - 1 do
  begin
         //s_index := s_student[i];
    if (form1.ListView1.Items[i].imageindex = 6) and (form1.listView1.Items[i].Selected = true) then
    begin
      wsh_socket[i].SendStr('/*csh*/:' + #13 + #10 + '解除定时');
      form1.ListView1.Items[i].imageindex := 1;
    end;
  end;
  close;
end;

end.

⌨️ 快捷键说明

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