急!急!急!Delphi 中如何实现客户端程序自动升级???

急!急!急!Delphi 中如何实现客户端程序自动升级???,第1张

在你的客户端做一个INI文件,里面记录你放到网上的配置文件的地址,然后每次都去取这个配置文件,里面记录了最新的版本号和下载连接,并与本地的版本号比较,如果比较新,就从上述地址下载新的版本。delphi自动更新2008年09月03日 星期三 23:05仅仅是一个DEMO,正打算添加功能呢。仅仅是一个自动更新的一个思维而已。function downloadfile(url: stringf: string): booleanbeginURLDownloadToFile(nil, pchar(url), pchar(f), 0, nil) if fileexists(f) then result := trueelse result := falseendprocedure dosomething(s: string)begin//dosomestringendvarstrmem: tmemorystreaminif: tinifilefname, str: stringi: integerconsthost = ' http://192.168.1.102/'beginfname := extractfilepath(application.ExeName) + 'config.ini'strmem := tmemorystream.Createidhttp1.Get(host + 'aa.ini', strmem)strmem.Seek(0, sofrombeginning)memo1.Lines.LoadFromStream(strmem)strmem.SaveToFile(fname)strmem.Freeinif := tinifile.Create(fname)for i := 0 to form1.ComponentCount - 1 doif form1.Components[i] is tedit thenbegin str := inif.ReadString('form', (form1.Components[i] as tedit).Name, '') if (extractfileext(str) = '.exe') or (extractfileext(str) = '.dll') thenif downloadfile(host + str, str) then dosomething(str) (form1.Components[i] as tedit).Text := str endinif.Freeend//本地东西。----varini: tinifilefname, str: stringi: integerbeginfname := extractfilepath(application.ExeName) + 'aa.ini'ini := tinifile.Create(fname)for i := 0 to form1.ComponentCount - 1 dobeginif form1.Components[i] is tedit thenbegin str := (form1.Components[i] as tedit).Text ini.WriteString('form', form1.Components[i].Name, str)endendend更新服务器上的东西。

远程连接,其实也就是与SQL 数据库的连接,知道对方的IP,开设的端口就可以连了,跟连本地的方法差不多。如果你用这个TADOConnection连,

ConnectionString:=Format('Provider=SQLOLEDB.1Password=%sPersist Security Info=TrueUser ID=%sInitial Catalog=%sData Source=%s',[登陆密码,用户名,数据库名,服务器地址])一般用户名是sa,服务器名本地就是一点(.),远程的就IP,+端口,例如,192.168.1.25,1433,

升级只是对数据库的升级,比如修改表,视图,存储过程,只要让服务器运行这些相关的SQL语句就行了,自动升级这个前面的仁兄已经讲了,就不多讲了。

1、首先点击打开delphi10.0系统程序。

2、其次点击右下角的进行设置按钮。

3、然后找到设置中的进行更新软件,点击就会开始delphi10.0软件的更新工作。

4、最后点击进行安装即可完成升级。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/11970398.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存