Solved

Hello world via notepad

Posted on 2002-07-23
5
1,101 Views
Last Modified: 2010-05-19
i am completely new to C,C++,C#
before buying VS.NET i would like to download the SDK
and try out some simple C# programs using the Notepad editor
can anyone explain me how to use the SDK and notepad to write a 'hello world' program in C#
and how to get it running on win98/2000/XP
0
Comment
Question by:pierrecampe
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 7172834
FYI: you can order a 60-day trial version of Visual Studio.NET from microsoft
0
 
LVL 4

Accepted Solution

by:
DarthPedro earned 100 total points
ID: 7172851
First, make sure that you have the .NET Framework SDK installed on your machine.  You can get it from: http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true.

First, launch notepad and enter the following code:
class MyApp {
   public static void Main() {
      System.Console.WriteLine("Hello, world! (from C#)");
   }
}

Then, save the file (I did it under c:\projects).

Next, launch a command prompt window and change directories into the one with your helloworld.cs file.  At the prompt, type in:
c:\Projects> C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\csc helloworld.cs

This will run the C# compiler.  When, it's done, you should be able to run your new app.  At the prompt, just type in:
c:\Projects> helloworld

That should run your console application with an output of:
Hello, world! (from C#)

Finally, to get it to run on another machine, you need to make sure that the .NET Framework redistributable is installed on that machine.  These are the libraries and components needed to run .NET applications.  You can get that from: http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/MSDN-FILES/027/001/829/msdncompositedoc.xml&frame=true.
0
 
LVL 6

Author Comment

by:pierrecampe
ID: 7175358
thank you
works O.K
but if i run it from the windows explorer the console window immediately closes,is there a way to prevent that ?
0
 
LVL 6

Author Comment

by:pierrecampe
ID: 7175362
>>FYI: you can order a 60-day trial version of Visual Studio.NET from microsoft
Where and how ?
0
 
LVL 4

Expert Comment

by:DarthPedro
ID: 7175693
run it in an open command prompt rather than through the explorer.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now