?? p_cxthread.pas
字號(hào):
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.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -