Solved

Hello world via notepad

Posted on 2002-07-23
5
1,109 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding items to a C# list incrementally 5 64
Where does legacy ASP.NET initialize language? 2 63
C# XML Get Values 4 37
aspx ascx, c# 7 20
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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