need help to add time interval in c#

Discussion in 'General Computer Support' started by ringku2k, Nov 15, 2009.

  1. ringku2k

    ringku2k

    Joined:
    Nov 15, 2009
    Messages:
    1
    hi, im newbies in c# , i use the following code to to download a text file , when run the exe file it download once at a time , i want help for once i click to start the executable file , it will dowload that txt file after 2/3 minute time interval each , please help ..
    code:
    using System;
    using System.Net;
    using System.IO;
    public class Download
    {
    private static void Main()
    {
    string remoteUri = "://w.com/st/qoute.txt"; //web address with file name
    string localFileName = "qoute.txt";

    WebClient client = new WebClient();
    Console.WriteLine("Download der Datei " +
    remoteUri + " nach " + Path.GetFullPath(localFileName));


    // Download durchführen.
    client.DownloadFile(remoteUri, localFileName);
    Console.WriteLine("Download complete.");
    Console.ReadLine();
    }
    }
    ringku2k, Nov 15, 2009
    #1
    1. Advertising

  2. ringku2k

    erics44

    Joined:
    Nov 26, 2009
    Messages:
    2
    I havent checked your code to see if a download would work like that but you can add a time interval by using a timer or a thread

    I think if its a console application then you would probably best with a thread
    erics44, Nov 26, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. No Left Turn
    Replies:
    5
    Views:
    5,154
    Tony Whitaker
    Oct 1, 2003
  2. ellobo1968@gmail.com

    Interval/Time-lapse function on digital (foto)camera

    ellobo1968@gmail.com, Jul 31, 2006, in forum: Digital Photography
    Replies:
    14
    Views:
    1,500
    John Turco
    Aug 5, 2006
  3. samnachilomo
    Replies:
    2
    Views:
    2,389
    samnachilomo
    Mar 27, 2009
  4. Robert Carnegie

    Re: How do I set my internet time check interval

    Robert Carnegie, Jul 19, 2013, in forum: Windows 64bit
    Replies:
    0
    Views:
    428
    Robert Carnegie
    Jul 19, 2013
  5. Dave Warren

    Re: How do I set my internet time check interval

    Dave Warren, Jul 20, 2013, in forum: Windows 64bit
    Replies:
    0
    Views:
    428
    Dave Warren
    Jul 20, 2013
Loading...

Share This Page