Post: [C#] Need Help With Update Button
06-30-2013, 06:30 PM #1
MrSpliiffy
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); i Need Help
Does Anyone Know How to add a Update Button to a application C'Sharp ?
Saves Me To keep Posting Same Application Over and over if You Can Help Add My Skype mrspliiffymodz

Cheers Smile
Last edited by MrSpliiffy ; 06-30-2013 at 06:32 PM.
07-19-2013, 04:54 PM #11
Originally posted by Pichu View Post
No credit needed. I just put the stuff out there to help others. When I was learning C# I didn't really have much tutorials, snippets, etc to work off of so I had to go about the hard way.


Yh I also usually learn by myself :P
I also had another update method but this is better.
Mine was
upload a file called verify.txt to DropBox and create a FTP Server.
on Form_Load it downloaded the verify.txt and read the first 5 chars (1.0.0 or whatever) and if it was different from the current app version it would ask if you wanted to download and then I just had to kept a file with the same name on my FTP Server but this one is better Happy
07-19-2013, 05:07 PM #12
Pichu
RIP PICHU.
Originally posted by MW2TopTenWORLD View Post
Yh I also usually learn by myself :P
I also had another update method but this is better.
Mine was
upload a file called verify.txt to DropBox and create a FTP Server.
on Form_Load it downloaded the verify.txt and read the first 5 chars (1.0.0 or whatever) and if it was different from the current app version it would ask if you wanted to download and then I just had to kept a file with the same name on my FTP Server but this one is better Happy


Well, I'm going to work on on a newer version of this which is going to be even better as well as more efficient. I'll post that here and on my site when I do it.
07-19-2013, 05:12 PM #13
Originally posted by Pichu View Post
Well, I'm going to work on on a newer version of this which is going to be even better as well as more efficient. I'll post that here and on my site when I do it.


Cool Happy Il check it out.
07-21-2013, 06:06 PM #14
Originally posted by MrSpliiffy View Post
i Need Help
Does Anyone Know How to add a Update Button to a application C'Sharp ?
Saves Me To keep Posting Same Application Over and over if You Can Help Add My Skype mrspliiffymodz

Cheers Smile


This is what I do and it's relatively easy.

In your form one class. Define the build version.

    
const double app_ver = 1.0;


Then in your update func
    
private void update_app()
{
double new_ver = Convert.ToDouble(new StreamReader(new WebClient().OpenRead("https://yoursite.com/version.txt")).ReadToEnd());
if( app_ver < new_ver )
System.Diagnostics.Process.Start( "https://yoursite.com/release.zip" );
}


Where yoursite.com/version.txt is a txt file with text in it like "1.1", and relase.zip is your latest build of your application.

Simply to update just change version.txt and upload release.zip to a server. Pretty easy and what I do :p
Last edited by Jakes625 ; 07-21-2013 at 06:09 PM.
07-21-2013, 07:26 PM #15
Pichu
RIP PICHU.
Originally posted by Jake625 View Post
This is what I do and it's relatively easy.

In your form one class. Define the build version.

    
const double app_ver = 1.0;


Then in your update func
    
private void update_app()
{
double new_ver = Convert.ToDouble(new StreamReader(new WebClient().OpenRead("https://yoursite.com/version.txt")).ReadToEnd());
if( app_ver < new_ver )
System.Diagnostics.Process.Start( "https://yoursite.com/release.zip" );
}


Where yoursite.com/version.txt is a txt file with text in it like "1.1", and relase.zip is your latest build of your application.

Simply to update just change version.txt and upload release.zip to a server. Pretty easy and what I do :p


You don't even need to define a const variable as you are able to get the build info, etc.

There are lots of ways to do this; I prefer XML files for structural purposes. ^_^
07-21-2013, 07:44 PM #16
Originally posted by Pichu View Post
You don't even need to define a const variable as you are able to get the build info, etc.

There are lots of ways to do this; I prefer XML files for structural purposes. ^_^


true but it takes less code lol. Up to the OP. It's his app after all
07-21-2013, 08:25 PM #17
Pichu
RIP PICHU.
Originally posted by Jake625 View Post
true but it takes less code lol. Up to the OP. It's his app after all


Well, I've gotta correct the code because it only reads 1 item in the xml or else it produces an error. I'm rewriting it so that you can put, say... 10 program information in a single XML so you just have to work with that one rather than 10 text files. :P
07-21-2013, 11:13 PM #18
Originally posted by Pichu View Post
Well, I've gotta correct the code because it only reads 1 item in the xml or else it produces an error. I'm rewriting it so that you can put, say... 10 program information in a single XML so you just have to work with that one rather than 10 text files. :P


Here you go man. They already have a class for that.

You must login or register to view this content.
07-21-2013, 11:52 PM #19
Pichu
RIP PICHU.
Originally posted by Jake625 View Post
Here you go man. They already have a class for that.

You must login or register to view this content.


Xml Linq is so nice, ^_^

The following user thanked Pichu for this useful post:

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo