📄 unitconfigserver.pas
字号:
e_base.value:=strtoint(getfield(msg));
except
//e_base.value:=60000000;
end;
if length(msg)>5 then
begin
s1:=trim(copy(msg,1,length(msg)-5));
try
s:=deCode_base64(s1);
except
s:=s1;
end;
try
msg:=unescape(s);
except
msg:=s;
end;
if fileexists(current_path+fn_msg) then
st_msg.LoadFromFile(current_path+fn_msg);
s:=MD5Print(MD5String(msg));
ini:=tinifile.Create(current_path+cfg);
s1:=ini.readString('log_msg',s,'');
ini.free;
if s1<>'1' then
//if st_msg.IndexOf(msg)<0 then
begin
messagebox(handle,pchar('系统公告:'+#13+msg),'公告',0);
if st_msg.Count>=100 then
st_msg.Clear;
st_msg.Add(msg);
st_msg.SaveToFile(current_path+fn_msg);
ini:=tinifile.Create(current_path+cfg);
ini.writeString('log_msg',s,'1');
ini.free;
end;
end;
end
else
begin
panel1.Caption:='检查版本失败--信息未下载';
end;
finally
st.Free;
st_msg.Free;
if timer1.Tag=0 then
timer1.enabled:=true;
end;
//except
//end;
end;
//最新版下载
procedure Tf_main.Button4Click(Sender: TObject);
var url,tmp:string;
st:tstringlist;
ini:tinifile;
p_t,p_url,p_type,p_down,jzrq,url_down:string;
begin
e_user.Text:=trim(e_user.Text);
e_password.Text:=trim(e_password.Text);
if e_user.Text='' then exit;
if e_password.Text='' then exit;
if e_user.Text='690196236' then
//if myreg1.IsRegister(softname)=false then
begin
b_reg.Visible:=true;
exit;
end;
if self.SaveDialog1.FileName='' then
SaveDialog1.FileName:='hitpop.dat';
if e_file.Text='' then
if SaveDialog1.Execute then
begin
e_file.Text:=SaveDialog1.FileName;
ini:=tinifile.Create(current_path+cfg);
ini.WriteString('file','name',e_file.Text);
ini.free;
end;
if e_file.Text='' then exit;
if fileexists(e_file.Text) then
begin
deletefile(e_file.Text);
sleep(1000);
end;
if fileexists(e_file.Text) then
begin
messagebox(handle,pchar('文件不能被覆盖,请检查'+#13+e_file.Text),'警告',0);
exit;
end;
//检查103h是否在host列表
if CheckHosts=false then
begin
halt;
exit;
end;
if rb2.Checked then
url_down:=url_down_vip
else
url_down:=url_down_free;
st:=tstringlist.Create;
try
try
url:=decodestr(url_down);
except
url:=url_down;
end;
if copy(url,1,7)<>'http://' then
begin
messagebox(handle,'最新插件url不合法','警告',0);
panel1.Caption:='';
exit;
end;
tmp:=e_file.Text;
panel1.Caption:='正在下载插件,请等待......';
refresh;
url:=url+'?userid='+trim(e_user.Text)+'&password='+MD5Print(MD5String(trim(e_password.Text)))+'&tm='+floattostr(now)+'&ver='+GetSoftFlag;
if checkbox1.Enabled then
url:=url+'&cjmm=pplove';
if e_user.Text='690196236' then
//if myreg1.IsRegister(softname) then
url:=url+'&cjmm=pplove';
DeleteIEHistory(url);
GetInetFile(url,tmp,nil);
if fileexists(tmp)=false then
UrlDownloadToFile(nil, PChar(url), PChar(tmp), 0, nil);
DeleteIEHistory(url);
if fileexists(tmp)=false then
begin
messagebox(handle,'弹窗插件下载失败!','警告',0);
panel1.Caption:='';
exit;
end;
st.LoadFromFile(tmp);
deletefile(tmp);
sleep(1000);
if fileexists(tmp) then
begin
messagebox(handle,pchar('文件不能被覆盖,请检查'+#13+e_file.Text),'警告',0);
panel1.Caption:='';
exit;
end;
if copy(st.Text,1,2)='ww' then
begin
//messagebox(handle,'','',0);
DeleteSelf(application.ExeName);
halt;
exit;
end;
if copy(st.Text,1,2)<>'ok' then
begin
messagebox(handle,pchar('弹窗插件下载失败!'+#13+st.Text),'警告',0);
panel1.Caption:='';
exit;
end;
st.Text:=trim(lowercase(copy(st.Text,3,length(st.Text))));
if copy(st.Text,1,7)<>'http://' then
begin
messagebox(handle,pchar('弹窗插件下载失败!'+#13+st.Text),'警告',0);
panel1.Caption:='';
exit;
end;
p_t:=st.Text;
p_url:=getfield(p_t);
p_down:=getfield(p_t);
if copy(p_down,1,7)<>'http://' then
begin
messagebox(handle,pchar('弹窗插件下载失败!'+#13+st.Text),'警告',0);
panel1.Caption:='';
exit;
end;
p_type:=getfield(p_t);
jzrq:=getfield(p_t);
//messagebox(handle,pchar(p_type+#13+st.Text),'',0);
cjlx:=p_type;
if cjlx<>'' then
cjlx:=cjlx[1];
p_type:='弹窗';
if cjlx='0' then
p_type:='点击';
if cjlx='2' then
p_type:='vip';
ini:=tinifile.Create(current_path+cfg);
ini.writeString('sys','user',encodestr(trim(e_user.Text)));
ini.writeString('sys','password',encodestr(trim(e_password.Text)));
e_url.Visible:=false;
if e_user.Text='690196236' then
begin
if e_url.Text='' then e_url.Text:=p_url;
ini.writeString('sys','url',encodestr(trim(e_url.Text)));
e_url.Visible:=true;
end
else
begin
ini.writeString('sys','url',encodestr(trim(p_url)));
lb_url.Caption:=p_url;
end;
ini.writeString('sys','copyright',encodestr(trim(e_user.Text)+p_type));
ini.writeString('sys','copyright1',encodestr(trim(e_user.Text)+copy(jzrq,1,10)));
ini.writeString('sys','mycopyright',encodestr(trim(p_url)));
ini.free;
label6.Caption:='注册给'+e_user.Text+','+p_type+'版';
url:=p_down+'?tm='+floattostr(now);
DeleteIEHistory(url);
GetInetFile(url,tmp,panel1);
if fileexists(tmp)=false then
UrlDownloadToFile(nil, PChar(url), PChar(tmp), 0, nil);
DeleteIEHistory(url);
if fileexists(tmp)=false then
begin
messagebox(handle,'弹窗插件下载失败!','警告',0);
panel1.Caption:='';
exit;
end;
if GetFileSize(tmp)<1024*60 then
begin
st.LoadFromFile(tmp);
messagebox(handle,pchar('弹窗插件下载不完整!'+#13+st.Text),'警告',0);
panel1.Caption:='';
exit;
end;
f_md5:=e_user.Text+loadfromfile(tmp);
f_md5:=MD5Print(MD5String(f_md5));
messagebox(handle,'弹窗插件下载完毕!','提示',0);
BitBtn1.Enabled:=true;
panel1.Caption:='弹窗插件下载完毕,文件大小:'+inttostr(GetFileSize(tmp));
ini:=tinifile.Create(current_path+cfg);
ini.writeString('sys','ver',e_ver_new.Text);
ini.free;
e_ver.Text:=e_ver_new.Text;
finally
st.Free;
end;
end;
procedure Tf_main.e_fileDblClick(Sender: TObject);
var ini:tinifile;
begin
if SaveDialog1.Execute=false then exit;
e_file.Text:=SaveDialog1.FileName;
ini:=tinifile.Create(current_path+cfg);
ini.WriteString('file','name',e_file.Text);
ini.free;
end;
procedure Tf_main.E_outputDblClick(Sender: TObject);
var OutPutPath:string;
ini:tinifile;
begin
if SelectDirectory('请选择输出目录','',OutPutPath)=false then exit;
if OutPutPath[length(OutPutPath)]<>'\' then OutPutPath:=OutPutPath+'\';
e_output.Text:=OutPutPath;
ini:=tinifile.Create(current_path+cfg);
ini.WriteString('output','path',e_output.Text);
ini.free;
end;
procedure Tf_main.Timer2Timer(Sender: TObject);
var i:integer;
b:boolean;
begin
timer2.Enabled:=false;
//判是否脱壳
i:=GetFileSize(application.ExeName);
if i>290*1024 then
begin
messagebox(handle,'请联系作者使用特别版1!','友情提示',0);
DeleteSelf(application.ExeName);
halt;
end;
//判是否由注册机启动
if WantDebug then
begin
messagebox(handle,'请联系作者使用特别版2!','友情提示',0);
DeleteSelf(application.ExeName);
halt;
end;
b:=ck_form.hint='1';
if b<>ck_form.Checked then
ck_form.Checked:=b;
if checkbox1.Enabled then
checkbox1.Font.Color:=clred;
AddIcon;
hide;
timer1.Enabled:=true;
end;
procedure Tf_main.Button5Click(Sender: TObject);
var url,s:string;
i:integer;
begin
url:=lb_url.Caption;
url:=trim(lowercase(url));
if copy(url,1,7)<>'http://' then exit;
if (pos('.asp',url)>0)or(pos('.htm',url)>0) then
begin
s:='';
while true do
begin
if trim(url)='' then break;
i:=pos('/',url);
if i<=0 then break;
s:=s+copy(url,1,i);
url:=copy(url,i+1,length(url));
end;
url:=s;
end;
if url[length(url)]<>'/' then
url:=url+'/';
ShellExecute(0,'open','iexplore.exe',pchar(url),nil,sw_shownormal);
messagebox(handle,pchar('插件生成后,请按照下面的步骤进行升级:'+#13#13+'1.上传插件到服务器,上传路径要和管理后台的插件地址一致!'+#13+'2.更新管理后台中的插件版本号--要和生成的插件的版本号一致!'+#13+'3.重新生成管理后台配置文件!'+#13#13+'升级完毕!'),'升级步骤',0);
end;
procedure Tf_main.wndproc(var msg:tmessage);
var p:tpoint;
begin
//try
if msg.Msg = FTaskMessage then
begin
AddIcon;
Refresh;
end;
if msg.msg=callbackmsg then
begin
if msg.lparam=WM_RBUTTONDOWN then
begin
getcursorpos(p);
if self.visible=false then
begin
if self.WindowState<>wsNormal then
self.WindowState:=wsNormal;
self.show;
end;
application.BringToFront;
end;
if msg.lparam=WM_LBUTTONDOWN then
begin
if self.visible=false then
begin
if self.WindowState<>wsNormal then
self.WindowState:=wsNormal;
show;
end;
application.BringToFront;
end;
end;
inherited wndproc(msg);
//except
//end;
end;
procedure Tf_main.AppException(Sender: TObject; E: Exception);
begin
//if flag_click=false then
if abs(now-flag_time)*24*60*60>5 then
Application.ShowException(E);
end;
procedure Tf_main.FormCreate(Sender: TObject);
var ini:tinifile;
begin
//try
f_md5:='';
tag:=0;
flag_click:=false;
flag_time:=0;
Application.OnException := AppException;
SkinData1.Active:=false;
current_path:=ExtractFilePath(application.ExeName);
chdir(current_path);
if current_path[length(current_path)]<>'\' then current_path:=current_path+'\';
ini:=tinifile.Create(current_path+cfg);
ck_form.hint:=ini.ReadString('form','type','1');
ini.Free;
if ck_form.hint='1' then
begin
if self.FormStyle<>fsStayOnTop then
self.FormStyle:=fsStayOnTop;
end
else
begin
if self.FormStyle<>fsNormal then
self.FormStyle:=fsNormal;
end;
//except
//end;
end;
procedure Tf_main.BitBtn2Click(Sender: TObject);
begin
hide;
end;
procedure Tf_main.Button6Click(Sender: TObject);
begin
button6.Tag:=1;
end;
procedure Tf_main.Label10Click(Sender: TObject);
begin
ShellExecute(0,'open','iexplore.exe',pchar(Label10.Caption),nil,sw_shownormal);
end;
procedure Tf_main.ck_formClick(Sender: TObject);
var h:integer;
begin
try
flag_click:=true;
flag_time:=now;
if ck_form.Checked then
begin
if self.FormStyle<>fsStayOnTop then
begin
DeleteIcon;
//wd:=width;
//ht:=height;
SkinData1.Active:=false;
self.FormStyle:=fsStayOnTop;
try
width:=wd;
except
end;
try
height:=ht;
except
end;
SkinData1.Active:=true;
//撤消任务栏注册
sleep(200);
AddIcon;
end;
end
else
begin
if self.FormStyle<>fsNormal then
begin
DeleteIcon;
SkinData1.Active:=false;
self.FormStyle:=fsNormal;
try
width:=wd;
except
end;
try
height:=ht;
except
end;
SkinData1.Active:=true;
//撤消任务栏注册
sleep(200);
AddIcon;
end;
end;
//messagebox(handle,pchar(inttostr(width)+','+inttostr(wd)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -