Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
C# Tutorial
Language Basics 128 codes
Home
C# Tutorial
Language Basics
1 A C# program begins with a call to Main()
2 A Closer Look at Exception
3 A custom exception with HelpLink and Source
4 A try, catch, and finally block without Exception class declaration
5 Aliasing Class Names
6 Aliasing Namespace Names
7 An exception can be generated by one method and caught by another
8 An unhandled exception
9 Array As Actual Param
10 Block scope
11 C# has the following reserved keywords
12 Catch exception with wrong type inside a function
13 Catch statement without exception variable
14 Catch System NullReferenceException
15 Change string using ref keyword
16 Check OverflowException for long
17 Commonly Used Exceptions Defined Within the System Namespace
18 Compile csharp source code in command line
19 Compiler Support Tags
20 Create your own exception class based on Exception
21 Creates a namespace with a single class
22 Creating and throwing an exception object
23 CustomException is an application exception that supports remoting
24 Declare a namespace
25 Define and assign value to variables
26 Define exception variable in catch statement
27 Demonstrate a namespace
28 Demonstrate an @ identifier
29 Demonstrate params
30 Demonstrate the
31 Derived exceptions must appear before base class exceptions
32 Dispose a StreamWriter in finally block
33 Documentation Comments for A member variable
34 Documentation Comments for a method with parameters
35 Documentation Comments for A property
36 Documentation Comments for class
37 Documentation Comments for Main function
38 Dynamic initialization
39 Exception Handling Fundamentals
40 Exception handling with trying and catching
41 Exception propagation with methods
42 Extends Exception
43 Finally block is always executed even if an exception was thrown in the try
44 Full qualify name
45 Generate an index out-of-bounds exception
46 Global Namespace Alias
47 Handle ArgumentOutOfRangeException
48 Handle error gracefully and continue
49 Handling a possible exception
50 How to handle a specific exception
51 Illustrates the use of comments
52 Let the C# runtime system handle the error
53 Lifetime of a variable
54 Looking for Command-Line Options
55 Looking for Command-Line Options (Simplified)
56 Main Entry Point
57 Manually throw an exception
58 Mix params array type with other data types
59 Namespace Introduction
60 Namespace with dot
61 Namespaces are additive
62 Namespaces can be nested
63 Namespaces prevent name conflicts
64 Objects are passed by reference
65 Out Parameters
66 Pass references to methods
67 Passing Parameters by Value
68 Passing ref-types by value
69 Passing value types by reference
70 Recommended Code Comment XML Elements
71 Ref and Out Parameters
72 Rename the namespaces
73 Rethrow an exception
74 Same class name under different Namespaces
75 Sending in args using params keyword
76 Simple Aliases for namespace
77 Simplest namespace with class definition
78 Swap two references
79 Swap two values
80 System defines the core of the C# library
81 System defines the following delegates
82 System defines the following interfaces
83 System defines the following structures
84 System defines these enumerations
85 System Exception is the base exception class All exceptions in NET are derived from System Exception
86 The C# Keywords
87 The Exception Hierarchy
88 The Main Function
89 The Scope and Lifetime of Variables
90 The System Exception Class
91 The use of namespace hierarchies
92 The use of two namespaces
93 Throw Exception from a function
94 Throw Exception in finally statement
95 Throwing an exception
96 Throwing Exceptions
97 Two levels of Namespaces
98 Use a custom Exception
99 Use a nested try block
100 Use comment in C#
101 Use fully qualified class name
102 Use multiple catch statements
103 Use out
104 Use out for reference type
105 Use out keyword (no need to assign because it is an out)
106 Use params int[]
107 Use params to mark a parameter
108 Use ref for int value
109 Use ref for reference type
110 Use ref to pass a value type by reference
111 Use ref to pass an int value type by reference
112 Use regular parameter with a params parameter
113 Use the catch all catch statement
114 Use the global alias
115 Use the NullReferenceException
116 Use two out parameters
117 User-Defined Exception Classes
118 Using a Namespace Directive
119 Using csc exe, the C# Command-Line Compiler
120 Using Exception members
121 Using finally
122 Using foreach to loop through the parameter from Main function
123 Using the alias keyword to refer to a nested namespace
124 Value types are passed by value
125 Variable definition
126 Variable-Length Parameter Lists
127 Wrap exception in another one, adding additional context
128 XML Documentation