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

📄 dkgl.pas

📁 本系统是基于企业局域网平台针对企业安防
💻 PAS
字号:
unit dkgl;

interface

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

type
  TForm22 = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    ComboBox1: TComboBox;
    BitBtn1: TBitBtn;
    Image1: TImage;
    procedure BitBtn1Click(Sender: TObject);
   private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form22: TForm22;
implementation
  uses DataModal,Main;
{$R *.dfm}

procedure TForm22.BitBtn1Click(Sender: TObject);
begin
  if Trim(ComboBox1.Text)<>'' then
  begin
    with Data.ADOQuery1 do
    begin
      Close;
      SQL.Clear;
      SQL.Add('select * from 端口表');
      Open;
    end;
    Try
      Form1.MSComm1.PortOpen := False;
      Form1.MSComm1.CommPort := ComboBox1.ItemIndex+1;
      Form1.MSComm1.PortOpen:= True;
      if Data.ADOQuery1.RecordCount>0 then
      begin
        Data.ADOQuery1.Edit;
        Data.ADOQuery1.Fields[0].Value := IntToStr(ComboBox1.ItemIndex+1);
        Data.ADOQuery1.Post;
      end
      else
      begin
        with Data.ADOQuery1 do
        begin
          Close;
          SQL.Clear;
          SQL.Add('insert 端口表 values(:a)');
          Parameters.ParamByName('a').Value := IntToStr(ComboBox1.ItemIndex+1);
          ExecSQL;
        end;
      end;
      Application.MessageBox('设置成功.','提示',64);
    Except
      Form1.MSComm1.CommPort := 1;
      Form1.MSComm1.PortOpen:= True;
      Application.MessageBox('系统出错.','提示',64);
    end;
  end;
end;

end.

⌨️ 快捷键说明

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