Idiotic Notepad/C#/Command Prompt Questions
-
Hi, I want to write "Hello World" using Notepad and then create the HelloWorld.exe using the >csc HelloWorld.cs (from the command prompt). "Inside C# -- Chapter 1". 1. How should I save the file with Notepad? *.txt? *.cs? "all files"? 2. I'm almost certain that I have set the environment variables for the Framework SDK correctly. 3. I have installed on my machine VS.NET 2003. 4. The file is located on the desktop. I can use the command prompt to open any file on the desktop. HelloWorld.txt will open. HelloWorld.cs will not open (although it will create a file as a ".cs" icon) and any "csc" command will not be recognized. Any help would be greatly appreciated. Go easy on me -- I'm just trying to learn the basics -- thanks
-
Hi, I want to write "Hello World" using Notepad and then create the HelloWorld.exe using the >csc HelloWorld.cs (from the command prompt). "Inside C# -- Chapter 1". 1. How should I save the file with Notepad? *.txt? *.cs? "all files"? 2. I'm almost certain that I have set the environment variables for the Framework SDK correctly. 3. I have installed on my machine VS.NET 2003. 4. The file is located on the desktop. I can use the command prompt to open any file on the desktop. HelloWorld.txt will open. HelloWorld.cs will not open (although it will create a file as a ".cs" icon) and any "csc" command will not be recognized. Any help would be greatly appreciated. Go easy on me -- I'm just trying to learn the basics -- thanks
Hi! 1. It doesn't matter. You just have to look at the filename your source file gets - when you save it with "*.txt" as filter, Notepad automatically adds ".txt" to the filename. So if you save your source file as "HelloWorld.cs", you'll end up with a file "HelloWorld.cs.txt". But for compiling the final filename really doesn't matter. 2. If you did, "csc.exe" will be found. If you didn't, it won't be found. Simple as that. 3. Then you'll have a VS.NET 2003 command prompt in your start menu. Use this to get the console window, then the correct paths will be set. 4. Putting source files on the desktop usually isn't such a good idea. Create yourself a dedicated source directory (C:\Sources, for example). This is far easier to reach, especially if you're using a command prompt. Regards, mav -- Black holes are the places where god divided by 0...