تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مساعدة في عمل تحديث البرنامج
#3
Photo 
(13-07-22, 03:06 PM)asmarsou كتب : و عليكم السلام ورحمة الله و بركاته
قد يوحي لك الموضوغ  في الرابظ التالي بفكرة ما لم يكن  بعينه ما تنشده
https://www.codeproject.com/Articles/115...-in-VB-NET

بارك الله فيك لكنلم يشتغل لي اريد تديث تلقائي عبر dropbox وشكرا لك

كود :
Public Sub CheckForUpdates()
       Dim file As String = Application.StartupPath & "/version.txt"
       Dim MyVer As String = My.Application.Info.Version.ToString
       If My.Computer.FileSystem.FileExists(file) Then
           My.Computer.FileSystem.DeleteFile(file)
       End If
       'CHANGE SITE WITH YOUR OWN! Example Dropbox 'WARNING IF YOU SHARE YOUR DROPBOX LINK YOU GET THIS :
       'https://www.dropbox.com/s/xxxxxxxxxxxx/version.txt?dl=0 'CHANGE ?dl=0 to ?dl=1!!!!!! OTHERWISE IT WONT WORK!
       Try
           My.Computer.Network.DownloadFile("https://www.dropbox.com/s/xxxxxxxxxxxx/version.txt?dl=1", file)
       Catch ex As Exception
           MsgBox(ex.Message + " Can''t Check for updates")
       End Try
       Dim LastVer As String = My.Computer.FileSystem.ReadAllText(file)
       If MyVer < LastVer Then
           MsgBox("Update Available")
           'CHANGE SITE WITH YOUR OWN! Example Dropbox again! 'WARNING IF YOU SHARE YOUR DROPBOX LINK YOU GET THIS :
           'https://www.dropbox.com/s/xxxxxxxxxxxx/program.exe?dl=0 'CHANGE ?dl=0 to ?dl=1!!!!!! OTHERWISE IT WONT WORK!
           Try
               My.Computer.Network.DownloadFile("https://www.dropbox.com/s/xxxxxxxxxxxx/program.exe?dl=1", Application.StartupPath + "/program.exe")
           Catch ex As Exception
               MsgBox(ex.Message + " Error Downloading update.")
           End Try
           Process.Start(Application.StartupPath + "/program.exe") 'It will run the update after downloading the file!
       Else
           MsgBox("Program is up to date")
       End If
   End Sub

   Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
       'Simply add here CheckForUpdates()
       CheckForUpdates()
       'Now it wil check for updates when you click on the button.
   End Sub
   
   Private Sub Form1_loading(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
       CheckForUpdates()
   End Sub

اريد لو تكرمتم تعديل على هذا الكود
عند التحديث يقول لي البرنامج موجود في المجلد ولا استطيع التحديث

[صورة مرفقة: p_2385kb99j1.png]
الرد }}}
تم الشكر بواسطة: asmarsou , ابراهيم ايبو , سعود


الردود في هذا الموضوع
RE: مساعدة في عمل تحديث البرنامج - بواسطة crazykinko - 13-07-22, 03:16 PM


التنقل السريع :


يقوم بقرائة الموضوع: