Friday, April 03, 2009

How to Run the C# file in visual studio command prompt.

It’s a good practice. Starts learning the c# through command prompt. Now we see how to start, execute and run a c# program.

Step 1: open the visual studio command prompt (start => Microsoft visual studio=> visual studio tools =>visual studio command prompt).



Step 2: Type “notepad Filename.cs”.



Step 3: Once u finish the c# program save the file.


Step 4: use csc command to execute
Syntax : csc Filename.cs



Step 5: Enter the exe file name ( once u successfully execute the program. It automatically generate the exe file with the same file name. so type the same file name without extension)


Difference between Java and c#

In java javac filename.java comment create the class file with the class name. Then we can execute the java program by entering java classname.

Where as in c# csc command will create the exe file with the same name. By entering the filename alone we can run the program.

No comments:

Post a Comment