• 在写自动更新程序中出现的问题


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

    第一:下载时,在本机可以实现,但是下载别的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.Winsock
    
    Sub Main()
        ' Early binding does not work
        Set myWinSock = New MSWinsockLib.Winsock
    
        myWinSock.LocalPort = 5432
    
        myWinSock.Listen
    
        MsgBox ("Listening!")
    
        myWinSock.Close
    End 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.Winsock
    
    Sub Main()
        ' Form1 is hidden
        Set myWinsock = Form1.myWinsock
    
        myWinsock.LocalPort = 5432
    
        myWinsock.Listen
    
        MsgBox ("Listening!")
    
        myWinsock.Close
    End Sub
    
  • 相关阅读:
    2D Polygons( Poygon) CGAL 4.13 -User Manual
    2D Convex Hulls and Extreme Points( Convex Hull Algorithms) CGAL 4.13 -User Manual
    Linear and Quadratic Programming Solver ( Arithmetic and Algebra) CGAL 4.13 -User Manual
    3D Spherical Geometry Kernel( Geometry Kernels) CGAL 4.13 -User Manual
    2D Circular Geometry Kernel ( Geometry Kernels) CGAL 4.13 -User Manual
    MySQL开启日志跟踪
    Cookie&Session
    Web服务器——WSGI
    win10上安装redis
    Ubantu上安装Redis
  • 原文地址:https://www.cnblogs.com/tongtkk/p/158296.html
Copyright © 2020-2023  润新知