You are viewing our Forum Archives. To view or take place in current topics click here.
Anybody good with Vb? ***HELP***
Posted:

Anybody good with Vb? ***HELP***Posted:

Grenade_Hacks
  • New Member
Status: Offline
Joined: Sep 04, 201311Year Member
Posts: 9
Reputation Power: 0
Status: Offline
Joined: Sep 04, 201311Year Member
Posts: 9
Reputation Power: 0
Hey guys so im making a auto updater for this skype tool i have and i followed the auto update tut all the way but im getting this stupid error and its driving me nuts because of these 2 little letters i cant debug or run my program at all!

please look at this and tell me what needs edited!

[ Register or Signin to view external links. ]

 Public Sub CheckForUpdates()

        Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("your txt file link here")
        Dim response As System.Net.HttpWebResponse = request.GetResponse()
 Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
        Dim newestversion As String = sr.ReadToEnd()
        Dim currentversion As String = Application.ProductVersion
        If newestversion.Contains(currentversion) Then
            MsgBox("You are up todate :D")
        Else : MsgBox("There is a new update we will download it now for you.")
            System.Diagnostics.Process.Start("New link")
        End If
    End Sub


if you could contact me on here or on my skype (xmsmoke)
it would help me out alot thanks guys!
#2. Posted:
5FDP_Jekyll
  • E3 2017
Status: Offline
Joined: May 27, 201113Year Member
Posts: 2,048
Reputation Power: 100
Status: Offline
Joined: May 27, 201113Year Member
Posts: 2,048
Reputation Power: 100
Just simply adding your code into a scratch program there seems to be no error that I see, Could you maybe add a little more info into your topic such as the GUI of the program or maybe your entire code of the program?
#3. Posted:
Imp
  • Retired Staff
Status: Offline
Joined: Jan 01, 201113Year Member
Posts: 1,957
Reputation Power: 401
Status: Offline
Joined: Jan 01, 201113Year Member
Posts: 1,957
Reputation Power: 401
Right I can see what the problem is, and may i also give some advice.

It is not normally good practice (in Visual Basic) to Initialize and Instantiate an object in one line, so my guess is this was some bad conversion of C#, which it is standard practice.

Back to the problem, re-writing how i would make the code


Public Sub CheckForUpdates()

        Dim request As System.Net.HttpWebRequest
        Dim response As System.Net.HttpWebResponse
        Dim sr As System.IO.StreamReader
        Dim newestversion As String
        Dim currentversion As String

        request = System.Net.HttpWebRequest.Create("your txt file link here")
        response = request.GetResponse()
        sr = New System.IO.StreamReader(response.GetResponseStream())
        newestversion = sr.ReadToEnd()
        currentversion = Application.ProductVersion
 
        If newestversion.Contains(currentversion) Then
            MsgBox("You are up todate :D")
        Else
            MsgBox("There is a new update we will download it now for you.")
            System.Diagnostics.Process.Start("New link")
        End If
    End Sub


Please note, I have not tested this, but if this doesnt work, then remove the New from the sr = New System.IO.... line
#4. Posted:
-Dench-
  • Prospect
Status: Offline
Joined: Sep 30, 201113Year Member
Posts: 639
Reputation Power: 27
Status: Offline
Joined: Sep 30, 201113Year Member
Posts: 639
Reputation Power: 27
Declare all the variables at the top and work through like what IMP said.

Try and keep it clean so its easier to code.
#5. Posted:
ZombiesAllDay17
  • New Member
Status: Offline
Joined: Aug 28, 201311Year Member
Posts: 8
Reputation Power: 0
Status: Offline
Joined: Aug 28, 201311Year Member
Posts: 8
Reputation Power: 0
There is a way you can incorporate dropbox to do it. It's not easy, but it's efficient
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.