打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
软件自动升级方法与解决方案

件自动升级,就必须要原来的软件代替了。但是如何代替现在正在运行软件?

方法只有一种,即是用第三方法软件。这个第三方法软件可以好几种,1.是Bat(批处理软件)。2.自编软件。
这两种方式的程序编的是不相同的。

第一种:Bat软件的设计原理如下:
            1.通过程序得到需要升级的需求。 
            2.用程序生成一个Bat文件,通过Bat得到最新的软件。
            3.再关闭这个程序,并通过Bat得到代替原有的软件。再删除自动删除Bat文件。

第二种:自编升级软件,设计原理如下:
            1.通过程序得到需要升级的需求。
            2.关闭自己,并运行自编的软件,最后,得到这个软件,并覆盖软件。
            3.最后,关闭自动升级软件,并运行软件。

第一种的好处:不用再写升级软件。但是同时要定Bat处理过程软件。
第二种的好处:流程明确,并且可以通过进程条的形式显示程序更新的过程。(这种是比较流行的升级方式)。

==============

在设计本程序时,出现了两个问题:

第一:下载时,在本机可以实现,但是下载别的FTP时,就会出现产生不了文件的问题。

     解决方法: 原先使用的方法是:先打开一个文件,当接到数据后,把数据写到这个文件里,再接到再写的过程。等数据完成后,再把文件关闭,这时才产生文件。
     现在的方法更改为:先打开一个文件,当接到数据后,把数据写到文件里,并且关闭文件,这时就会产生文件。而等到再接到数据时,再打开这个文件,再写入,再关闭。
     当更改为后一种后,就不再出现这个问题了。 

第二:程序完成后,在本机可以运行,但是在别的机器上时,出现Run Time Error '429'错误。即ActiveX部件不能创建对象。
     
     这个问题是由于Winsock.Ocx控件本身的问题产生的,原因是目标计算机失去了注册信息。


The error occurs because the target computer is missing the license information for the control objects that are used in the application. You might attempt to set the project reference to point to MSWINSCK.ocx, and then generate a deployment package through the use of the Package and Deployment Wizard. This would generate a setup package that contains the correct version of the Winsock control. However, the license key for the control will not be compiled into the application unless an instance of the control is placed on a form. When you try to instantiate the objects at run time, the application has no way to provide the license key, and the code will fail. For example, the following code will run properly at design time, but will fail at run time on computers that do not have Visual Basic installed:

Dim myWinSock As MSWinsockLib.WinsockSub Main()' Early binding does not workSet myWinSock = New MSWinsockLib.WinsockmyWinSock.LocalPort = 5432myWinSock.ListenMsgBox ("Listening!")myWinSock.CloseEnd Sub

通过,下面这种方法,就可以解决这个问题。
Therefore, you must provide an instance of the Winsock control on a form so that Visual Basic can compile the license information into the application. You can make the form hidden if necessary. To do this, set the form's Visible property to "False." You can then prepare for deployment. The following code snippet demonstrates the method:

Dim myWinsock As MSWinsockLib.WinsockSub Main()' Form1 is hiddenSet myWinsock = Form1.myWinsockmyWinsock.LocalPort = 5432myWinsock.ListenMsgBox ("Listening!")myWinsock.CloseEnd Sub

2005年11月14日 10:49

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
重装系统后我一般做10步操作
几步搞定Win10系统易升,彻底关闭易升自动升级方法
重要!开票软件最新升级攻略请收好~
文件轻松拆分 一键独立合并电脑使用技巧
用Delphi编制可自动升级程序
听说有一门技术叫windows批处理(bat),请问它有什么现实用途?
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服