Completed

Criar em Vb um form exemplo que faz sua atualização automaticamente, baseado num exemplo já feito do site www.macoratti.net/

Published on the September 08, 2016 in IT & Programming

About this project

Open

Criei um programinha em VB  e quero distribuir gratuitamente no meu site. No site do Macoratti link: http://www.macoratti.net/atual_vb.htm ensina como fazer que o programa busque uma nova versão que esteja em algum endereço. Mas deu alguns erros, Então a sua missão é fazer com que o código funcione.
Parece que está faltando um componente ou alo assim. Caso queira fazer outro código, desde que explicado também pode.

Segue o código abaixo, é só criar o proeto com form1 que terá a mesma visão que tive:

Public Class Form1

    Public Function Baixa_Versao(ByVal LocalArquivo As String, ByVal LocalURLArquivo As String) As Boolean
        On Error GoTo Baixa_erro

        Dim bt() As Byte

    Open LocalArquivo For Binary Access Write As #1
        bt() = Inet1.OpenURL(LocalURLArquivo, icByteArray)
    Put #1, , bt()
    Close #1
        Baixa_Versao = True

        Exit Function

Baixa_erro:
        Msgbox("Ocorreu um erro durante a transferência do arquivo  !", vbcritical)
        Baixa_versao = False
        Close#(1)
    End Function


    Public Function Verifica() As Boolean
        Dim Atual As Boolean
        Dim Versao As String
        Dim Versao_Atual As String
        Versao_Atual = App.Major & App.Minor & App.Revision

        Atual = False

        If Baixa_Versao("c:\versao\atual.txt", "http://www.geocities.com/macoratti/versao.txt") Then

        Open "c:\versao\atual.txt" for Input As #1
        Line Input #1 , Versao
        Close #1

            Versao = trim(Versao)

            Kill("c:\versao\atual.txt")

            If Versao <> "" And Versao_Atual < Versao Then
                Atual = Baixa_Versao("c:\versao\TEMP.EXE", "http://www.geocities.com/macoratti/seu_programa.exe")
            End If
        End If
        Verifica = Atual

    End Function


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


        Call Baixa_Versao("c:\teste\baixa.dat", "http://www.geocities.com/macoratti/teste.txt")


    End Sub
End Class

Category IT & Programming
Subcategory Desktop apps
What is the scope of the project? Small change or bug
Is this a project or a position? Project
I currently have I have an idea
Required availability As needed
Experience in this type of projects Yes (I have managed this kind of project before)
Required platforms Windows

Delivery term: September 10, 2016

Other projects posted by ALEXSANDRO V. D. S.