Tải bản đầy đủ (.pdf) (1,125 trang)

Ms press programming ms visual c sharp 2005 the language jan

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (5.13 MB, 1,125 trang )

ProgrammingMicrosoftVisualC#2005:
TheLanguage
byDonisMarshall
MicrosoftPress2006(704pages)
ISBN:0735621810

Offeringexpertguidance,hands-onprogramming
instruction,andpracticalexamples,this
straightforwardbookwillhelpbothnewand
experienceddevelopersadvancetheirproficiencyin
developingapplicationsforMicrosoftWindowsandthe
Web.

TableofContents
ProgrammingMicrosoftVisualC#2005—The
Language
Introduction
PartI-CoreLanguage
Chapter1 - IntroductiontoVisualC#Programming
Chapter2 - Types
Chapter3 - Inheritance
PartII-CoreSkills
Chapter4 - IntroductiontoVisualStudio2005
Chapter5 - ArraysandCollections
Chapter6 - Generics
Chapter7 - Iterators
PartIII-MoreC#Language
Chapter8 - DelegatesandEvents
Chapter9 - ExceptionHandling
PartIV-Debugging



Chapter10 - MetadataandReflection
Chapter11 - MSILProgramming
Chapter12 - DebuggingwithVisualStudio2005
Chapter13 - AdvancedDebugging
PartV-AdvancedConcepts
Chapter14 - MemoryManagement
Chapter15 - UnsafeCode
AppendixA - OperatorOverloading
Index
ListofFigures
ListofTables


BackCover
Gethands-on,expertguidancefordevelopingwith
VisualC#2005.
Gettheessential,straightforwardinformationyouneed
tomasterthecorecapabilitiesofVisualC#2005.Both
newandexperienceddevelopersgetexpertguidance,
hands-onprogramminginstruction,andpractical
examplestohelpadvancetheirproficiencyin
developingapplicationsforMicrosoftWindowsandthe
Web.
Discoverhowto:
Refineclassusagewithinheritance,
polymorphism,andotherstrategies
Implementgenericstodefineatype-safedata
structure
Workwithstacks,queues,arrays,dictionaries,

andothercollections
Useiteratorstoimplementandstandardize
enumeratorpatterns
Knowwhentocatchexceptions—andhandlethem
locallyorpropagatethem
Interrogatemetadataandfacilitatelatebinding
byusingreflection
Synchronizethreadswithlocks,events,mutexes,
andothertools


UsetheMicrosoftVisualStudioDebuggerand
exploreadvanceddebuggingtechniquesandtools
AbouttheAuthor
DonisMarshallisatrainer,aconsultantandanauthor
with20yearsofdevelopmentexperienceandanindepthbackgroundonMicrosoft.NETtechnologies.He
istheauthorofseveralbooks,including.NETSecurity
Programming.Donisteachesclasseson.NET
programming,debugging,security,anddesignand
architecture.Inaddition,heisthepresidentof
DebugNow.


ProgrammingMicrosoftVisualC#2005—The
Language
DonisMarshall

PUBLISHEDBYMicrosoftPressADivisionofMicrosoftCorporation
OneMicrosoftWayRedmond,Washington98052-6399
Copyright©2006byDonisMarshall

ISBN:0735621810
Allrightsreserved.Nopartofthecontentsofthisbookmaybe
reproducedortransmittedinanyformorbyanymeanswithoutthe
writtenpermissionofthepublisher.
LibraryofCongressControlNumber2005934153
PrintedandboundintheUnitedStatesofAmerica.
123456789QWT098765
DistributedinCanadabyH.B.FennandCompanyLtd.
ACIPcataloguerecordforthisbookisavailablefromtheBritishLibrary.
MicrosoftPressbooksareavailablethroughbooksellersanddistributors
worldwide.Forfurtherinformationaboutinternationaleditions,contact
yourlocalMicrosoftCorporationofficeorcontactMicrosoftPress
Internationaldirectlyatfax(425)936-7329.VisitourWebsiteat
www.microsoft.com/mspress.Sendcommentsto

