简体   繁体   English

如何在不重新安装的情况下更新Visual Basic应用程序

[英]how to update a visual basic application without reinstalling

I have a simple form with a button when clicked says Hello. 我有一个简单的带有按钮的表格,当您单击“说好”时。

Code as follows: 代码如下:

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    MsgBox("hello")

End Sub

End Class 末级

I installed it on my machine and now I was wondering how would i write updates to it without reinstalling the whole thing? 我将其安装在计算机上,现在我想知道如何在不重新安装整个内容的情况下对其进行更新?

You could roll your own updater app which checks on an ftp site / web site for files which are newer. 您可以滚动自己的更新程序应用程序,该应用程序在ftp站点/网站上检查较新的文件。 But it will have to be a separate app because you won't be able to update the currently running exe without stopping it first. 但这必须是一个单独的应用程序,因为您必须先停止它才能更新当前正在运行的exe。 Also the location of files can be an issue depending on permissions etc. 文件的位置也可能是一个问题,具体取决于权限等。

A better option as HansPassant suggested is to use ClickOnce deployment. HansPassant建议的更好的选择是使用ClickOnce部署。 This handles all the above for you and allows you to force your application to check for updates before it runs so you know you have the latest version out there. 这将为您处理以上所有问题,并允许您强制应用程序在运行之前检查更新,以便您知道那里有最新版本。

Here is a link to get you started 这是一个让您入门的链接

If YOU KNOW that the updates have no problems with the various environment (eg: no change in framework, DB, etc, etc) and you are just testing and work in a "controlled" place then you can simply replace the executable file. 如果您知道更新对各种环境都没有问题(例如:框架,数据库等没有变化),而您只是在“受控”位置进行测试和工作,则只需替换可执行文件即可。

But I certainly prefer ClickOnce :-) 但我当然更喜欢ClickOnce :-)

Once you set it up it works so nicely that the time to update the application is just a little more than replacing the executable... and you are much more safe 设置完成后,它的工作原理非常好,以至于更新应用程序的时间仅比替换可执行文件多一点……而且您更加安全

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Basic如何获取%appdata% - Visual Basic how to get to %appdata% 如何在Visual Basic ASP.NET Web应用程序中将编程代码添加到.aspx文件中 - how to add programmatical code into a .aspx file in a visual basic asp.net web application 从Visual Basic Net应用程序执行时,如何减少Excel VBA占用的运行时? - How to decrease the runtime that Excel VBA takes when executed from a Visual Basic Net application? 当我在 Visual Basic 中更新其他字段时,如何保持 SQL tble 字段不更新? - How to keep SQL tble field not updated when I update other fields in Visual Basic? 如何读取.NET Visual Basic应用程序中从C ++ DLL返回的const char *? - How to read const char* returned from C++ DLL in .NET Visual Basic application? 如何使用自定义脚本在不使用Visual Studio的情况下添加/更新引用? - How to add/update references without Visual Studio using a custom script? 从C#应用程序引用可视化基本名称空间有什么作用? - What are the effects of referencing the visual basic namespace from a C# application? Visual Basic如何重用类 - Visual Basic How do you Reuse Classes 如何在Windows启动时最小化应用程序-Visual Basic - How to minimize app at windows startup - visual basic 使用Word和Visual Basic .NET创建自定义文档应用程序 - Creating a custom documentation application using Word and Visual Basic .NET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM