Post: [Tutorial]How To Add An Update Button To Your C# Tool[Tutorial]
06-16-2014, 03:26 AM #1
ProGoHard
Pokemon Trainer
(adsbygoogle = window.adsbygoogle || []).push({});
Hey Guys!

Well Im Making A Tutorial About This Because I Had A Problem With It For A While And I Figured Out How To Do It So Im Pretty Sure Many People Need This And Cant Find A Proper Tutorial

First: You Need A Server So With FTP Access, So I Suggest You must login or register to view this content.

- Once You Sign Up On x10Hosting.com On The Top Right Your Going To See An Option That Says "Switch To cpanelx3" Click On It And Hit Yes To Switching To cpanelx3 And Then You'll be Asked To Sign In Once Again. Once You Sign In Again You Will Be Taken To A New Looking Page. In This Page In The Second Sorting Group From The Top Named "Files"

You must login or register to view this content.

You Will Click On "File Manager"

You must login or register to view this content.

Then This Little Window Will Pop Up, Just Click "Go"

You must login or register to view this content.

Now After You Hit "Go" You Will Go To This New Page:

You must login or register to view this content.

You Will Hit "New Folder" On The Top Left And You Will Name This Folder "Updates"

You must login or register to view this content.

Now Once You Create This New Folder You Will Go To It By Searching For The Directory In The Top Left And Put "public_html/Updates" Then Hit Go

You must login or register to view this content.

Now Once You Go Here You Will First Create A New File By Hitting The "New File" Button On The Top Left

You must login or register to view this content.

Name The New File "Version.txt"

You must login or register to view this content.

Now Once You Do This A New File Will Pop Up Click it Once Then Hit Edit On The Top Middle

You must login or register to view this content.

Now Once You Hit Edit A New Window Will Come Up And You Will Write In This Window "1.0.0.0" And Then Hit Save

You must login or register to view this content.






Second: Now Lets Work On The Coding Part

- First Drag A "saveFileDialog" onto your tool
- Then Put A New Button Somewhere In Your Tool
- Double Click It To Be Able To Code It

First Add This To Your Tool:
    using System.Net;
using System.IO;

- Now Somewhere in Your Tool Put This Code:

    
public readonly string Version = "1.0.0.0";

public string getVersion()
{
return Version;
}

public void Updater()
{
string URL = "https://yoursite.x10.mx/Updates/";//put the url of your site here
string appName = "FileName.Rar";//Name of your file on the site
string serverVersion;
string serverVersionName = "Version.txt";//Name Of The Version Text Document

WebRequest req = WebRequest.Create(URL + serverVersionName);
WebResponse res = req.GetResponse();
Stream str = res.GetResponseStream();
StreamReader tr = new StreamReader(str);
serverVersion = tr.ReadLine();

if (getVersion() != serverVersion)
{
WebClient client = new WebClient();
byte[] appdata = client.DownloadData(URL + appName);

if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
using (FileStream fs = File.Create(saveFileDialog1.FileName))
{
fs.Write(appdata, 0, appdata.Length);
}
MessageBox.Show("You File Has Been Download To:\n" + saveFileDialog1.FileName + "\nDownload Complete!");//this comes up after you have downloaded the new update
}
}
else
{
MessageBox.Show("No Updates Are Currently Available.", "No Updates Found", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);//This message box pops up if you have no updates available
}
}


Now Put This Inside The Button You Made To Check For Updates:
    Updater();


Third: Now Save All This Work And Add The File To A Rar File Named The Same As You Named It In The appName Code.

- Once You Create The Rar File, Go Back To Site Update Directory On Your Site And Your Going To Hit "Upload" On The Top Left

- Then Click Upload File, Choose The File, Upload It, And BAM Finished!


Final: When You Update Your Tool Again, Change The Version Number In The Tool To Match The One On The Site And Then Upload Your New Updated Tool In Its Rar File With The Same appName As Last Time!

Done! Happy If You Guys Still Need Any Help Just Ask!!
[/b]
(adsbygoogle = window.adsbygoogle || []).push({});

The following 2 users say thank you to ProGoHard for this useful post:

M4K3VELi7-, NotALegitPlayer
06-16-2014, 05:01 PM #2
Xcesar1911X
Who’s Jim Erased?
why is this on the "PS4" cheats customization and not the "PS3" cheats customization ?
good tutorial doe
06-16-2014, 06:26 PM #3
ProGoHard
Pokemon Trainer
Whoops Sorry, I Thought This Was On Ps3, :O Someone Move It Please Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo