Make your program listen to a socket. Whenever a client connects to the socket end sends 'Please tell me what version you are' send back something like '1.0' or '99.3'.
Serious, not much information you give us here. What program? Command line? GUI? Or do you mean you want the build process automatically increase the version number?
Bookmarks