Microsoft,IntelliSense,MicrosoftPress,MSDN,VisualBasic,VisualC#,
VisualStudio,theVisualStudiologo,Win32,Windows,WindowsCE,the
Windowslogo,WindowsNT,andWinFXareeitherregisteredtrademarks
ortrademarksofMicrosoftCorporationintheUnitedStatesand/orother
countries.Otherproductandcompanynamesmentionedhereinmaybe


thetrademarksoftheirrespectiveowners.
Theexamplecompanies,organizations,products,domainnames,e-mail
addresses,logos,people,places,andeventsdepictedhereinare
fictitious.Noassociationwithanyrealcompany,organization,product,
domainname,e-mailaddress,logo,person,place,oreventisintended
orshouldbeinferred.
Thisbookexpressestheauthor'sviewsandopinions.Theinformation
containedinthisbookisprovidedwithoutanyexpress,statutory,or

impliedwarranties.Neithertheauthors,MicrosoftCorporation,norits
resellers,ordistributorswillbeheldliableforanydamagescausedor
allegedtobecausedeitherdirectlyorindirectlybythisbook.
AcquisitionsEditor:BenRyan
ProjectEditor:ValerieWoolley
TechnicalEditor:JamesD.Rogers
CopyEditor:NancySixsmith
Indexer:TonyRossandLeeRoss
BodyPartNo.X11-50074
Thisbookisdedicatedtomyfather,HerbertMarshall.Hewasanuclear
engineer,anartist,aconfidant,adotinghusbandtomymother,andmost
ofallacompassionateperson.Hewasagiantamongstmenand
touchedinnumerablelives.Histhreesons,includingmyself,misshim
everyday.
Acknowledgments
ProgrammingMicrosoftVisualC#2005:TheLanguagewascompleted
withthecollaborationofseveralpeople.Iamcreditedonthecover,but
thecontributionofothersisnolessimportant.Iwanttoespecially
acknowledgethecontributionsofValerieWoolley,BenRyan,andJim
Rogers.Ifpossible,theywouldalsoreceivecovercredit.Valeriewasthe
projectmanagerandprovidedsupport,encouragement,patience,and


theoccasionalnudgewhennecessary.Ben,whowastheacquisitions
editor,hadunyieldingconfidenceinmyability,whichisgreatly
appreciated.JimRogerswasthetechnicaleditoranddiligentlyreviewed
hundredsofpagesofmanuscriptandcode.Hehelpedassurethesuperb
qualityofthebook.
IalsowanttothankJohnBruno,whoisanexceptionalengineer,for
reviewingandcommentingoneachchapter,whichwasveryhelpful.

Writingabookisanall-consumingproject.Unfortunately,muchofthis
burdeniscarriedbyfriendsandlovedones.Iappreciatethepatience
andsupportofmymother,Lynn,andofmyfriendsHerb,Jr.,Chuck,and
Patty,alongwithalonglistofotherfriendswhoweretreatedshabbily
duringthisproject.Thanksforyourunderstanding.
Finally,Iwanttoacknowledgemychildren:Jason,Kristen,andAdam.
Theymakeeverydayspecial.Theyaremymotivation.Aspecial
acknowledgmentisreservedforJason.Duringmostofthisproject,Jason
wasstationedinIraqasaMarine.Herecentlyreturnedhomesafely.We
areproudofyou.
DonisMarshall
DonisMarshalliscurrentlyoneofthefewtrainersendorsedbyMicrosoft
GlobalLearningServicestoconductMicrosofttechnologyclassesfor
Microsoftemployees.Inthiscapacity,Mr.Marshalltravelsinternationally,
deliveringdozensofclassestoMicrosoftdevelopersandengineersinthe
UnitedStates,Europe,andAsia.Hisrepertoireincludesclasseson
Advanced.NETUMDDebugging,Advanced.NETDebugging
workshops,.NETDesignandArchitecture,VisualBasic.NET
Programming,.NETInteroperabilityandSecurity,.NETWebServices,
andASP.NET.Healsoteaches.NETclassesatAutodesk,NCCI,and
NASA.
DonisMarshallisanationallyrecognizedteacherofcomputertechnology
todevelopersandscientists.AsfounderandleadinstructorforThe
TrainingAlliance,hetaughtadvancedtechnicalclassesformanyFortune
500clients.HealsomanagedastaffoftechnicalinstructorsasDirector
ofAdvancedTechnicalLearningServicesatProductivityPoint


