You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
5.3 KiB
Plaintext

11 months ago
unit u_sys_update_net;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ExtCtrls, DB, ADODB,inifiles, StdCtrls,ShellApi;
type
Tfrm_sys_update_net = class(TForm)
Animate1: TAnimate;
Panel1: TPanel;
t_sys_soft_do: TADOQuery;
t_sys_soft_doDSDesigner: TStringField;
t_sys_soft_doDSDesigner2: TBlobField;
t_sys_soft_doDSDesigner1: TStringField;
t_sys_soft_doDSDesigner22: TStringField;
t_sys_soft_doDSDesigner3: TStringField;
RichEdit1: TMemo;
p_update: TADOStoredProc;
t_sys_soft_update: TADOQuery;
db_update: TADOConnection;
t_sql: TADOQuery;
t_readme: TADOQuery;
procedure FormShow(Sender: TObject);
procedure db_updateBeforeConnect(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_sys_update_net: Tfrm_sys_update_net;
implementation
uses u_main, my_sys_function, u_sys_update, my_sys_chat;
{$R *.dfm}
procedure Tfrm_sys_update_net.FormShow(Sender: TObject);
var
table:Tadoquery;
inifile1:Tinifile;
str:string;
j:integer;
if_add:boolean;
if_error:boolean;
begin
try
if not DirectoryExists(ExtractFilePath(Application.ExeName)+'update') then
CreateDir(ExtractFilePath(Application.ExeName)+'update');
frm_main.Hide;
table:=Tadoquery.Create(application);
table.Connection:=frm_main.db;
table.SQL.text:='select <20><EFBFBD><E6B1BE>,<2C>汾1,<2C>汾2,<2C>汾3 from t_sys_soft';
table.open;
j:=strtoint(table.fieldbyname('<27>汾1').asstring)*10000
+strtoint(table.fieldbyname('<27>汾2').asstring)*100
+strtoint(table.fieldbyname('<27>汾3').asstring);
Panel1.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...';
update_soft_down;
Panel1.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...';
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'update\'+'<27><EFBFBD><E6B1BE>.ini');
str:=inifile1.ReadString('<27><EFBFBD><E6B1BE>','<27>汾1','');
str:=str+inifile1.ReadString('<27><EFBFBD><E6B1BE>','<27>汾2','');
str:=str+inifile1.ReadString('<27><EFBFBD><E6B1BE>','<27>汾3','');
inifile1.Free;
t_sql.close;
t_sql.Parameters.ParamByName('<27><EFBFBD><E6B1BE>').value:=j;
t_sql.open;
t_readme.close;
t_readme.Parameters.ParamByName('<27><EFBFBD><E6B1BE>').value:=j;
t_readme.open;
t_sys_soft_update.open;
t_sql.first;
while not t_sql.eof do
begin
try
p_update.Parameters.ParamByName('SQLStr').value:=t_sql.fieldbyname('ִ<><D6B4>').asstring;
p_update.ExecProc;
except
frm_sys_update.t_sys_soft_error.insert;
frm_sys_update.t_sys_soft_error['<27><><EFBFBD>԰汾']:=j;
frm_sys_update.t_sys_soft_error['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
frm_sys_update.t_sys_soft_error['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=employee;
frm_sys_update.t_sys_soft_error['ִ<><D6B4><EFBFBD>ļ<EFBFBD>']:=t_sql.fieldbyname('ִ<><D6B4>').asstring;
frm_sys_update.t_sys_soft_error.post;
if_error:=true;
end;
t_sql.next;
end;
t_readme.first;
while not t_readme.eof do
begin
t_sys_soft_update.insert;
t_sys_soft_update['<27><EFBFBD><E6B1BE>']:=copy(t_readme.fieldbyname('<27><EFBFBD><E6B1BE>').asstring,1,1)
+'.'+copy(t_readme.fieldbyname('<27><EFBFBD><E6B1BE>').asstring,2,2)
+'.'+copy(t_readme.fieldbyname('<27><EFBFBD><E6B1BE>').asstring,4,2);
t_sys_soft_update['<27><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>']:=t_readme.fieldbyname('<27><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>').asstring;
t_sys_soft_update['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
t_sys_soft_update.post;
t_readme.next;
end;
t_sys_soft_do.close;
t_sys_soft_do.open;
if_add:=true;
while if_add do
begin
try
t_sys_soft_do.edit;
t_sys_soft_do['<27><EFBFBD><E6B1BE>']:=copy(str,1,1)+'.'+copy(str,2,2)+'.'+copy(str,4,2);
t_sys_soft_do['<27>汾1']:=copy(str,1,1);
t_sys_soft_do['<27>汾2']:=copy(str,2,2);
t_sys_soft_do['<27>汾3']:=copy(str,4,2);
t_sys_soft_doDSDesigner2.LoadFromFile(ExtractFilePath(Application.ExeName)+'update\'+'<27>κ<EFBFBD><CEBA><EFBFBD><EFBABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ.zip');
t_sys_soft_do.Post;
if_add:=false;
except
sleep(1000);
end;
end;
if if_error then
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>');
if update_soft_banben_bendi(frm_main.db) then
begin
SendMsg_gonggao('52','<27><><EFBFBD><EFBFBD>ϵͳ<CFB5>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD>µ<EFBFBD>½<EFBFBD>°汾<C2B0><E6B1BE><EFBFBD><EFBFBD>');
ShellExecute(Application.Handle,nil,PChar(ExtractFilePath(Application.ExeName)+'update.exe'),nil,nil,SW_NORMAL);
application.Terminate;
end;
finally
table.free;
end;
end;
procedure Tfrm_sys_update_net.db_updateBeforeConnect(Sender: TObject);
begin
db_update.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source='
+ExtractFilePath(Application.ExeName)+'update\update.mdb;'
+'Mode=Share Deny None;Extended Properties="";'
+'Jet OLEDB:System database="";Jet OLEDB:Registry Path="";'
+'Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;'
+'Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;'
+'Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";'
+'Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;'
+'Jet OLEDB:Don'+''''+'t Copy Locale on Compact=False;'
+'Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False';
end;
end.