Solved

Hello world via notepad

Posted on 2002-07-23
5
1,108 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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
What can cause the styling on a .NET site to not be found? 17 29
C# LINQ ForEach() question 6 54
VB.NET 2008 Winforms Signing 13 32
linq, c# 8 24
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 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