LG Updater:
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Security.Cryptography;
using System.Threading;
using System.Diagnostics;

namespace LogicalUpdater
{
    public partial class frmMain : Form
    {
        String AppName = ""; // This is the name of the main application.
        String UpdateDir = ""; // The url containing files and tasks.php

        public frmMain()
        {
            InitializeComponent();
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            HTTPWrapper Wrapper = new HTTPWrapper();
            String[] Files = Wrapper.get(UpdateDir + "tasks.php").Split('|');
            for (int i = 0; i < Files.Length; i++)
            {
                String[] Data = Files[i].Split('-');
                if (File.Exists(Application.StartupPath + @"\" + Data[0]) && MD5Checksum(Application.StartupPath + @"\" + Data[0]) != Data[1] || !File.Exists(Application.StartupPath + @"\" + Data[0]))
                {
                    TextWriter Handle = new StreamWriter(Data[0]);
                    Handle.Write(Wrapper.get(UpdateDir + Data[0]));
                    Handle.Close();
                }
            }
            if (File.Exists(Application.StartupPath + @"\" + AppName))
            {
                Process.Start(Application.StartupPath + @"\" + AppName);
                Environment.Exit(0);
            }
        }

        public String MD5Checksum(string FileName)
        {
            FileStream Handle = new FileStream(FileName, FileMode.Open);
            byte[] Return = new MD5CryptoServiceProvider().ComputeHash(Handle);
            Handle.Close();

            StringBuilder SB = new StringBuilder();
            for (int i = 0; i < Return.Length; i++)
            {
                SB.Append(Return[i].ToString("x2"));
            }
            return SB.ToString();
        }
    }
}
Tasks.php
Code:
<?php
    $Handle = opendir("./");
    $Dump = "";
    while ($File = readdir($Handle)) {
        if ($File != "." && $File != ".." && $File != "tasks.php") {
            $Dump .= ($File . '-' . md5(file_get_contents($File)) . '|');
        }
    }
    closedir($Handle);
    echo rtrim($Dump, '|');
?>
HTTPWrappers are needed for this to function, there are located here, what this does is read all the files on your webserver and either updates the current files or create new ones.

This is a separate application from your main program. Something like Updater.exe, they run this program to launch or update their files.

To set it up put tasks.php on your webserver then set UpdateDir to your web url where tanks.php is located, make sure to chmod all files to 777 and that all files in that directory you want on your users pc.

Also set AppName to the exe of the main program (ex "BootyCollector.exe".)

To make your application or program automatically launch LGUpdater have it use Process.Start("Updater.exe"); then exit the program Environment.Exit(0);


For example if you want to have a user update the files "Fail.txt" and "Main.exe"
You will create a directory (ex "/fun/"),
Add tasks.php to that file along with "Fail.txt" and "Main.exe"
So in /fun/ you will have 3 files. Then set UpdateDir to your url including the file (ex http://exmaple.com/fun/) and set AppName to "Main.exe"

So for now on if you run the Updater.exe it will update all the files in their local folder to the files on your website and then run Main.exe and close.