International,anationalfranchiseroftrainingservices.
Mr.MarshallisPresidentofDebugNow(www.debugnow).DebugNow

offersanassortmentofinnovativetoolsforsupportengineersand
developerstodebugandmonitorWin32and.NETapplications.
Asacontractor,DonisMarshallhaswrittenthousandsoflinesofcodefor
variousentities.


Introduction
MicrosoftVisualC#2005includesseveralenhancementstoearlier
versionsofthelanguage.Ifyouwanttolearnthenewfeaturesofthe
language,ProgrammingMicrosoftVisualC#2005:TheLanguageoffers
detailedexplanationsofeachimprovement.Oneofthemostawaited
additionstothe.NETenvironmentisgenerics.Otheradditionsinclude
anonymousmethods,staticclasses,andnewclassesthataffectgarbage
collection.Thisbookintroducesthesenewfeatures,providescontext,
anddisplayssamplecode.
Enhancementsarenotlimitedtothelanguage.TheMicrosoftVisual
StudioIDEhasalsobeenenhancedinVisualStudio2005.Microsoft
continuestoexpandupontheimpressiveassortmentofrapidapplication
development(RAD)toolsthatareavailable.TheExceptionAssistant,
codesnippets,andvisualizersaresomeofthemorenotable
advancements,wheretheemphasisisonprovidinghelpfulinformation
thatmarkedlyincreasesdeveloperproductivity.Thisbookdetailsthese
andotherimprovementstopreviousversionsofVisualStudio.
Alargerportionofthelifetimeofanapplicationisspentinmaintenance
anddebugging.Efficientandeffectivedebuggingtoolsandtechniques
canfacilitateamorerobustapplication,whichreducestheneedto
debug.Youcanalsoresolveproblemsmorequicklywhentheyinevitably
occur.Amanagedapplicationhasamanagedveneerandanunmanaged
underpinning.Debuggingrequiresanunderstandingofbothrealms
whereamanagedapplicationexists:managedandunmanaged.Froma

debuggingcontext,Chapter12examinesbothrealmsofamanaged
applicationandhelpsdevelopersunderstandhowtoeffectivelydebuga
managedapplication.


WhoIsThisBookFor?
ProgrammingMicrosoftVisualC#2005:TheLanguageisfordevelopers
whowantacomprehensiveexplanationofVisualC#2005orwantto
exploreaspecificaspectofthelanguage.Itisacompositeofchapters
sequencedtoprovidearationalandcompletereviewofthelanguage.
Eachchapterisalsoreviewableasanindependentunitthat
encapsulatesaspecifictopic.
Thisbooktargetsbothprofessionalandcasualdevelopers.Practical,indepthexplanationsareofferedforeventhemostardentdevelopers.
Samplecodeisprovidedasacomplementtothecontent.Forcasual
developers,codeisoftentheclearestexplanationofin-depthconcepts.
Actually,evenforprofessionaldevelopers,samplecodeisoften
invaluable.Forthisreason,thisbookcontainsreamsofcodeexamples.


