04-10-18, 01:57 AM
السلام عليكم ورحمة الله وبركاته
كنت محتاج تعديل بسيط في كود تحديث
اولا عايز اخفي Label1 لما ميكنش فيه تحديث
ثانيا لو مفيش تحديث يعرض ليا تلقائي فورم
ScreamAct
ويقفل الفورم اللي موجود
الكود المستخدم
كنت محتاج تعديل بسيط في كود تحديث
اولا عايز اخفي Label1 لما ميكنش فيه تحديث
ثانيا لو مفيش تحديث يعرض ليا تلقائي فورم
ScreamAct
ويقفل الفورم اللي موجود
الكود المستخدم
كود :
Imports System.Net
Public Class ScreamUPdate
Dim WEB_ As New WebClient
Dim Process_() As Process = Process.GetProcessesByName("ScreamSport1") ' Name file your program
Dim VProject As Integer = WEB_.DownloadString("E:\Programs\Scream Sport\v.txt") ' You can use link Example: http://www.mysite.com/file.txt (Link Direct...)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
PictureBox1.Visible = False
If VProject > My.Settings.VProject Then
Label1.Text = "Download The New Version"
PictureBox1.Visible = True
End If
End Sub
Private Sub PictureBox1_Click(sender As Object, e As EventArgs)
If VProject > My.Settings.VProject Then
If Process_.Count > 0 Then
For Each MyProject_ In Process_
MyProject_.Kill() ' Close Your Project.
Next
GoTo GoDownlod_
Else
GoDownlod_:
WEB_.DownloadFileAsync(New Uri("E:\Programs\Scream Sport\ScreamSport1.exe"), Application.StartupPath & "\ScreamSport1.exe", True) ' You can use link Example: http://www.mysite.com/File.exe (Link Direct...)
My.Settings.VProject = VProject
My.Settings.Save()
MsgBox("تم تحديث البرنامج.")
Process.Start(Application.StartupPath & "\ScreamSport1.exe") ' Open Your Project After Finish Update.
Application.Exit()
End If
End If
End Sub
End Class