I just want to create an application where the user click on the "check for Update" button,
My application start to check update.
Uptill this I hav done so.
I use this Code for this:

        Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("pastebin link")
        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("Application is up to date:" & vbNewLine & "Latest Version :  --" & vbNewLine & "Current Version :  --", MsgBoxStyle.Information, "Update Msg.")
        Else
            MsgBox("Update available," & vbNewLine & "Visit to our website to download newer version", MsgBoxStyle.Information, "Update msg")
        End If

now this compare the Characters, If Differnce found Update available else not...
But If I add the link on my pastebin on 3rd line, and then is this possible that my updater app just check the first line.
And if update available then:
msg("update found," & vbnewline & "Want to Download?",vbmsgboxstyle.yesno,"msg")
If yes then start download from the link paste on 3rd line of same link.

I wanna try this but when I add the 3rd line it's says that Update available even though not so Please help me with this.
Please

Recommended Answers

if you want to read online text file as for updater...
then I will like to say you that you can update your application with the link specifies in the text document...
As you are creating your application so obviously you are going to type the text in text document …

Jump to Post

All 3 Replies

let me tell this in short:
I want to know How can I make the application that can read onlinme text file?
and seperate lines.

if you want to read online text file as for updater...
then I will like to say you that you can update your application with the link specifies in the text document...
As you are creating your application so obviously you are going to type the text in text document (version) so From now you can do this:L
give a specific title as update version to your text document.
on the First Line type your version and on the last line (i.e. 2) type the Download Link. (just direct download link)

now what you have to do changes in your app is Instead of watching/Reading version online let the app should download the text document... (as the text documet having only version and link so size of this file will be 1kb or 2kb max) so your file will downlaod soon...

Then After let the application run the File... (create new form invisible)
add two textbox. :- the first will work as for version and the secondly will work as for download location...

type the code on form_Load event:

Dim i as String
i = my.application.info.version
dim m as DialogResult
m = Msgbox("Like to update your application?",msgboxstyle.yesno,"Update")

'now 1st of all your application will check whether the textbox1.text = version or not:

if textbox1.text <> i then
 if m.msgboxresult.yes then
     process.start(textbox2.text)
 Else
     'do nothing
 end if

if you having the question that how you can read the first and last line of textbox then the code is here:

Dim lines() As String = IO.File.ReadAllLines(my.aplication.info.directorypath & "\textfile.txt")
TextBox1.Text = lines(0)
TextBox2.Text = lines(lines.Length - 1)

@Deep Modi:
Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.