Sugerir un método para actualizar automáticamente mi programa C #
I'm sorry if this question has been asked already. i have a problem whit online update because i don't know how can add code for check for update program and after check if find newer version upgrade itself.
However, every time I make changes to the program people will have to download the new version.
i have a host and no any problem whit host. well only i need add code for check for online update
how can add code for check for update when open program ? what can i do ? what do i do ? can u please help me ?
Por favor give me sample code or sample project for understand. thanks.
preguntado el 08 de noviembre de 11 a las 13:11
¿Has mirado el ClickOnce technology? This is automatically built-in to either
1) not check for updates
2) check for updates before the application starts or
3) check for updates after the application finishes.
It's a great way to circumvent your issues, and it's easy to implement.
Or if you want to manually do this, utilize the
System.Reflection espacio de nombres y use el
Assembly.GetExecutingAssembly().GetName().Version property to get the application's version. Then do whatever conditional comparison you need to do to see if that's the newest version, and if not then update the application.
When I wanted to implement something like this I made it really simple.
I downloaded a xml configuration file, parsed the file, and if xml document contained an update my program would download the file from my website. I broke up the xml document into files. Since you are able to get the version of assembly this was an effective way of doing it.
Since you have not even attempted to do it I will leave actually doing it as an exercise for you.