[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1118
  • Last Modified:

Hello world via notepad

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
pierrecampe
Asked:
pierrecampe
  • 2
  • 2
1 Solution
 
ShaunWildeCommented:
FYI: you can order a 60-day trial version of Visual Studio.NET from microsoft
0
 
DarthPedroCommented:
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
 
pierrecampeAuthor Commented:
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
 
pierrecampeAuthor Commented:
>>FYI: you can order a 60-day trial version of Visual Studio.NET from microsoft
Where and how ?
0
 
DarthPedroCommented:
run it in an open command prompt rather than through the explorer.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now