OrganizationofThisBook
ProgrammingMicrosoftVisualC#2005:TheLanguageisorganizedinto
fiveparts.
Thefirstpart,"CoreLanguage,"introducesthebasicconceptsofthe
language.Chapter1containsageneraloverviewofthelanguage.
Chapter2introducestypes,whichincludeclassesandvaluetypes.
Chapter3explainsinheritanceinC#andtherelatedkeywords,suchas
virtual,override,sealed,andabstract.
Thesecondpart,"CoreSkills,"coversthecoreskillsrequiredtocreatea
C#application.Chapter4reviewsVisualStudio2005,whichisthe
centraltoolindevelopingamanagedapplication.Chapter5explains

arraysandcollections.ItishardtoimagineacompetentC#application
thatdoesnotemployarraysorcollections.Chapter6introduces
generics,whichisanewfeatureof.NETFramework2.0.Chapter7
pertainstoiteratorsandthecapabilitytoenumeratecollection-related
classes.
Thethirdpart,"MoreC#Language,"focusesonadditionallanguage
features.Chapter8detailsmanagedfunctionpointers,whichare
representedbydelegatesandeventsinmanagedcode.Chapter9
explainsstructuredexceptionhandlingintheruntimeandwithintheC#
language.
Thefourthpart,"Debugging,"isanall-inclusiveexplanationofdebugging
managedcode.Thefirsttwochaptersinthissectionprovideaninternal
viewofanassembly,whichiscriticalforanyonedebuggingamanaged
application:Chapter10introducesmetadataandreflection;Chapter11is
anoverviewofMicrosoftintermediatelanguage(MSIL)programming.
Chapter12discussesdebuggingwithVisualStudio,whichisthe
preferreddebuggingenvironmentformostdevelopers.Finally,Chapter
13discussesadvanceddebuggingusingtheMDbg,Windbg,andSOS
debuggerextensions.
Thefinalpartis"AdvancedConcepts."Chapter14coversmanaged
memoryandgarbagecollectioninthemanagedenvironment.Chapter15


explainsunsafecodeanddirectpointermanipulation.Thischapteralso
discussescallingfunctionsthatareinunmanaged(native)libraries.


SystemRequirements
You'llneedthefollowinghardwareandsoftwaretobuildandrunthecode
samplesforthisbook:

MicrosoftWindowsXPwithServicePack2,MicrosoftWindows
Server2003withServicePack1,orMicrosoftWindows2000
withServicePack4
MicrosoftVisualStudio2005StandardEditionorMicrosoftVisual
Studio2005ProfessionalEdition
600MHzPentiumorcompatibleprocessor(1GHzPentium
recommended)
192MBRAM(256MBormorerecommended)
Video(800×600orhigherresolution)monitorwithatleast256
colors(1024×768HighColor16-bitrecommended)
2GBavailablespaceoninstallationdrive;1GBavailablespace
onsystemdrive.WithMSDN,theharddiskrequirementsare2.8
GBand1GB,respectively.
CD-ROMorDVD-ROMdrive
MicrosoftMouseorcompatiblepointingdevice


TechnologyUpdates
Astechnologiesrelatedtothisbookareupdated,linkstoadditional
informationwillbeaddedtotheMicrosoftPressTechnologyUpdates
Webpage.VisitthispageperiodicallyforupdatesonVisualStudio2005
andothertechnologies:
/>

CodeSamples
Allthecodesamplesdiscussedinthisbookcanbedownloadedfromthe
book'scompanioncontentWebpageatthefollowingaddress:
/>

SupportforThisBook

Everyefforthasbeenmadetoensuretheaccuracyofthisbookandthe
companioncontent.Ascorrectionsorchangesarecollected,theywillbe
addedtoaMicrosoftKnowledgeBasearticle.Toviewthelistofknown
correctionsforthisbook,visitthefollowingarticle:
/>MicrosoftPressprovidessupportforbooksandcompanioncontentatthe
followingWebsite:
/>
QuestionsandComments
Ifyouhavecomments,questions,orideasregardingthebookorthe
companioncontent,orquestionsthatarenotansweredbyvisitingthe
previoussites,pleasesendthemtoMicrosoftPressviae-mailto

