Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8583871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:38:18+00:00 2026-06-11T21:38:18+00:00

I tried to do an application, that can do auto updates. But it’s not

  • 0

I tried to do an application, that can do auto updates. But it’s not working.

Code of the main “Patched” app:

private void Patch()
{
        using (WebClient client = new WebClient())
        {
            string name = "asd681648.txt";
            client.DownloadFile("http://mypage/patches/" + "Graph" + ".txt", @"C:\" + name);
            string text = File.ReadAllText(@"C:\" + name);
            File.Delete(@"C:\" + name);
            string[] version = text.Split('.');
            string[] sVersion = set.ver.Split('.');
            for (int i = 0; i < version.Length; i++)
            {
                if (int.Parse(version[i]) > int.Parse(sVersion[i]))
                {
                    MessageBox.Show("New version will be downloaded!");
                    Process.Start(Environment.CurrentDirectory + "\\Patcher.exe", "Graph "+set.ver+" "+Environment.CurrentDirectory+"\\");
                    Application.Exit();
                    break;
                }
            }
        }
}

And the code of “Patcher”:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Deployment.Compression.Cab;

namespace Patcher
{
    class Program
    {
        static void Main(string[] args)
        {
            WebClient client=new WebClient();
            string name = "asd2341648.txt";
            client.DownloadFile("http://mypage/patches/"+args[0]+".txt", @"C:\"+name);
            string text = File.ReadAllText(@"C:\" + name);
            File.Delete(@"C:\"+name);
            string[] version = text.Split('.');
            string[] sVersion = args[1].Split('.');
            for (int i = 0; i < version.Length; i++)
            {
                if(int.Parse(version[i])>int.Parse(sVersion[i]))
                {
                    break;
                }
                if(i==version.Length-1)
                {
                    return;
                }
            }
            Console.WriteLine("New version is avaliable. Downloading...");
            client.DownloadFile("http://mypage/patches/patches/" + args[0]+".cab",       @"C:\"+args[0]+".cab");
            CabInfo cab=new CabInfo(@"C:\"+args[0]+".cab");
            cab.Unpack(args[2]);
            File.Delete( @"C:\"+args[0]+".cab");
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:38:19+00:00Added an answer on June 11, 2026 at 9:38 pm

    You can modify with (Delete txt extension from your first argument)

    var path = Path.Combine("C:\",name);
    client.DownloadFile("http://mypage/patches/"+args[0], @path);
    

    You can modify also

     var path = Path.Combine("C:\",name);
     client.DownloadFile("http://mypage/patches/", @path);
    

    You must set just adress of your file

    public void DownloadFile(
        string address,
        string fileName
    )
    

    Link : http://msdn.microsoft.com/fr-fr/library/vstudio/ez801hhe.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a console application that tries to download some files from a
I m working on a console application that tries to download some files from
I'm working on some application which has auto-update function. The implemented idea is simple
I am working on a custom application for the iPad that runs as a
I am working on an application for blackberry that will be downloading a file.
I'm working on a PHP application that links into the Protx VSP Direct payment
I've been working with Doctrine_Record classes that autoload just fine for a while; but
I've implemented a simple Flex application that tries to connect to a server via
Any web development applications that retains colour formatting when copying to word? I tried
I've tried WebSphinx application. I realize if I put wikipedia.org as the starting URL,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.