|
using System;
using System.Windows.Forms;
using System.Threading;
namespace CSScript
{
class Ticker
{
const string usage = "Usage: tick.cs [seconds] ...\ncounts specified number of seconds (default is 5 sec). \n";
static public void Main (string[] args)
{
if ((args.Length == 1 && (args[0] == "?" || args[0] == "/?" || args[0] == "-?" || args[0].ToLower() == "help")))
{
Console.WriteLine(usage);
}
else
{
int count = 5;
if (args.Length != 0)
{
try
{
count = Convert.ToInt32(args[0]);
}
catch
{
Console.WriteLine("Error: Invalid parameter");
}
}
for (int i = 0; i < count; i++)
{
Console.WriteLine("tick");
Thread.Sleep(1000);
}
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I was born in Ukraine. After completing the university degree worked there as a Research Chemist. Last 23 years I live in Australia where I've got my second qualification as a Software Engineer.
"I am the lucky one: I do enjoy what I am doing!"