Index
[]abstract classesAdd methodAddNode methodAND operatorappdomainAppendText methodapplicationapplication configuration fileapplicationsarraysas operatorASCIIEncoding classASP.NETASP.NET pagesassembliesAssert methodasynchronous delegatesattributesAttributes property
Index
[]base10Base64 databinary dataBinarySearch methodbit flagsbooksBoolean logicbyte arraybyte data type
Index
[]C#cacheobjectscallbackscarriage return character (\r)carriage returnscase sensitivitycastingCelsius temperaturescharacterscircular referencesclassesClone methodcollectionCOM componentscommentscomparison operatorscompilingconstructorsContains methodCountChildren methodCreate methodCreationTime property
Index
[]datadata typesDateTime classdefault constructordegreesmulticastDelete methoddesign patternsdouble type
Dedication
Jay
To Owen and Drew,
Thank you for teaching me how to be a kid again
I love you both,
Daddy
Steve
To my two loving sons, Patrick and Nicholas Teilhet
Index
[]entry pointsEnum classequality operator (==)Equals methodequationserror handlingevent logseventsexception event handlerpreventingpreventing unhandledexceptionsexpressions
Index
[]false operatorfieldsfilesFileSystemWatcher objectfloating-point valuesforeach loopforeach loopsForEach methodForm classFTP
Index
[]garbage collectorGetBytes methodGetDirectories methodGetFiles methodGetProcesses methodGetString methodGUIDs
Index
[]hash valuesHashtableObservers classhostnameHRESULTsHTML
Index
[]I/O (input/output)IConvertible interfaceIEEE standardsIFormattable interfaceIIS (Internet Information Server)indexersIndexOf methodinheritanceInnerException propertyint typeintegersinterfacesInternetinteroperation with COMclassesInvoke methodis operatoriterating over elements from first to lastContainer class
Index
[]Join method
Index
[]key/value pairs
Index
[]language-neutral conversionssimple typeslanguagesLine classline-terminating charactersList classlistslocal variableslogging
Index
[]machine.config filemanaged codeMath classMedia classmembersmethodsMove methodMoveTo methodmulticast delegatesMultiMap class
Index
[].NET Framework Class Library (.NET FCL)NTFS filesystem numbers numeric values NumOfChildren property
Index
[]obfuscatorsobject-oriented programmingobjectsstored in arraysoffsetsOpen methodOpenText methodoperating systemsoperatorsout parameteroverloaded operatorsoverloading methodsoverriding methods
Index
[]parameterspathsperformanceperformance counterspermissionspointerspolymorphismclassesportspriorityprocesses
Index
[]queues
Index
[]radiansRead methodreference typesRegister methodregistryRegistryKey classreplacing Stack objects with generic StackStack classreplacing with generic DictionaryHashtable classreserved wordsresourcesruntime environment
Index
[]sbyte typesearchessearchingevent logssecurityserializationserversSetCreationTime methodsortingSplit methodstandard outputStart methodstatic fieldsstring classstringsswitch statements
Index
[]!= (inequality operator)&& (logical AND) operator'- (hyphen)( ) (parentheses): (colon)== (equality operator)\ (backslash)_items array
Index
[]threadingtimestampstreestrue operatortry/catch blocktry/catch blocksType classtype safetytypes
Index
[]understandinggeneric typesunhandled exceptionsunsafe codeURI (Uniform Resource Identifier)URL
Index
[]value typesvariablesversioningvisualizers
Index
[]web applicationsweb pagesweb serverweb.config filewildcardsWindowsWindows operating systemWinForms applicationsWinForms-basedWriteLine method
Index
[]XMLXML filesXmlDocument classXSLT
Index
[]
Index
[]
Colophon
The animal on the cover of C# Cookbook is a garter snake ( Thamnophis sirtalis ). Named because their longitudinal stripes resemble those on garters once used to hold up men's socks, garter snakes are easily identified by their distinctive stripes: a narrow stripe down the middle of the back with a broad stripe on each side of it. Color and pattern variations enable them to blend into their native environments, helping them evade predators. They are the most common snake in North America and the only species of snake found in Alaska.
Garter snakes have keeled scales--one or more ridges down the central axis of the scales--giving them a rough texture and lackluster appearance. Adult garter snakes generally range in length between 46 and 130 centimeters (one and a half feet to over four feet). Females are usually larger than males, with shorter tails and a bulge where the body and tail meet.
Female garters are ovoviviparous, meaning they deliver "live" young that have gestated in soft eggs. Upon delivery, most of the eggs and mucous membranes have broken, which makes their births appear live. Occasionally, a baby will be born still inside its soft shell. A female will usually deliver 10 to 40 babies: the largest recorded number of live babies birthed by a garter snake is 98. Once emerging from their mothers, baby garters are completely independent and must begin fending for themselves. During this time they are most susceptible to predation, and over half of all baby garters die before they are one year old.
Garter snakes are one of the few animals able to eat toads, newts, and other amphibians with strong chemical defenses. Although diets vary depending on their environments, garter snakes mostly eat earthworms and amphibians; however, they occasionally dine on baby birds, fish, and small rodents. Garter snakes have toxic saliva (harmless to humans), which they use to stun or kill their prey before swallowing them whole.
The cover image is from a 19th-century engraving from the Dover Pictorial Archive.The cover font is Adobe ITC Garamond. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed..
Introduction
lists the simple types and their fully qualified names in the .NET Framework.
Table 1-1. The simple data types
Fully qualified name | Alias | Value range |
---|
System.Boolean | bool | true or false |
System.Byte | byte | 0 to 255 |
System.SByte | sbyte | -128 to 127 |
System.Char | char | 0 to 65535 |
System.Decimal | decimal | -79,228,162,514,264,337,593,543,950,335 to 79,228,162,514,264,337,593,543,950,335 |
System.Double | double | -1.79769313486232e308 to 1.79769313486232e308 |
System.Single | float | -3.40282347E+38 to 3.40282347E+38 |
System.Int16 | short | -32768 to 32767 |
System.Uint16 | ushort | 0 to 65535 |
System.Int32 | int | -2,147,483,648 to 2,147,483,647 |
System.UInt32 | uint | 0 to 4,294,967,295 |
System.Int64 | long | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
System.UInt64 | ulong | 0 to 18,446,744,073,709,551,615 |