📄 fastshe.pas
字号:
unit FastShe;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, XPMenu, ExtCtrls, TFlatPanelUnit, TFlatSpeedButtonUnit,
XP_Button, IPEdit;
type
TFastShef = class(TForm)
FlatPanel1: TFlatPanel;
FlatPanel2: TFlatPanel;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
CheckBox1: TCheckBox;
Label3: TLabel;
Edit3: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
XPMenu1: TXPMenu;
Bevel1: TBevel;
FlatSpeedButton1: TFlatSpeedButton;
XP_Button1: TXP_Button;
XP_Button2: TXP_Button;
procedure BitBtn1Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FastShef: TFastShef;
implementation
uses main;
{$R *.DFM}
procedure TFastShef.BitBtn1Click(Sender: TObject);
var
i,ip_where,n_ip_h: smallint;
s_ip,s_ip_q,s_ip_h:string;
begin
n_ip_h:=0;
if CheckBox1.Checked then
begin
s_ip:=trim(edit3.text); //取得第三个点的IP位置
s_ip_q:=s_ip;
i:=0;
ip_where:=0;
while Pos('.', S_ip) > 0 do
begin
i:=i+1;
ip_where:=Pos('.', S_ip);
S_ip[ip_where] := '&';
end;
if i<>3 then begin//校验IP地址
showmessage('请仔细检查!IP地址不规范!');
exit;
end;
//取得IP地址前三部分
s_ip:=s_ip_q;
s_ip_q:=copy(s_ip,1,ip_where);
s_ip_h:=copy(s_ip,ip_where+1,length(s_ip)-ip_where);
try
n_ip_h:=strtoint(s_ip_h);
except
showmessage('请仔细检查!IP地址不规范!');
exit;
end;
end;
for i := 0 to 74 do
begin
computer_name[i] := trim(edit1.text) + inttostr(strtoint(edit2.Text) + i);
if checkbox1.Checked then
computer_ip[i]:=s_ip_q+inttostr(n_ip_h+i)
else
computer_ip[i]:='';
wsh_socket[i].Close;
end;
end;
procedure TFastShef.CheckBox1Click(Sender: TObject);
begin
Edit3.Visible:=not Edit3.Visible;
label3.visible:=not label3.visible;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -