In this Tutorial I will show you how to update your applications using a xml file.
Using this system you will be able to update all your applications using a single xml file.
This method can be used both in C# & Vb.net.
I will be using VB.net.
Let's Start:-
1. First we need to create a xml File.
It can be created in any text editor(such as notepad).
Sample file is as below:-
:- Things you should know :-
1. The first line tells that the file is xml file and it's version and encoding and there are lot more things that you can put but its basic.
2. "<root> " & "<app>" are called nodes. It is compulsory to have atleast 1 node that is root(can be named differently), also there cannot be more then 1 root node so it is kind of necessery to create another node.
3. <root>&</root> are called tags. Every element has a starting tag(e.g. <root>) and a closing tag(e.g </root>)
4. Xml doesn't need any other kind of software to make or read or to play with.
5. Xml tags are case sensitive i.e. 'root' is not equal to 'Root' and 'dlUrl' is not equal to 'dlurl'.
:-About the File Above:-
1. We have created an app node. Under app node we have three item:- Appname, ver and dlUrl.
2. Our update system will read info from this items and check whether to update or not.
3. You can increase the no. of app nodes as you wish just remember to close the tags properly.(you must have an <app> & </app> for every application. You can name it anything but then you will have to change the code in the .net application also. So keep it simple for now.)
4. We are going to supply information about our application in the following way. Appname will contain the name of application, ver will contain the current ver available , and dlUrl will store the address of the update file.
Too much of XML stuff now lets move to Vb.net code:-
Code is really simple you can put it under the button_click event handler or make it a function.
I have put it under the click event handler.
[IMG]http://girlzlist.0fees.net/dm-10128729860215.png[/IMG]
[IMG]http://girlzlist.0fees.net/dm-712872986021.png[/IMG]
After this if your application has a newer version then it will ask the user to click the update button to download the file.
The link to the updated file will be stored in dlUrl variable.
I am not providing the code for that as it is very easy to do.
(Reason for posting images to make VB.noobs to learn how to write their own Programs.)
But still If you don't want to learn be my Guest and download the Sample project.(Read the Read Me!!.txt File for info)
At last a tutotrial that I think will be appriciated by HF!!
Thanks !!
Download:- http://www.filesonic.com/file/25491213/S...pdater.rar
PS:- Sorry for the bad formatting. Also if you have any queries post it here. Please try to keep the thread alive!!
Using this system you will be able to update all your applications using a single xml file.
This method can be used both in C# & Vb.net.
I will be using VB.net.
Let's Start:-
1. First we need to create a xml File.
It can be created in any text editor(such as notepad).
Sample file is as below:-
Code
<?xml version="1.0" encoding="utf-8" ?>
<root>
<apps>
<Appname>First Application</Appname>
<ver>1.0.0.1</ver>
<dlUrl>http://www.xyz.com/update.exe</dlUrl>
</apps>
<apps>
<Appname>Second Application</Appname>
<ver>2.0.5.86</ver>
<dlUrl>http://www.xyz.com/application2/update.rar</dlurl>
</apps>
</root>:- Things you should know :-
1. The first line tells that the file is xml file and it's version and encoding and there are lot more things that you can put but its basic.
2. "<root> " & "<app>" are called nodes. It is compulsory to have atleast 1 node that is root(can be named differently), also there cannot be more then 1 root node so it is kind of necessery to create another node.
3. <root>&</root> are called tags. Every element has a starting tag(e.g. <root>) and a closing tag(e.g </root>)
4. Xml doesn't need any other kind of software to make or read or to play with.
5. Xml tags are case sensitive i.e. 'root' is not equal to 'Root' and 'dlUrl' is not equal to 'dlurl'.
:-About the File Above:-
1. We have created an app node. Under app node we have three item:- Appname, ver and dlUrl.
2. Our update system will read info from this items and check whether to update or not.
3. You can increase the no. of app nodes as you wish just remember to close the tags properly.(you must have an <app> & </app> for every application. You can name it anything but then you will have to change the code in the .net application also. So keep it simple for now.)
4. We are going to supply information about our application in the following way. Appname will contain the name of application, ver will contain the current ver available , and dlUrl will store the address of the update file.
Too much of XML stuff now lets move to Vb.net code:-
Code is really simple you can put it under the button_click event handler or make it a function.
I have put it under the click event handler.
[IMG]http://girlzlist.0fees.net/dm-10128729860215.png[/IMG]
[IMG]http://girlzlist.0fees.net/dm-712872986021.png[/IMG]
After this if your application has a newer version then it will ask the user to click the update button to download the file.
The link to the updated file will be stored in dlUrl variable.
I am not providing the code for that as it is very easy to do.
(Reason for posting images to make VB.noobs to learn how to write their own Programs.)
But still If you don't want to learn be my Guest and download the Sample project.(Read the Read Me!!.txt File for info)
At last a tutotrial that I think will be appriciated by HF!!
Thanks !!
Download:- http://www.filesonic.com/file/25491213/S...pdater.rar
PS:- Sorry for the bad formatting. Also if you have any queries post it here. Please try to keep the thread alive!!


