[COLOR="#800000"]بالنسبه لمثالي لنفترض عندك صفحة نصية محتوياتها
السطر الاول الذي تضع فيه احدث نسخه لديك
والسطر الثاني تضع فيه رابط احدث نسخه
نجي على المقارنه[/COLOR]
وللتحقق ضع الكود التالي في زر بوتون مثلآ
وبالنسبه لتبديل النسخه اعتقد يجب ارفاق ملف يتكفل بها وطريقة استدعاه تكون في الحدث DownloadFileCompleted التابع للأداة WebClient
كود :
1001
www.new.comوالسطر الثاني تضع فيه رابط احدث نسخه
نجي على المقارنه[/COLOR]
كود :
Dim WithEvents web As New Net.WebClient
Private Sub Chek()
Try
Dim txt As String = web.DownloadString("رابط الصفحه النصية")
If CInt(txt.Split(vbNewLine)(0)) > CInt(Application.ProductVersion.Replace(".", "")) Then
If MsgBox("هناك نسخه احدث " & txt.Split(vbNewLine)(0) & " تحميل", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, "تحميل النسخه المحدثه") = MsgBoxResult.Yes Then
Download(txt.Split(vbNewLine)(1), "D:\")
End If
End If
Catch ex As Exception
End Try
End Sub
Private Sub Download(ByVal url As String, ByVal path As String)
web.DownloadFile(url, path)
End Subكود :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call Chek()
End Sub
