Automatic detection version number and update app

when user start program,the program automatically detects whether a new version.Now I want to know how to get the version number from the server.

Use WWW.