//
//
// Test
//
// Created by Tim Wood on 1/8/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
//
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
public class Test
{
public static void Main(string[] args)
{
Console.WriteLine( woodtest.TextToDisplay());
return;
}
}
}
I think it should work on a PC, as long as they have .NET 1.1 installed. Also, since it's a command line app, make sure you execute it through the command prompt (Start > Run > "cmd").
thanks. so after i go to the command prompt, how do i execute the program?
thanks. so after i go to the command prompt, how do i execute the program?
You don't half to run it through the command prompt, but unless your program has a method of pausing, it will show up for a brief milisecond and then go away. That is why you need to run it through the command prompt, so you can see the program's output.
The easiest way is to drag the exe into the window, and hitting Enter.
if you write a batch script and don't put "pause" in at the end, if you double-click it and it is a really short execution, it may flash before your eyes as well...
for instance, try making a batch script with just the command "dir" in there, and see how long it takes 🙂
"dir" does on DOS/Windows essentially what "ls" does on UNIX - it gives you a directory listing.
If you want your command line C# program to pause before closing add a call to Console.ReadLine() at the end of your code and the command prompt window will stay open until you hit return or manually close it.
Probably because it's a quick and dirty check that your program is free from the kinds of errors that the compiler can catch. If it doesn't compile then you know you still have work to do before submitting it. Think of it like this: if you were taking an electronics course you might be required to submit a schematic of a circuit you've designed. The teacher might, however, also require you to build the circuit so that you have some level of confidence that it's possible. In this sense what you're being asked to do is have your program in a runnable condition before you submit the source.
That said, the fact that it compiles doesn't guarantee that your program does anything or does what you intend but it does indicate that the program is minimally well-formed.