INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Get Current Version Sample (VB6)  (Read 2492 times)

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Get Current Version Sample (VB6)
« on: July 06, 2003, 06:19:11 am »

More Sample Code

This Sub Will Check Your Web Site For The Current Version File, And Download It, And Compare It Against The Version The User Is Using And Let Them Know There Is A Newer Version.

Private Sub GetVersion()
   On Error GoTo MyError
   ' Set Up Link To Current Version File '
   Dim MyLatestVersionFile As Variant
   MyLatestVersionFile = "http://home.nc.rr.com/mycddblookup/images/MC9-ArtistBiosFinderVersion.Txt"
   ' Set Up Get MC9 Version '
   Dim MJVersion As MJVersionAutomation
   Set MJVersion = g_MJ.GetVersion
   ' Check For The Lowest Version You Want This To Work On '
   If MJVersion.Version < "9.0.180" Then
       MsgBox ("MC Version: (" & MJVersion.Version) & ") Is Too Low And Will Not Work Correctly, You Must Upgrade MC9!"
       Exit Sub
   Else
       ' Lets Go Get The Current Version Of This Program '
       Dim MJIA As MediaJukebox.MJInternetAutomation
       Set MJIA = g_MJ.GetInternet
       MJIA.DownloadMode = DOWNLOAD_MODE_NO_UI
       ' Get The Latest Version File '
       TempFile = MJIA.DownloadToTempFile(MyLatestVersionFile)
       ' Did We Get The File? '
       If TempFile <> "" Then
           ' I'm Lazy So Just Load The File Into The RTB '
           RichTextBox1.FileName = TempFile
           ' Delete The Temp File '
           Kill (TempFile)
           ' Compare The Version Against What Your Running '
           If RichTextBox1.Text > App.Major & App.Minor & App.Revision Then
               ' There Is A Newer Version Of Program Show The User This Msg '
               MsgBox ("There Is A Newer Version Of This Program Available For Download.")
           Else
               ' If The User Wants To Know If They Have The Newest Version '
               ' Show Them, If Not Keep Your Mouth Shut                    '
               If Check1(2) Then
                   MsgBox ("You Have The Newest Version Of This Program.")
               End If
           End If
       Else
           ' If Check And Internet Error Downloading File '
           ' Show This Message To The User                '
           If Check1(3) Then
               MsgBox ("There Was An Error Getting The Current Version Number..." & vbCrLf & "Reasons: The Web Site May Be Down Or Your Not Connected To The Internet.")
           End If
       End If
   End If
MyError:
End Sub


'Never You Done That' Charted At 01 In 1980

Listening to: 'Never You Done That' from 'All The Rage' by 'General Public' on Media Center 9.1
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA
Pages: [1]   Go Up