|
-
Feb 11th, 2003, 04:46 PM
#1
Thread Starter
Hyperactive Member
Update my app from my website
Ok, this is what I would like to do for a future version of the VBCodeBook.NET, but i'm not sure how:- Have a textfile on my site called "Update.txt"
- In the text file have just two lines: a main program version and codepack version (e.g: "2.0" and "12").
- User selects "Update" from a menu
- App looks at a set Http:// path for the file "Update.txt"
- Loads / Reads the text file and checks each line against a hard coded version number of the app and Codepack.
- If any are different, tell the user there's an update available.
Is this possible?
Go on, I dare you!
-
Feb 11th, 2003, 04:55 PM
#2
Hyperactive Member
Ofcorse its possible 
Only don't got an example here, maby i will try to fix something later tonight
There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me
-
Feb 11th, 2003, 05:04 PM
#3
Re: Update my app from my website
Originally posted by RealNickyDude
Ok, this is what I would like to do for a future version of the VBCodeBook.NET, but i'm not sure how:- Have a textfile on my site called "Update.txt"
- In the text file have just two lines: a main program version and codepack version (e.g: "2.0" and "12").
- User selects "Update" from a menu
- App looks at a set Http:// path for the file "Update.txt"
- Loads / Reads the text file and checks each line against a hard coded version number of the app and Codepack.
- If any are different, tell the user there's an update available.
Is this possible?
Go on, I dare you!
umm the new installshield has an update feature. That is, if you are willing to buy it
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 11th, 2003, 05:13 PM
#4
Thread Starter
Hyperactive Member
You're right, it does (I have an old, but free-off-a-mag version), but that means the updates are installer specific. What happens if the user hasn't downloaded the installer version?
If possibe, I would like to do it within VB so no matter how it's downloaded, all can use the update service.
-
Feb 11th, 2003, 05:31 PM
#5
Fanatic Member
Here's the code using Windows Sockets that will actually retreive the text contents of the file from the internet...
VB Code:
Imports System.Net
Imports System.Net.Sockets
Dim sckClient As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
Dim EP As IPEndPoint
Dim strRequestedPage As String
'Create New Endpoint based on the server we're accessing
EP = New IPEndPoint(Dns.Resolve("www.famousplayers.com").AddressList(0), 80)
'Connect to the EndPoint
sckClient.Connect(EP)
'Create a byte array, and create an http GET request for the specific page we want
Dim httpSend() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes("GET [url]http://www.famousplayers.com/showtime_search_result.asp?tCity=Windsor&tDate=[/url]" & dteTheDate.ToShortDateString & "&tTheatre=499&tMovie=" & vbCrLf)
'Send the actual HTTP request
sckClient.Send(httpSend)
'Loop Until data is received
Do
If sckClient.Poll(1, SelectMode.SelectRead) = True Then
'Create a new byte array sized from the socket's available data
Dim recText(sckClient.Available) As Byte
'Fill the byte array with received data
sckClient.Receive(recText)
'Fill a variable with the requested page. We converted Bytes into ascii readable text
strRequestedPage = System.Text.ASCIIEncoding.ASCII.GetString(recText)
'We received the data so we can now exit the loop
Exit Do
Else
'Data not ready, so sleep for a millisecond so the program does not lock up
Threading.Thread.Sleep(1)
End If
Loop
' Shutdown and Close the socket. You must always do this
sckClient.Shutdown(SocketShutdown.Both)
sckClient.Close()
After that, the rest is simple string manipulation... shouldn't be hard... it would be cool if you made it automatically download the update itself... that would be more work, but at least with this, you could recognize that a new update is available, and even open up a browser to the download page... that might be the easiest and least intrusive method
-
Feb 11th, 2003, 05:49 PM
#6
Thread Starter
Hyperactive Member
Thanks,
VB Code:
'Create a byte array, and create an http GET request for the specific page we want
Dim httpSend() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes("GET [url]http://www.famousplayers.com/showti...=Windsor&tDate=[/url]" & dteTheDate.ToShortDateString & "&tTheatre=499&tMovie=" & vbCrLf)
Would you put your own path to the text file here?
E.g:
VB Code:
Dim httpSend() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes("GET [url]http://www.mywebsite.co.uk/updatefolder/updatetest.txt[/url]" & vbCrLf)
and does the entire code (apart from the Imports) go into a Private Sub, ready to be called?
-
Feb 11th, 2003, 08:48 PM
#7
PowerPoster
Here is a link that will allow you to do what you want.
http://msdn.microsoft.com/msdnmag/is...S/default.aspx
-
Feb 12th, 2003, 01:39 PM
#8
Sleep mode
Does XML support what you are trying to do ??? If so then it's nice to go for it !
-
Sep 28th, 2003, 03:23 PM
#9
New Member
updater
I have a app you can use for such a job
Download LiveUpdater
If the source isn't in the zip file ask me and I shall send it to you.
Russ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|