Orviapostalmailto
MicrosoftPress
Attn:DeveloperSeriesEditor
OneMicrosoftWay
Redmond,WA98052-6399
PleasenotethatMicrosoftsoftwareproductsupportisnotoffered
throughtheprecedingaddresses.


PartI:CoreLanguage


ChapterList
Chapter1:IntroductiontoVisualC#Programming
Chapter2:Types
Chapter3:Inheritance



Chapter1:IntroductiontoVisualC#
Programming


Overview
MicrosoftVisualC#2005isanobject-orientedprogramminglanguage
usedtodevelopapplicationstargetingthe.NETenvironment.
Programminglanguagesarenotunlikenaturallanguagessuchas
Spanish,Latin,French,Chinese,orEnglish—humanlanguagesthatare
writtenorspoken.Eachnaturallanguageincludesrulesthatdescribe
propersyntaxandstructure;weusetheserulestoconveycohesive
thoughtsandideas.Anaturallanguagealsoevolvesovertime,
sometimesfromorwithinagenusofotherlanguages.Programming
languagessharemanyoftheseattributesandalsoincluderulesfor
propersyntaxandstructureandoftenevolvefromotherlanguages.
Acquiringproficiencyinaprogramminglanguageissimilartoobtaininga
highlevelofcompetencyinanaturallanguage.Havingacquiredalevel
ofcompetencyinFORTRAN,Turkish,English,COBOL,Spanish,
German,C,andotherlanguages(notnecessarilyinthatorder),Ispeak
fromexperience.Languagesarelanguages.Whenyou'relearninga
humanlanguage,yourgoalsareliteracyandbeingabletohavea
conversation.If,asastudentofFrench,youcansitinaParisiancaféand
readthemenuwhilediscussingcurrenteventswiththelocals,your
languageskillsareafaitaccompli.Thegoalofthischapteristhesame:
foryoutobecomeconversationalinC#.
Learningalanguagetypicallybeginswithcoreelementsoflanguage.In
English,theseelementsincludeconsonants,vowels,nouns,verbs,
adjectives,phrases,andsentences.Theyrepresentthebuildingblocksof
thelanguage;youcannotread,write,orspeakEnglishwithouta
fundamentalunderstandingoftheselanguagecomponents.Thekey

elementsofC#aresymbolsandtokens,keywords,expressions,
statements,functions,andclasses.EffectiveC#programmingrequires,
ofcourse,afundamentalunderstandingoftheseelements,whichthis
chapterwillprovide.
Asyouknow,asentenceinEnglishismorethanrandomwords
terminatedwithaperiod.Likewise,inC#,aprogrammingstatementis


morethanacollectionofrandomclauses.ThefollowingEnglish
sentenceandC#statementarebothnonsensical:
ProgrammingfunisC#.
for(i<5;inti=0;++i)
Inbothcases,thecorrectelementsarepresent,butthestructureis
incorrect.Usingeitherahumanlanguageoraprogramminglanguageto
conveycohesiveideas,concepts,tasks,orinstructionsrequires
organizingthewordsandotherelementsofthelanguagecorrectly.Inthe
Englishlanguage,syntax(therulesofalanguage)indicateswherea
linkingverbisplacedinrelationtothenounobject.Bycomparison,C#
syntaxorderstheclausesofaforstatement.AccordingtoC#syntax,the
previousforstatementshouldbestructuredlikethis:for(inti=0;i<5;++i).
Understandingtheunderlyinglanguagesyntaxisequallyimportantfor
naturalandprogramminglanguages.Thischapterwillalsoprovidethe
basicsyntaxoftheC#language.
MandarinChineseisatonallanguage,whereasEnglishisastress
language.LearningChineseismorethansimplyassimilatingnewwords
andsentencestructures.Youmustalsolearntonesbecausethe
meaningofaChinesewordcanchangebasedontone.Speaking
ChinesewithEnglishenunciationwouldbeconfusingandamusingat
best.Similarly,C#isanobject-orientedlanguage,notaprocedural
language(moreonthisdifferencelater).C#,C++,Java,SmallTalk,Eiffel,

