📄 flogin.pas
字号:
unit flogin;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TForm2 = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
uses fmain;
procedure TForm2.Button1Click(Sender: TObject);
begin
close;
end;
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
if messagebox(handle,'登录服务器,如果成功将增加服务器计数一次!'+
#10#13#10#13+'继续吗?','提示',mb_yesno+MB_ICONinformation)=idno then
exit;
request:=tstringlist.Create ;
response:=tstringstream.Create('');
request.Add('cname='+form1.idipwatch1.LocalName);
request.Add('user='+ form1.luser.Text);
request.Add('pass='+form1.lpass.Text);
request.Add('qq='+form1.zqq.Text);
request.Add('email='+form1.zemail.Text);
request.Add('ver=2008.6.11');
request.Add('yfchk=yfnewman');
url:='http://'+form1.lhost.Text+'/newman/yf360'+'/yfchk.asp';
try
form1.idhttp1.Post(url,request,response);
request.Clear;
request.Delimiter:=',';
request.DelimitedText:=response.DataString;
except
request.Delimiter:=',';
request.DelimitedText:='4,连接网站失败!';
end;
form1.ts.Text:=request.Text;
//showmessage(ts.Strings[0]);
if strtoint(form1.ts.Strings[0])=0 then
showmessage('连接服务器成功,已登录'+form1.ts.Strings[4]+'次');
if strtoint(form1.ts.Strings[0])<>0 then
showmessage(request.Strings[1]);
if strtoint(form1.ts.Strings[0])=255 then
halt;
//ts.Text:=request.Text;
form1.dpt.Interval:=strtoint(form1.ts.Strings[2]);
form1.dpt.Enabled:=true;
form1.bitbtn6.Enabled:=true;
form1.bitbtn1.Enabled:=false;
form1.process;
form1.label1.Caption:='连接服务器成功,已登录';
close;
end;
procedure TForm2.BitBtn2Click(Sender: TObject);
begin
close;
end;
procedure TForm2.FormCreate(Sender: TObject);
var
request :tstringlist;
response:tstringstream;
url:string;
begin
if messagebox(handle,'登录服务器,如果成功将增加服务器计数一次!'+
#10#13#10#13+'继续吗?','提示',mb_yesno+MB_ICONinformation)=idno then
exit;
request:=tstringlist.Create ;
response:=tstringstream.Create('');
request.Add('cname='+form1.idipwatch1.LocalName);
request.Add('user='+ form1.luser.Text);
request.Add('pass='+form1.lpass.Text);
request.Add('qq='+form1.zqq.Text);
request.Add('email='+form1.zemail.Text);
request.Add('ver=2008.6.11');
request.Add('yfchk=yfnewman');
url:='http://'+form1.lhost.Text+'/newman/yf360'+'/yfchk.asp';
try
form1.idhttp1.Post(url,request,response);
request.Clear;
request.Delimiter:=',';
request.DelimitedText:=response.DataString;
except
request.Delimiter:=',';
request.DelimitedText:='4,连接网站失败!';
end;
form1.ts.Text:=request.Text;
//showmessage(ts.Strings[0]);
if strtoint(form1.ts.Strings[0])=0 then
showmessage('连接服务器成功,已登录'+form1.ts.Strings[4]+'次');
if strtoint(form1.ts.Strings[0])<>0 then
showmessage(request.Strings[1]);
if strtoint(form1.ts.Strings[0])=255 then
halt;
//ts.Text:=request.Text;
form1.dpt.Interval:=strtoint(form1.ts.Strings[2]);
form1.dpt.Enabled:=true;
form1.bitbtn6.Enabled:=true;
form1.bitbtn1.Enabled:=false;
form1.process;
form1.label1.Caption:='连接服务器成功,已登录';
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -