Adblock breaks this site

[help] Text File

Discussion in 'Programming General' started by dgameman1, Mar 30, 2008.

  1. demonavenger

    demonavenger Forum Addict
    $5 USD Donor

    Joined:
    Feb 25, 2007
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File

    Ok for starters, you have gotten the URL incorrect:
    its http://metherockers.googlepages.com/Version.txt

    and Second, you are supposed to have the major, the minor, and the revision numbers in the txt document. On the txt file its only got 0.3...


    -EDIT-
    I have tested this and it works...
    Code:
    If Inet1.OpenURL("http://metherockers.googlepages.com/Version.txt") > App.Major & "." & App.Minor Then wb.Navigate2 ("http://metherockers.googlepages.com/DGClient.zip")
    
    There i dont see why it shouldnt work.

    -EDIT2-
    I have succesfully downloaded your latest client..
    [​IMG]

    Your client needs some work.
     
  2. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File


    Lol ok and um for the actualy client.. the text and everything isnt supposed to be white, its supposed to be pink.. lol but w.e
     
  3. demonavenger

    demonavenger Forum Addict
    $5 USD Donor

    Joined:
    Feb 25, 2007
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File

    Lol? well all it has is the .exe file in it, if it has images and that, make sure to include them.
     
  4. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File

    lol all i did was instead of commands made labels and changed the back color to black and made the text highlite pink..I think thats the name
     
  5. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File

    SORRY FOR DOUBLE POSTING, WOULDNT ALLOW ME TO EDIT. SAID I DON'T HAVE PERMISSION
    Don't get it.. So im supposed to add it like this..

    Code:
    0.1
    0.2
    0.3
    
    ?
     
  6. Jazz00006

    Jazz00006 Apprentice
    Visual Basic Programmers

    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File

    Revision doesn't matter.

    And I think that this is the most trouble someones ever had with grabbing a value from a text file and comparing it :(
     
  7. superman1478

    superman1478 Apprentice

    Joined:
    Jan 21, 2007
    Posts:
    701
    Referrals:
    2
    Sythe Gold:
    0
    [help] Text File

    The correct format is 1.1.1 of course you can change the numbers depending on what version your currently at.
     
  8. demonavenger

    demonavenger Forum Addict
    $5 USD Donor

    Joined:
    Feb 25, 2007
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File

    The only reason about the revision is becuase the code before mine had the app major, minor and revision, i checked the txt document and found there was only 2 numbers, so i changed it so it would work..

    All you need pretty much is your major and your minor, revision causes to much trouble xD

    Yeah as i mentioned above.
     
  9. 0h n035

    0h n035 Active Member

    Joined:
    Feb 1, 2007
    Posts:
    163
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File

    Hmm... Well I have:

    Private Sub Form_Load()
    Dim versionCheck As Integer
    Version = 21
    versionCheck = Val(Inet1.OpenURL("http://www.shadowedlegion.com/Version.txt")) ' Sets our online file to integer
    If (versionCheck > Version) Then
    Unload Me
    Download.Show
    End Sub

    It's saying that the Version is 21. It then navigates to http://www.shadowedlegion.com/Version.txt. If the Version number there is higher than 21, it closes the form and opens up my download update form which is:

    Code:
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Const CCM_FIRST = &H2000
    Const CCM_SETBKCOLOR = (CCM_FIRST + 1)
    Const PBM_SETBKCOLOR = CCM_SETBKCOLOR
    Const WM_USER = &H400
    Const PBM_SETBARCOLOR = (WM_USER + 9)
    Private Sub cmdDownload_Click()
    pbDownload.Value = 0
    lblStatus.ForeColor = RGB(212, 208, 200)
    SendMessage pbDownload.hwnd, PBM_SETBARCOLOR, 0, ByVal RGB(212, 208, 200)
        lblStatus.Caption = "Status: Downloading Install.exe"
        DownloadFile "http://www.shadowedlegion.com/Install.exe", App.Path & "\Install.exe"
    SendMessage pbDownload.hwnd, PBM_SETBARCOLOR, 0, ByVal RGB(0, 155, 0)
    lblStatus.Caption = "Status: Complete!"
    lblStatus.ForeColor = RGB(0, 155, 0)
    If lblStatus.Caption = "Status: Complete!" Then
    Shell App.Path & "\Install.exe", vbNormalFocus
    End If
    For Each Frm In Forms
        Unload Frm
    Next
    End Sub
    Private Sub Form_Load()
        SendMessage pbDownload.hwnd, PBM_SETBARCOLOR, 0, ByVal RGB(212, 208, 200)
        SendMessage pbDownload.hwnd, PBM_SETBKCOLOR, 0, ByVal RGB(33, 33, 33)
    End Sub
    Sub DownloadProgress(intPercent As String)
        pbDownload.Value = intPercent ' Update file download progress
    End Sub
    'Public Function DownloadFile(strURL As String, strDestination As String) As Boolean
    Public Sub DownloadFile(strURL As String, strDestination As String) 'As Boolean
    Const CHUNK_SIZE As Long = 2048
    Dim intFile As Integer
    Dim lngBytesReceived As Long
    Dim lngFileLength As Long
    Dim strHeader As String
    Dim b() As Byte
    Dim i As Integer
    DoEvents
    
    With Inet1
        .URL = strURL
        .Execute , "GET", , "Range: bytes=" & CStr(lngBytesReceived) & "-" & vbCrLf
        While .StillExecuting
            DoEvents
        Wend
        strHeader = .GetHeader
    End With
    
    strHeader = Inet1.GetHeader("Content-Length")
    lngFileLength = Val(strHeader)
    DoEvents
    lngBytesReceived = 0
    intFile = FreeFile()
    
    Open strDestination For Binary Access Write As #intFile
        Do
            b = Inet1.GetChunk(CHUNK_SIZE, icByteArray)
            Put #intFile, , b
            lngBytesReceived = lngBytesReceived + UBound(b, 1) + 1
            DownloadProgress (Round((lngBytesReceived / lngFileLength) * 100))
            DoEvents
        Loop While UBound(b, 1) > 0
    Close #intFile
    End Sub
    

    Copy that and in the Form called 'Download', add:

    Inet1 (Inet)
    Label1 (Label) <-- Explaining that their version is out of date.
    lblStauts (Label With Text as "Status:")
    pbDownload (Progress Bar)
    cmdDownload (Button)
     
  10. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File

    lol how dunno how i ended up with this but it works but theirs just ONE more problem
    Code:
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    Private Sub cmdDownload_Click()
    WB.Navigate ("http://metherockers.googlepages.com/DGClient.zip")
    End Sub
    Private Sub Form_Load()
     lblVersion.Caption = "Current version is " & App.Major & "." & App.Minor & "." & App.Revision
    End Sub
    Public Sub GetVersionNumber()
    Dim bytes() As Byte
    Dim fnum As Integer
    Screen.MousePointer = vbHourglass
    DoEvents
    bytes() = Inet1.OpenURL( _
    "http://metherockers.googlepages.com/Version.txt", icByteArray)
    fnum = FreeFile
    Open "c:\Version.txt" For Binary Access Write As #fnum
    Put #fnum, , bytes()
    Close #fnum
    Screen.MousePointer = vbDefault
    Beep
    End Sub
    Public Sub OpenVersionNumber()
    rtfVersion.LoadFile "c:\Version.txt"
    End Sub
    Private Sub cmdCheckNow_Click()
    GetVersionNumber
    OpenVersionNumber
    Kill "c:\version.txt"
    End Sub
    
    Ok um it works fine but the lblVersion.Caption shows that the version is 1.0.0
     
  11. Jazz00006

    Jazz00006 Apprentice
    Visual Basic Programmers

    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File


    Someone please help him, he's failing harder then anyone I've seen before (Except maybe SG)

    Replace:
    Code:
     lblVersion.Caption = "Current version is " & App.Major & "." & App.Minor & "." & App.Revision
    With
    Code:
     lblVersion.Caption = "Current version is " & App.Major & "." & App.Minor
     
  12. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    [help] Text File

    ...
    Great thanks... It says now...

    "Your version is 1.0"
     
< Two extremely usefull RuneScape functions. | Download for Code::blocks IDE >


 
 
Adblock breaks this site