andotherobject-orientedlanguagesareonlyaseffectiveasyour
appreciationofobject-orientedconceptsandprogrammingtechniques.I
recommendabasicknowledgeofobject-orientedanalysisanddesign
conceptsasacomplementtothenewlyacquiredC#skillsthisbookwill
giveyou.
Finally,languagesdonotemergespontaneously.Naturallanguageshave
beenevolvingfornearly150,000years,andknowingtheheritageofand
theinfluencesonalanguagecanbeinformativeandhelpful.For
example,English,French,German,Yiddish,andrelatedlanguagesare
heavilyinfluencedbytheirLatinlanguageheritage.Assuch,theyhave
commonwords,syntax,andstructuresthatarecharacteristicoftheLatin
metalanguage.TheoriginofC#doesnotdatebackcenturies,butan


understandingofitsevolutionisinvaluable.


LanguageOrigin
Fromthetimewhenthefirstnaturallanguageappeared,hundredsof
thousandsoflanguageshaveemerged.Manyoftheselanguagesare
nowextinct,leavingaboutsixthousandlanguagesthatarecurrently
spoken.Someoftheselanguagesaresimilarandgroupedby
classification.Otherlanguagesarequitedistinct,suchasKora,which
incorporatesaseriesofclicksoundsandisspokenbybushmeninAfrica.
Alistofprogramminglanguagesismodestwhencomparedwiththe
catalogueofnaturallanguages.Beginninginthe1940swithPlankalkül,
morethan1,000programminglanguageshavebeendocumented.Like
naturallanguages,thevarietyanddiversityoftheselanguagesis
impressive:thesuccinctnessofassembler,theverbosityofCOBOL,and
theefficiencyofC.Foracomprehensivelistofprogramminglanguages,

visitthislink: />Themotivationsthatinspirethecreationoflanguagesarediverse:
FORTRANwascreatedforscientificanalysis,COBOLforbuilding
businessapplications,RPGforreportgeneration,andsoon.Some
languagesserveasrefinementsofearlierlanguages.CPLcombinedthe
bestingredientsofseverallanguages,includingALGOL,FORTRAN,and
COBOL.C#isanindependentlydeveloped,object-orientedlanguage
andamemberoftheCfamilyoflanguages.Itsharessimilarsyntaxand
someconceptswithotherC-familylanguages;moreimportant,however,
C#hasfewifanyvestigesofproceduralprogramming,inwhichthebasic
programmingelementistheprocedure(thatis,anamedsequenceof
statements,suchasaroutine,subroutine,orfunction).Unfortunately,
C++inheritedmanyoftheartifactsofproceduralprogrammingfromC.
C#,however,wasdesignedtobeapurelyobject-orientedlanguage.
ALGOLisarguablythemostinfluentialprogramminglanguageinhistory.
Thelanguagewasintroducedin1958butbecamepopularwhenALGOL60wasreleasedin1960.ALGOLquicklybecamethedominantlanguage
inEuropeduringthe1960s.Itsimpactonfuturelanguagessuchas
Pascal,C,andJavaisundeniable—theselanguages'grammaticalsyntax
borrowsheavilyfromALGOL.I'veprogrammedprofessionallyinALGOL,
assembler,COBOL,FORTRAN,C,C++,C#,Basic(invarious


renditions),Forth,JavaScript,HTML,XML,MISL,andmanymore—and
ALGOLremainsmyfavoritelanguage.ThemajordesigngoalsofALGOL
wereportability,aformalgrammar,andsupportforalgorithms.ALGOL68extendedthelanguage,buttheadditionsincreasedcomplexityand
furtheredabstractionfromhardware.Thisabstractionprevented
developersfromeasilyaccessingdevicesandthelowertiersofthe
operatingenvironment.Soon,languageswereintroducedthatwereless
complexandnotasabstractedfromthearchitecture.Oneofthesenew
languageswasC.
ThejourneyfromALGOLtoCbeganwithCPL.CPL,aderivativeof

