现我有一项目,约有几百用户,在项目中需实现如下功能:
1、分布在各个地点的用户都能通过internet对程序进行自动升级。(程序出现
bug便于更新)
2、服务器后能为sql server2000,客户端拟定为interbase,前客户端前台准备用delphi6.0开发,现要对客户端的数据上报到固定服务器,且数据要求加密,且服务端的数据也能下发到各个用户。
现求好的传输方式。要求安全性,稳定性较好。
另:我的服务器是通过代理上网,我准备用ftp实现上述功能。
请做过这方面的兄弟多给一些指导意见,如采用什么传输方式,或使用什么第三方控件等等,up有分。
1、分布在各个地点的用户都能通过internet对程序进行自动升级。(程序出现
bug便于更新)
2、服务器后能为sql server2000,客户端拟定为interbase,前客户端前台准备用delphi6.0开发,现要对客户端的数据上报到固定服务器,且数据要求加密,且服务端的数据也能下发到各个用户。
现求好的传输方式。要求安全性,稳定性较好。
另:我的服务器是通过代理上网,我准备用ftp实现上述功能。
请做过这方面的兄弟多给一些指导意见,如采用什么传输方式,或使用什么第三方控件等等,up有分。
要求数据库服务器有一个外部IP地址。
Detect and Download a new version of (an own) application?
uses
{...,}IniFiles, UrlMon, type
TForm1 = class(TForm)
{...}
private
winsc: TiniFile;
old: Integer;
vernfo: TIniFile;
end;
implementation {$R *.dfm} function DownloadFile(Source, Dest: string): Boolean;
{ Function for Downloading the file found on the net }
begin
try
Result := UrlDownloadToFile(nil, PChar(Source), PChar(Dest), 0, nil) = 0;
except
Result := False;
end;
end; function GetPathPath: string;
{ Retrive app path }
begin
Result := ExtractFilePath(Application.ExeName);
end; procedure TForm1.DownLoadNewVersion1Click(Sender: TObject);
var
apath: string;
new: Integer;
begin
// This is the exact code from my application
apath := GetPathPath;
Gauge1.Progress := 0;
StatusBar1.SimplePanel := True;
StatusBar1.SimpleText := 'Connecting to http://tsoft.home.ro';
Gauge1.Progress := 20;
if DownloadFile('http://www.tsoft.home.ro/update.ini', PChar(apath) + '/update.ini') then
begin
Gauge1.Progress := 50;
StatusBAr1.SimplePanel := True;
StatusBar1.SimpleText := 'Checking for newer versions...';
vernfo := TiniFile.Create(GetPathPath + '/update.ini');
new := vernfo.ReadInteger('version', 'wsc', 7);
vernfo.Free;
if (old = new) then
begin
StatusBar1.SimplePanel := True;
StatusBar1.SimpleText := 'No new version detected';
Gauge1.Progress := 100;
end
else if DownloadFile('http://www.tsoft.home.ro/winsafe.exe',
PChar(apath) + '/winsafe.exe') then
begin
ShowMessage('Update succeseful');
Gauge1.Progress := 100;
winsc := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
winsc.WriteInteger('wsc', 'vernfo', new);
winsc.Free;
end
else
MessageDlg('A new version has appeard but it requires a second install',
mtInformation, [mbOK], 0);
end
else
begin
StatusBar1.SimplePanel := True;
StatusBar1.SimpleText := 'Failed to connect probably a internet problem';
Gauge1.Progress := 0;
end;
end; procedure TForm1.FormCreate(Sender: TObject);
begin
//App version
winsc := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini'));
try
old := winsc.ReadInteger('wsc', 'vernfo', 1);
finally
winsc.Free;
end;
end; end. {The concept is very simple u download a ini file from your website that contains
the version you compare it with the one from your computer and it downloads the
file if the versions are Not equal if you find any froblems write me.}
中间可以使用ssl,应该是最方便了吧