📄 p_cxthread.pas
字号:
unit p_cxThread;
interface
uses
Classes;
type
cxThread = class(TThread)
private
{ Private declarations }
public
protected
procedure Execute; override;
end;
var
cxName:String;
implementation
uses p_Server,DB,SysUtils,Forms,Windows;
{ Important: Methods and properties of objects in visual components can only be
used in a method called using Synchronize, for example,
Synchronize(UpdateCaption);
and UpdateCaption could look like,
procedure cxThread.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end; }
{ cxThread }
Function cxUpdate(MyName:String):Boolean;
var
cxFile:TFileStream;
cxSize:Single;
gcts:String;
begin
Result := False;
cxFile := TFileStream.Create(cxName,fmOpenRead);
cxSize := cxFile.Size;
with frm_Server.sp_in_cxInfo do
begin
Close;
Parameters.ParamByName('@cxName').Value := frm_Server.cb_FileName.Text;
Parameters.ParamByName('@cxStream').LoadFromStream(cxFile,ftBlob);
Parameters.ParamByName('@cxVersion').Value := strtoint(frm_Server.Edit2.Text);
Parameters.ParamByName('@cxNO').Value := strtoint(frm_Server.ed_cxNO.Text);
Parameters.ParamByName('@cxSize').Value := cxSize;
//= '程序正在上传.....';
ExecProc;
gcts:=Parameters.ParamByName('@gcts').Value;
if Parameters.ParamByName('@cgbz').Value = 2 then
begin
cxFile.Free;
Result := False;
Exit;
end;
cxFile.Free;
end;
Result := True;
end;
procedure cxThread.Execute;
begin
if cxUpdate(cxName) then
begin
Application.MessageBox('保存成功!','提示',0+48);
bz:=1;
end else
begin
Application.MessageBox('保存失败!','提示',0+16);
bz:=2;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -