Good Evening Everyone,
I am a beginner at C#. I have dled VS2008 and i tpyed the Hello World code. Although I am trying to execute the file through the Command Prompt. Can anyone show me how to type the path correctly to execute the file?
-KK
Loading

Pradeep ChandrakerRank #941 · 2.2K reputationPosted Jun 21, 2011, 7:01 PM EDT
Create "Hello.cs" file from notepad and write below code in the same file.
using System;
namespace TestApp
{
class Hello
{
static void Main(string[] args)
{
Console.WriteLine("Hello...");
Console.ReadKey();
}
}
}
Open Visual Studio command prompt and type this command
csc /out:Hello.exe Hello.cs
It will create Hello.exe on the same folder. Now just type "Hello" on the command prompt, you will get the output. You may also directly click on Hello.exe to execute it.
Kennan Kel5 reputationPosted Jun 21, 2011, 8:25 PM EDT
I know this is wrong, but am I close?
Or should i just move my folders?
Pradeep ChandrakerRank #941 · 2.2K reputationPosted Jun 21, 2011, 8:52 PM EDT
if you have hello.exe in "C:\xxx\xxx\documents\visualstudio2008\projects" directory. You may change directory using CD command to "C:\xxx\xxx\documents\visualstudio2008\projects" directory and type "hello", click on enter to execute. Some thing like this:
C:\xxx\xxx\documents\visualstudio2008\projects> Hello
VulpesRank #55 · 29.2K reputationPosted Jun 22, 2011, 12:03 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Jun 22, 2011, 7:13 AM EDT
In VS, go to "File | New | Project...". That will show a New Prpject form. There is a tree view of templates at the left side. Open the Visual C# node and select Windows. In the middle there will be Console Application; choose that then click on OK. That will create a project that includes a Program.cs file. Add code to theProgram.cs file. Then use "Build | Build Solution". Fix any errors and build again if needed. Then press Ctrl-F5 to execute.
There are many more details to learn about all that and I hope you can find a tutorial or book to help you with it.
Kennan Kel5 reputationPosted Jun 22, 2011, 2:12 PM EDT
Good Day for now.
-Kk
Pradeep ChandrakerRank #941 · 2.2K reputationPosted Jun 22, 2011, 5:09 PM EDT