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

📄 unitid.pas

📁 参照上兴、鸽子等源码编写编写出来的。 编译环境:Delphi7+SP+DP+indy9等控件
💻 PAS
字号:
unit UnitID;

interface

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

type
  TFormID = class(TForm)
    Label1: TLabel;
    EditID: TEdit;
    CmbIDAceptar: TSpeedButton;
    cmbIdCancelar: TSpeedButton;
    procedure cmbIdCancelarClick(Sender: TObject);
    procedure CmbIDAceptarClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormID: TFormID;
  broadnum:integer;
  IDThread: TIdPeerThread;
implementation

{$R *.dfm}

procedure TFormID.cmbIdCancelarClick(Sender: TObject);
begin
  FormID.Close;
end;

procedure TFormID.CmbIDAceptarClick(Sender: TObject);
var
  AThread: TIdPeerThread;
    i: integer;
begin
  if IDthread<>nil then
  begin
  FormMain.ListViewConexiones.Selected.SubItems[4]:= EditID.Text;
  IDthread.Connection.Writeln('CAMBIOID' + EditID.Text);
  FormID.Close;
  exit;
  end;
  case MessageBox(0, '修改选中的主机的服务端标记?', '确认', mb_IconQuestion + Mb_YesNo) of
    IdNo: exit;
  end;
  for i:=0 to  FormMain.ListViewConexiones.Items.Count-1 do
  begin
  if  FormMain.ListViewConexiones.Items.Item[i].Checked then
  begin
  inc(broadnum);
  Athread := TidpeerThread(FormMain.ListViewConexiones.Items[i].SubItems.Objects[0]);
  FormMain.ListViewConexiones.Items[i].SubItems[4]:= EditID.Text;
  AThread.Connection.WriteLn('CAMBIOID' + EditID.Text);
  end;
  if broadnum=0 then FormMain.Memo1.lines.add('未选择任何主机') else
  FormMain.Memo1.lines.add(inttostr(broadnum)+'条修改服务端标记命令完成');
  end;
  FormID.Close;
 end;
end.

⌨️ 快捷键说明

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