SlideShare a Scribd company logo
1 of 15
Download to read offline
Installing, Compiling and Executing your first C# Program
Install---then Compiling and Execute your first C# Program
When I first heard about Microsoft's newest language, C#, my mouth started watering. For the
audience with which I mostly deal (beginner programmers trying to break into the business) I thought
C# would be the great equalizer---after all, everyone (experienced programmers as well as beginners)
would be learning it at the same time.
Many of you may know I'm in the process of writing a C# book--this article will detail how to install it,
and how to write your first program. For more, you'll need to read my book!
Installing C#
To install C#, for the moment anyway, you don't need to purchase a thing. You just need to get your
hands on the Microsoft .Net Framework.
C# is a language that comes with the Microsoft .Not (pronounced DOT-NET) Framework. The .Net
Framework is an environment that permits .Net programs to run. C# is just one of many programming
languages supported by the .Net framework (it even includes COBOL). Something tells me it will
eventually become the most important.
The .Net Framework is not an Operating System---it's more like a shell that runs within Windows. For
now, the .Net Framework is available only as a Beta version (currently Beta2). That means it hasn't
been released for sale. Beta versions can be flaky, and if you read the fine print at the Microsoft
Website, they'll tell you NOT to install the .Net Framework on a production PC. If this warning scares
you, wait until the .Net Framework production version is ready (most likely, you'll have to pay for it,
although at this point no one is sure how much).
The .Net Framework can be installed on a PC running Windows XP, Windows 2000 and Windows NT
(sorry, Windows 98 and Windows ME users can't install the .Net Framework, and therefore can't install
C#). In addition, you'll need to have Internet Explorer 5.01 or later installed, plus MDAC 2.6 (Microsoft
Data Access Components).
Get the .Net Framework Software Developers Kit (SDK)
Right now, you can pick up the .Net Framework SDK from a variety of sources. I've received three in
the mail for begin a registered owner of Visual Basic 6, and I believe I've also seen CD's included in
the Visual Basic Programmers Journal. At any rate, you can access this site
http://msdn.microsoft.com/downloads/default.asp?URL=/code/sample.asp?url=/msdn-
files/027/000/976/msdncompositedoc.xml
to download it. I should warn you the SDK is 123 Megabytes. You can download it all at once, in
pieces, or get it from me if you take part in the C# class I'm offering in early 2002.
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (1 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
Install the .Net Framework SDK
Once you have downloaded the SDK (install it in a folder of its own), double click on its Setup.exe
program, and you should see a prompt similar to this one (if you don't have Internet Explorer 5.01 or
higher installed, or MDAC 2.6, you will see different prompts).
If you have the CD, you'll see this screenshot when you insert the CD-ROM. Otherwise, you'll see the
screenshot that asks you if you wish to install the .Net Framework SDK (two down…)
You don't want to install all of Visual Studio.Net--just the .Net Framework SDK, which is the part that
contains the C# compiler (among other things). If you have the CD, click on 'Install only .NET
Framework SDK'…
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (2 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
This is the window you'll see next. If you downloaded the SDK from the Microsoft Website, double
clicking on the Setup.exe program will result in this window being displayed also. Answer 'Yes' to
begin with the installation.
You should see files being copied and installed.
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (3 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
Fairly quickly, you should see this message. Answer 'yes'.
After answering 'Yes', you should see this window.
On my PC, I had MDAC 2.6 already installed, but the setup program suggested MDAC 2.7, and also
Microsoft Internet Information Server. For the purpose of learning C#, you can click on Ignore.
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (4 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
This is the window you should see next. Click on Next to continue the installation.
Be sure to read the license agreement--click on the button indicating you accept the agreement, then
click on the Next button to continue the installation.
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (5 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
This is the default installation selection. You need the Software Development Kit, and I highly
recommend that you install the SDK Samples as well. Click on the Next button to continue the
installation.
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (6 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
I suggest that you accept the Destination Folder--although if you are short on space on 'C', you may
want to install to another drive if you have space there. Make certain that the 'Register Environment
Variables' checkbox is selected--otherwise, when you try to compile your first C# program, Windows
won't be able to find the compiler!
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (7 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
You should now see this window indicating that Components are being installed. On my PC, the
Component installation took about ten minutes.
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (8 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
That's it--you'll receive this message indicating that the Installation is complete…
As is typical, you'll need to restart to finalize the installation. Click the 'Yes' button to restart.
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (9 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
Write your first C# program
After having successfully installed the .NET Framework SDK, among other things, the C# compiler will
be installed somewhere in a folder on your PC. Provided you told the Installation program to update
your Environmental variables, the location of the compiler should be registered properly on your PC,
and you won't have to jump through any hoops to get the compiler to work.
Writing your first C# program is easy--start up Notepad and enter the following code…
class ILoveCSharp {
public static void Main(string[] args) {
System.Console.WriteLine("I love C#!");
}
}
Now save the program as "ILoveCSharp.cs" ( I recommend saving all of your C# programs in a folder
called C#Files)
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (10 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
Compile your first C# program
Compiling your program is easy---but we will need to run the compiler from a Command Prompt. To do
so, click on the Start-Run button and enter
command.com
in the Open Textbox…
After you click on the OK button, you will see this window…
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (11 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
which is the Command Prompt window. Type
cd C#Files
to make your C#Files folder your current directory…
If you enter
dir
in the Command Prompt Window, you should see the C# program you just saved using Notepad.
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (12 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
Now it's time to compile your program using the C# compiler, csc. Enter
csc ILoveCSharp.cs
at the command prompt…
You should see a message that the compiler is executing. The absence of any error messages is
great news--use the 'Dir' command to verify that your C# source file has been compiled into an
executable…
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (13 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
Execute your first C# program
Executing your program is easy--just enter the name of your executable at the Command Prompt…
ILoveCSharp
You should see the phrase 'I love C#!' appear in the window.
Summary
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (14 of 15)3/28/2004 12:18:48 PM
Installing, Compiling and Executing your first C# Program
I hope that this article will help you get started with C#. For more, consider purchasing my Intro to C#
book.
http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (15 of 15)3/28/2004 12:18:48 PM

More Related Content

What's hot

Scripting for infosecs
Scripting for infosecsScripting for infosecs
Scripting for infosecsnancysuemartin
 
WordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersWordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersStewart Ritchie
 
Git hub videowhisper-php-webcam-video-conference_ video conference_ web bas...
Git hub   videowhisper-php-webcam-video-conference_ video conference_ web bas...Git hub   videowhisper-php-webcam-video-conference_ video conference_ web bas...
Git hub videowhisper-php-webcam-video-conference_ video conference_ web bas...bos trevel
 
Filmcamp 2011 in Vientiane, Laos!
Filmcamp 2011 in Vientiane, Laos!Filmcamp 2011 in Vientiane, Laos!
Filmcamp 2011 in Vientiane, Laos!Patrick Kennedy
 
Go - Where it's going and why you should pay attention.
Go - Where it's going and why you should pay attention.Go - Where it's going and why you should pay attention.
Go - Where it's going and why you should pay attention.Aaron Schlesinger
 
Debugging PHP With Xdebug
Debugging PHP With XdebugDebugging PHP With Xdebug
Debugging PHP With XdebugMark Niebergall
 
The Ring programming language version 1.5.3 book - Part 16 of 184
The Ring programming language version 1.5.3 book - Part 16 of 184The Ring programming language version 1.5.3 book - Part 16 of 184
The Ring programming language version 1.5.3 book - Part 16 of 184Mahmoud Samir Fayed
 
A Hands-On Set of Programming Problems Using Python and OpenCV
A Hands-On Set of Programming Problems Using Python and OpenCVA Hands-On Set of Programming Problems Using Python and OpenCV
A Hands-On Set of Programming Problems Using Python and OpenCVNader Karimi
 
Using Eclipse and Installing PyDev
Using Eclipse and Installing PyDevUsing Eclipse and Installing PyDev
Using Eclipse and Installing PyDevSiva Arunachalam
 
Introduction to Continous Integration with WordPress
Introduction to Continous Integration with WordPressIntroduction to Continous Integration with WordPress
Introduction to Continous Integration with WordPressSeagyn Davis
 
Wordpress: A Gentle Introduction
Wordpress: A Gentle IntroductionWordpress: A Gentle Introduction
Wordpress: A Gentle IntroductionJohn Feminella
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool boxbpowell29a
 
Chocolatey - making the process of installing software on windows easy as pie
Chocolatey - making the process of installing software on windows easy as pieChocolatey - making the process of installing software on windows easy as pie
Chocolatey - making the process of installing software on windows easy as pieJustin James
 

What's hot (14)

Scripting for infosecs
Scripting for infosecsScripting for infosecs
Scripting for infosecs
 
WordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersWordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for Beginners
 
Git hub videowhisper-php-webcam-video-conference_ video conference_ web bas...
Git hub   videowhisper-php-webcam-video-conference_ video conference_ web bas...Git hub   videowhisper-php-webcam-video-conference_ video conference_ web bas...
Git hub videowhisper-php-webcam-video-conference_ video conference_ web bas...
 
Filmcamp 2011 in Vientiane, Laos!
Filmcamp 2011 in Vientiane, Laos!Filmcamp 2011 in Vientiane, Laos!
Filmcamp 2011 in Vientiane, Laos!
 
Go - Where it's going and why you should pay attention.
Go - Where it's going and why you should pay attention.Go - Where it's going and why you should pay attention.
Go - Where it's going and why you should pay attention.
 
Debugging PHP With Xdebug
Debugging PHP With XdebugDebugging PHP With Xdebug
Debugging PHP With Xdebug
 
The Ring programming language version 1.5.3 book - Part 16 of 184
The Ring programming language version 1.5.3 book - Part 16 of 184The Ring programming language version 1.5.3 book - Part 16 of 184
The Ring programming language version 1.5.3 book - Part 16 of 184
 
A Hands-On Set of Programming Problems Using Python and OpenCV
A Hands-On Set of Programming Problems Using Python and OpenCVA Hands-On Set of Programming Problems Using Python and OpenCV
A Hands-On Set of Programming Problems Using Python and OpenCV
 
Wampserver install
Wampserver installWampserver install
Wampserver install
 
Using Eclipse and Installing PyDev
Using Eclipse and Installing PyDevUsing Eclipse and Installing PyDev
Using Eclipse and Installing PyDev
 
Introduction to Continous Integration with WordPress
Introduction to Continous Integration with WordPressIntroduction to Continous Integration with WordPress
Introduction to Continous Integration with WordPress
 
Wordpress: A Gentle Introduction
Wordpress: A Gentle IntroductionWordpress: A Gentle Introduction
Wordpress: A Gentle Introduction
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 
Chocolatey - making the process of installing software on windows easy as pie
Chocolatey - making the process of installing software on windows easy as pieChocolatey - making the process of installing software on windows easy as pie
Chocolatey - making the process of installing software on windows easy as pie
 

Similar to Smiley033

install k+dcan cable standard tools 2.12 on windows 10 64bit
install k+dcan cable standard tools 2.12 on windows 10 64bitinstall k+dcan cable standard tools 2.12 on windows 10 64bit
install k+dcan cable standard tools 2.12 on windows 10 64bitWORLD OBD2
 
codeblocks-instructions.pdf
codeblocks-instructions.pdfcodeblocks-instructions.pdf
codeblocks-instructions.pdfRavinderKSingla
 
Guide: How to Build OpenCV 3.0.0
Guide: How to Build OpenCV 3.0.0Guide: How to Build OpenCV 3.0.0
Guide: How to Build OpenCV 3.0.0André Moreira
 
Orangescrum In App Chat Add-on User Manual
Orangescrum In App Chat Add-on User ManualOrangescrum In App Chat Add-on User Manual
Orangescrum In App Chat Add-on User ManualOrangescrum
 
Android Training Ahmedabad , Android Project Training Ahmedabad, Android Live...
Android Training Ahmedabad , Android Project Training Ahmedabad, Android Live...Android Training Ahmedabad , Android Project Training Ahmedabad, Android Live...
Android Training Ahmedabad , Android Project Training Ahmedabad, Android Live...NicheTech Com. Solutions Pvt. Ltd.
 
Compile open cpn on windows
Compile open cpn on windowsCompile open cpn on windows
Compile open cpn on windowsrandikaucsc
 
2018.02.11 installation guide rhapsody in c and cpp
2018.02.11 installation guide rhapsody in c and cpp2018.02.11 installation guide rhapsody in c and cpp
2018.02.11 installation guide rhapsody in c and cppFrank Braun
 
How to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xMHow to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xMDalton Valadares
 
Installation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling firstInstallation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling firstJawad Khan
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made EasyAlon Fliess
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoMamgmo Magnda
 
C installation guide
C installation guideC installation guide
C installation guidevikas mishra
 
Makefile
MakefileMakefile
MakefileIonela
 
Getting started with code composer studio v4 for tms320 f2812
Getting started with code composer studio v4 for tms320 f2812Getting started with code composer studio v4 for tms320 f2812
Getting started with code composer studio v4 for tms320 f2812Pantech ProLabs India Pvt Ltd
 

Similar to Smiley033 (20)

The windows socket
The windows socketThe windows socket
The windows socket
 
Cpb2010
Cpb2010Cpb2010
Cpb2010
 
C in7-days
C in7-daysC in7-days
C in7-days
 
C in7-days
C in7-daysC in7-days
C in7-days
 
install k+dcan cable standard tools 2.12 on windows 10 64bit
install k+dcan cable standard tools 2.12 on windows 10 64bitinstall k+dcan cable standard tools 2.12 on windows 10 64bit
install k+dcan cable standard tools 2.12 on windows 10 64bit
 
codeblocks-instructions.pdf
codeblocks-instructions.pdfcodeblocks-instructions.pdf
codeblocks-instructions.pdf
 
Guide: How to Build OpenCV 3.0.0
Guide: How to Build OpenCV 3.0.0Guide: How to Build OpenCV 3.0.0
Guide: How to Build OpenCV 3.0.0
 
Orangescrum In App Chat Add-on User Manual
Orangescrum In App Chat Add-on User ManualOrangescrum In App Chat Add-on User Manual
Orangescrum In App Chat Add-on User Manual
 
Android Training Ahmedabad , Android Project Training Ahmedabad, Android Live...
Android Training Ahmedabad , Android Project Training Ahmedabad, Android Live...Android Training Ahmedabad , Android Project Training Ahmedabad, Android Live...
Android Training Ahmedabad , Android Project Training Ahmedabad, Android Live...
 
Compile open cpn on windows
Compile open cpn on windowsCompile open cpn on windows
Compile open cpn on windows
 
2018.02.11 installation guide rhapsody in c and cpp
2018.02.11 installation guide rhapsody in c and cpp2018.02.11 installation guide rhapsody in c and cpp
2018.02.11 installation guide rhapsody in c and cpp
 
How to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xMHow to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xM
 
Installation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling firstInstallation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling first
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
NDK Introduction
NDK IntroductionNDK Introduction
NDK Introduction
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul Yao
 
C installation guide
C installation guideC installation guide
C installation guide
 
Makefile
MakefileMakefile
Makefile
 
Programming in c plus plus2
Programming in c plus plus2Programming in c plus plus2
Programming in c plus plus2
 
Getting started with code composer studio v4 for tms320 f2812
Getting started with code composer studio v4 for tms320 f2812Getting started with code composer studio v4 for tms320 f2812
Getting started with code composer studio v4 for tms320 f2812
 

Recently uploaded

How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 

Recently uploaded (20)

LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 

Smiley033

  • 1. Installing, Compiling and Executing your first C# Program Install---then Compiling and Execute your first C# Program When I first heard about Microsoft's newest language, C#, my mouth started watering. For the audience with which I mostly deal (beginner programmers trying to break into the business) I thought C# would be the great equalizer---after all, everyone (experienced programmers as well as beginners) would be learning it at the same time. Many of you may know I'm in the process of writing a C# book--this article will detail how to install it, and how to write your first program. For more, you'll need to read my book! Installing C# To install C#, for the moment anyway, you don't need to purchase a thing. You just need to get your hands on the Microsoft .Net Framework. C# is a language that comes with the Microsoft .Not (pronounced DOT-NET) Framework. The .Net Framework is an environment that permits .Net programs to run. C# is just one of many programming languages supported by the .Net framework (it even includes COBOL). Something tells me it will eventually become the most important. The .Net Framework is not an Operating System---it's more like a shell that runs within Windows. For now, the .Net Framework is available only as a Beta version (currently Beta2). That means it hasn't been released for sale. Beta versions can be flaky, and if you read the fine print at the Microsoft Website, they'll tell you NOT to install the .Net Framework on a production PC. If this warning scares you, wait until the .Net Framework production version is ready (most likely, you'll have to pay for it, although at this point no one is sure how much). The .Net Framework can be installed on a PC running Windows XP, Windows 2000 and Windows NT (sorry, Windows 98 and Windows ME users can't install the .Net Framework, and therefore can't install C#). In addition, you'll need to have Internet Explorer 5.01 or later installed, plus MDAC 2.6 (Microsoft Data Access Components). Get the .Net Framework Software Developers Kit (SDK) Right now, you can pick up the .Net Framework SDK from a variety of sources. I've received three in the mail for begin a registered owner of Visual Basic 6, and I believe I've also seen CD's included in the Visual Basic Programmers Journal. At any rate, you can access this site http://msdn.microsoft.com/downloads/default.asp?URL=/code/sample.asp?url=/msdn- files/027/000/976/msdncompositedoc.xml to download it. I should warn you the SDK is 123 Megabytes. You can download it all at once, in pieces, or get it from me if you take part in the C# class I'm offering in early 2002. http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (1 of 15)3/28/2004 12:18:48 PM
  • 2. Installing, Compiling and Executing your first C# Program Install the .Net Framework SDK Once you have downloaded the SDK (install it in a folder of its own), double click on its Setup.exe program, and you should see a prompt similar to this one (if you don't have Internet Explorer 5.01 or higher installed, or MDAC 2.6, you will see different prompts). If you have the CD, you'll see this screenshot when you insert the CD-ROM. Otherwise, you'll see the screenshot that asks you if you wish to install the .Net Framework SDK (two down…) You don't want to install all of Visual Studio.Net--just the .Net Framework SDK, which is the part that contains the C# compiler (among other things). If you have the CD, click on 'Install only .NET Framework SDK'… http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (2 of 15)3/28/2004 12:18:48 PM
  • 3. Installing, Compiling and Executing your first C# Program This is the window you'll see next. If you downloaded the SDK from the Microsoft Website, double clicking on the Setup.exe program will result in this window being displayed also. Answer 'Yes' to begin with the installation. You should see files being copied and installed. http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (3 of 15)3/28/2004 12:18:48 PM
  • 4. Installing, Compiling and Executing your first C# Program Fairly quickly, you should see this message. Answer 'yes'. After answering 'Yes', you should see this window. On my PC, I had MDAC 2.6 already installed, but the setup program suggested MDAC 2.7, and also Microsoft Internet Information Server. For the purpose of learning C#, you can click on Ignore. http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (4 of 15)3/28/2004 12:18:48 PM
  • 5. Installing, Compiling and Executing your first C# Program This is the window you should see next. Click on Next to continue the installation. Be sure to read the license agreement--click on the button indicating you accept the agreement, then click on the Next button to continue the installation. http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (5 of 15)3/28/2004 12:18:48 PM
  • 6. Installing, Compiling and Executing your first C# Program This is the default installation selection. You need the Software Development Kit, and I highly recommend that you install the SDK Samples as well. Click on the Next button to continue the installation. http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (6 of 15)3/28/2004 12:18:48 PM
  • 7. Installing, Compiling and Executing your first C# Program I suggest that you accept the Destination Folder--although if you are short on space on 'C', you may want to install to another drive if you have space there. Make certain that the 'Register Environment Variables' checkbox is selected--otherwise, when you try to compile your first C# program, Windows won't be able to find the compiler! http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (7 of 15)3/28/2004 12:18:48 PM
  • 8. Installing, Compiling and Executing your first C# Program You should now see this window indicating that Components are being installed. On my PC, the Component installation took about ten minutes. http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (8 of 15)3/28/2004 12:18:48 PM
  • 9. Installing, Compiling and Executing your first C# Program That's it--you'll receive this message indicating that the Installation is complete… As is typical, you'll need to restart to finalize the installation. Click the 'Yes' button to restart. http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (9 of 15)3/28/2004 12:18:48 PM
  • 10. Installing, Compiling and Executing your first C# Program Write your first C# program After having successfully installed the .NET Framework SDK, among other things, the C# compiler will be installed somewhere in a folder on your PC. Provided you told the Installation program to update your Environmental variables, the location of the compiler should be registered properly on your PC, and you won't have to jump through any hoops to get the compiler to work. Writing your first C# program is easy--start up Notepad and enter the following code… class ILoveCSharp { public static void Main(string[] args) { System.Console.WriteLine("I love C#!"); } } Now save the program as "ILoveCSharp.cs" ( I recommend saving all of your C# programs in a folder called C#Files) http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (10 of 15)3/28/2004 12:18:48 PM
  • 11. Installing, Compiling and Executing your first C# Program Compile your first C# program Compiling your program is easy---but we will need to run the compiler from a Command Prompt. To do so, click on the Start-Run button and enter command.com in the Open Textbox… After you click on the OK button, you will see this window… http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (11 of 15)3/28/2004 12:18:48 PM
  • 12. Installing, Compiling and Executing your first C# Program which is the Command Prompt window. Type cd C#Files to make your C#Files folder your current directory… If you enter dir in the Command Prompt Window, you should see the C# program you just saved using Notepad. http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (12 of 15)3/28/2004 12:18:48 PM
  • 13. Installing, Compiling and Executing your first C# Program Now it's time to compile your program using the C# compiler, csc. Enter csc ILoveCSharp.cs at the command prompt… You should see a message that the compiler is executing. The absence of any error messages is great news--use the 'Dir' command to verify that your C# source file has been compiled into an executable… http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (13 of 15)3/28/2004 12:18:48 PM
  • 14. Installing, Compiling and Executing your first C# Program Execute your first C# program Executing your program is easy--just enter the name of your executable at the Command Prompt… ILoveCSharp You should see the phrase 'I love C#!' appear in the window. Summary http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (14 of 15)3/28/2004 12:18:48 PM
  • 15. Installing, Compiling and Executing your first C# Program I hope that this article will help you get started with C#. For more, consider purchasing my Intro to C# book. http://www.johnsmiley.com/cis18.notfree/Smiley033/Smiley033.htm (15 of 15)3/28/2004 12:18:48 PM