ALGOL-60,wasdevelopedattheComputerLabofCambridge
University.CPLwascreatedin1963byDavidBarron,Christopher
Strachey,andMartinRichards.AlthoughCPLisnotasabstractedas
ALGOL,itdidmaintainonecharacteristicofALGOL:complexity.Martin
RichardsintroducedBasicCPL(BCPL)in1967asaleanversionofCPL.
KenThompsonofBellLabsdraftedBin1970asthesuccessortoBCPL.
Bwaslighter,faster,andmoreappropriateforsystemsprogramming.C
wasdevelopedbyDennisRitchie,alsoofBellLabs,in1972.Creturned
someoftheabstractionremovedfromBwhilekeepingthatlanguage
simpleandquick.AlthoughinitiallyconsignedtotheUNIXoperation
systemandsystemsprogramming,Cisageneral-purposelanguageand
hasbeenusedforadiverseassortmentofapplicationsacrossavariety
ofplatformsandoperatingsystems.
FORTAN,ALGOL,andCOBOLdominatedtheproceduralprogramming
landscapeinthe1960s.Onaseparatetrack,Simulawascreated
between1962and1965byOle-JohanDahlandKristenNygaardatthe
NorwegianComputingCenter.Simulaisnotableforbeingthefirstobjectorientedprogramming(OOP)language.Itwasdesignedforsimulation,
butevolvedintoageneral-purposelanguage.Simulaintroducedthe
importantOOPconceptsofclasses,inheritance,anddynamicbinding.
CombiningaspectsofCandSimula,BjarneStroustrupintroducedCwith
Classesin1979asanenhancementoftheCprogramminglanguage.
Later,underStroustrup'sstewardship,C++wascreatedasadirect
descendantofCwithClassesandwaspubliclyrecognizedin1983.C++
rapidlybecamethepremierobject-orientedprogramminglanguageand


introducedstructuredexceptionhandling,templates,andmuchmore.
C#premieredattheProfessionalDevelopersConference(PDC)heldin
Orlando,Florida,in2000.TheprimaryarchitectsofC#wereAnders
Hejlsberg,ScottWiltamuth,PeterSollichy,EricGunnerson,andPeter

Golde.C#wasdesignedtobeafullyobject-orientedlanguagefocusing
ondevelopingcomponentsinadistributedenvironmentandwas
launchedaspartofalargerinitiativebyMicrosoftcalledMicrosoft.NET.
Underscoringtheimportanceof.NETtoMicrosoft,BillGateswasthe
keynotespeakeratthePDCthatyear.IattendedthePDCin2000and
wasbothintriguedandmotivatedbytheintroductionof.NETandC#.
.NETisemblematicofaphilosophicalchangeatMicrosoftandan
embracingofthestandardscommunity.
Both.NET,asdefinedbytheCommonLanguageInfrastructure(CLI),
andC#weresubmittedtotwointernationalstandardsorganizations:
ECMAandISO/IEC.Also,.NETand.NETlanguages,describedinthe
CommonLanguageSpecification(CLS),continuethetrendtowardtruly
portablecode.Youcanwriteanapplicationinoneenvironmentandrunit
anywhereelse.Simultaneously,anewversionofMicrosoftVisualStudio
wasannounced:VisualStudio.NET.VisualStudio.NETprovidesrapid
applicationdevelopmenttoolsfordevelopingawidevarietyof.NET
applications.
More ForinformationonthevariousstandardsforC#and.NET,follow
Info theselinks.ThecurrentECMAstandardsfortheC#Language
Specification:The
currentECMAstandardsfortheCommonLanguage
Infrastructure:The
currentISO/IECstandardsfortheC#LanguageSpecification:
/>CSNUMBER=36768&ICS1=35&ICS2=60&ICS3=.Thecurrent
ISO/IECstandardsfortheCLI:
/>CSNUMBER=36769&scopelist=.


×