Friday, September 24, 2010

Convert HTML table to DataSet while downloading data from another site

Convert HTML table to DataSet while downloading data from another site


Just imagine a situation while you are downloading the data from another site using

System.Net.WebClient client = new System.Net.WebClient();

  string st = client.DownloadString(strURL);

or directly if you find a HTML table there and you want to add that table to dataset for further processing.this function will help you for that using regular expressions.


private DataSet ConvertHTMLTablesToDataSet(String HTML)

{

DataSet ds = new DataSet();

try

{



DataTable dt = new DataTable();

DataRow dr;

DataColumn dc;

string TableExpression = "<table[^>]*>(.*?)</table>";

string HeaderExpression = "<th[^>]*>(.*?)</th>";

string RowExpression = "<tr[^>]*>(.*?)</tr>";

string ColumnExpression = "<td[^>]*>(.*?)</td>";

bool HeadersExist = false;

int iCurrentColumn = 0;

int iCurrentRow = 0;

//Get a match for all the tables in the HTML

MatchCollection Tables = Regex.Matches(HTML, TableExpression, RegexOptions.IgnoreCase);

//Loop through each table element

foreach (Match Table in Tables)

  {

  // Reset the current row counter and the header flag

  iCurrentRow = 0;

  HeadersExist = false;

  //Add a new table to the DataSet

  dt = new DataTable();

  // Create the relevant amount of columns for this table (use the headers if they exist, otherwise use default names)

if (Table.Value.ToString().Contains("<th"))

  {

  // Set the HeadersExist flag

HeadersExist = true;

  // Get a match for all the rows in the table

  MatchCollection Headers = Regex.Matches(Table.Value, HeaderExpression, RegexOptions.IgnoreCase);

  // Loop through each header element

  foreach (Match Header in Headers)

  {

  dt.Columns.Add(Header.Groups[1].ToString());

  }

  }

  else

  {

  for (int iColumns = 1; iColumns <= Regex.Matches(Regex.Matches(Regex.Matches(Table.Value, TableExpression, RegexOptions.IgnoreCase)[0].Value.ToString(), RowExpression, RegexOptions.IgnoreCase)[0].Value.ToString(), ColumnExpression, RegexOptions.IgnoreCase).Count; iColumns++)

  {

  dt.Columns.Add("Column " + iColumns);

  }

}

//Get a match for all the rows in the table

  MatchCollection Rows = Regex.Matches(Table.Value, RowExpression, RegexOptions.IgnoreCase);

  //Loop through each row element

  foreach (Match Row in Rows)

  {

  //Only loop through the row if it isn't a header row

  if (!(iCurrentRow == 0 && HeadersExist == true))

  {

  //Create a new row and reset the current column counter

  dr = dt.NewRow();

  iCurrentColumn = 0;

  // Get a match for all the columns in the row

  MatchCollection Columns = Regex.Matches(Row.Value, ColumnExpression, RegexOptions.IgnoreCase);

  // Loop through each column element

  foreach (Match Column in Columns)

  {

  //Add the value to the DataRow

  dr[iCurrentColumn] = Column.Groups[1].ToString();

  //Increase the current column

  iCurrentColumn += 1;

  }

dt.Rows.Add(dr);

//Add the DataRow to the DataTable

}

  // Increase the current row counter

  iCurrentRow += 1;

  }

// Add the DataTable to the DataSet

ds.Tables.Add(dt);

  }

  }

  catch { }

  finally { }

  return ds;

  }

Numeric Paging with asp.net menu control

Paging with asp.net menu control

Just pass  the total number of records, currently displayed record and menu control. 
  if you want to display like 10 number for paging.If i select page number 15 this will fill the menu from 10 to 20 etc.

i.e. 
  1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
12 13 14 15 16 17 18 19 20 21 

public void fillmenu(int tot, int value, Menu menu)
{
if (tot > 100)
  {
  int page_count = 0;
  if (tot % 10 == 0)
  page_count = tot / 10;
  else
  page_count = tot / 10 + 1;
  if (menu.SelectedValue == "" || menu.SelectedValue == null)
  {
  menu.Items.Clear();
  for (int i = 1; i <= 10; i++)
  {
  string text = "";
  if (i == value)
  {
  text = i.ToString();
  MenuItem mi = new MenuItem(text, i.ToString());
  mi.Selected = true;

  menu.Items.Add(mi);
  }
  else
  {
  text = i.ToString();
  MenuItem mi = new MenuItem(text, i.ToString());
  menu.Items.Add(mi);
  }
MenuItem mi1 = new MenuItem(text, i.ToString());
  menu.Items.Add(mi1);
}
  menu.Items.Add(new MenuItem(".....", ""));
  menu.Items[10].Selectable = false;
  MenuItem mi3 = new MenuItem((page_count).ToString(), (page_count).ToString());
  menu.Items.Add(mi3);
}
  else
  {
  if (Convert.ToInt32(menu.SelectedValue) <= 5)
  {
}
  else if (value > page_count - 5)
  {
  menu.Items.Clear();
  for (int i = page_count - 10; i <= page_count; i++)
  {
  string text = "";
  if (value == i)
  {
  text = i.ToString();
  MenuItem mi = new MenuItem(text, i.ToString());
  mi.Selected = true;
  menu.Items.Add(mi);
  }
  else
  {
  text = i.ToString();
  MenuItem mi = new MenuItem(text, i.ToString());
  menu.Items.Add(mi);
  }
  }
  }
  else
  {
  int sel = Convert.ToInt32(menu.SelectedValue);

  menu.Items.Clear();

  for (int i = sel - 4; i <= sel + 5; i++)

  {

  string text = "";

  if (value == i)

  {

  text = i.ToString();

  MenuItem mi = new MenuItem(text, i.ToString());

  mi.Selected = true;

  menu.Items.Add(mi);

  }

  else

  {

  text = i.ToString();

  MenuItem mi = new MenuItem(text, i.ToString());

  menu.Items.Add(mi);

  }

}

menu.Items.Add(new MenuItem(".....", ""));

  menu.Items[10].Selectable = false;

  MenuItem mi2 = new MenuItem((page_count).ToString(), (page_count).ToString());

  menu.Items.Add(mi2);

  }

  }

  }

  else

  {

 menu.Items.Clear();

  for (int i = 1; i <= tot / 10 + 1; i++)

  {

  string text = "";

  if (i == value)

  {

  text = i.ToString();

  MenuItem mi = new MenuItem(text, i.ToString());

  mi.Selected = true;

  menu.Items.Add(mi);

  }

  else

  {

  text = i.ToString();

  MenuItem mi = new MenuItem(text, i.ToString());

  menu.Items.Add(mi);

  }

  }

  }
  }

Clear all values of textbox and checkbox from a particular asp.net page

Make the asp.net controls clear


If you want to clear the asp.net controls like textbox and textbox.

This function clears whole occurence of the the defined controls.

Just past the Varaible parent as 'this' , which will clear the whole controls from that particular page which are defined in this function.



public void ClearControls(Control parent)

{

foreach (Control _ChildControl in parent.Controls)

{

if ((_ChildControl.Controls.Count > 0))

{

ClearControls(_ChildControl);

}

else

{

if (_ChildControl is TextBox)

{

((TextBox)_ChildControl).Text = string.Empty;

}

else

if (_ChildControl is CheckBox)

{

((CheckBox)_ChildControl).Checked = false;

}

}

  }

  }

Image Resizing in asp.net c#

Resizing the image in asp.net C#

This is a very simple example for image resizing while uploading through fileupload control.


//OriginalFile - Path for the original image
//NewFile - Path for the New image
//NewWidth - Define new width
//MaxHeight - Define MAX Height
//OnlyResizeIfWider - True if you want to resize images which have greater dimensions from defined new dimensions.
public void ResizeImage(string OriginalFile, string NewFile, int NewWidth, int MaxHeight, bool OnlyResizeIfWider)

{

System.Drawing.Image FullsizeImage = System.Drawing.Image.FromFile(OriginalFile);
// Prevent using images internal thumbnail

FullsizeImage.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);

FullsizeImage.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);
if (OnlyResizeIfWider)

{

if (FullsizeImage.Width <= NewWidth)

{

NewWidth = FullsizeImage.Width;

}

}
int NewHeight = FullsizeImage.Height * NewWidth / FullsizeImage.Width;

if (NewHeight > MaxHeight)

{

// Resize with height instead

NewWidth = FullsizeImage.Width * MaxHeight / FullsizeImage.Height;

NewHeight = MaxHeight;

}
System.Drawing.Image NewImage = FullsizeImage.GetThumbnailImage(NewWidth, NewHeight, null, IntPtr.Zero);
// Clear handle to original file so that we can overwrite it if necessary

FullsizeImage.Dispose();
// Save resized picture

NewImage.Save(NewFile);

}

Thursday, September 16, 2010

ASP ServerVariables Collection

ASP ServerVariables Collection


The ServerVariables collection is used to retrieve the server variable values.

Syntax

Request.ServerVariables (server_variable)


Parameter Description
server_variable Required. The name of the server variable to retrieve

Server Variables

Variable Description
ALL_HTTP Returns all HTTP headers sent by the client. Always prefixed with HTTP_ and capitalized
ALL_RAW Returns all headers in raw form
APPL_MD_PATH Returns the meta base path for the application for the ISAPI DLL
APPL_PHYSICAL_PATH Returns the physical path corresponding to the meta base path
AUTH_PASSWORD Returns the value entered in the client's authentication dialog
AUTH_TYPE The authentication method that the server uses to validate users
AUTH_USER Returns the raw authenticated user name
CERT_COOKIE Returns the unique ID for client certificate as a string
CERT_FLAGS bit0 is set to 1 if the client certificate is present and bit1 is set to 1 if the cCertification authority of the client certificate is not valid
CERT_ISSUER Returns the issuer field of the client certificate
CERT_KEYSIZE Returns the number of bits in Secure Sockets Layer connection key size
CERT_SECRETKEYSIZE Returns the number of bits in server certificate private key
CERT_SERIALNUMBER Returns the serial number field of the client certificate
CERT_SERVER_ISSUER Returns the issuer field of the server certificate
CERT_SERVER_SUBJECT Returns the subject field of the server certificate
CERT_SUBJECT Returns the subject field of the client certificate
CONTENT_LENGTH Returns the length of the content as sent by the client
CONTENT_TYPE Returns the data type of the content
GATEWAY_INTERFACE Returns the revision of the CGI specification used by the server
HTTP_<HeaderName> Returns the value stored in the header HeaderName
HTTP_ACCEPT Returns the value of the Accept header
HTTP_ACCEPT_LANGUAGE Returns a string describing the language to use for displaying content
HTTP_COOKIE Returns the cookie string included with the request
HTTP_REFERER Returns a string containing the URL of the page that referred the request to the current page using an <a> tag. If the page is redirected, HTTP_REFERER is empty
HTTP_USER_AGENT Returns a string describing the browser that sent the request
HTTPS Returns ON if the request came in through secure channel or OFF if the request came in through a non-secure channel
HTTPS_KEYSIZE Returns the number of bits in Secure Sockets Layer connection key size
HTTPS_SECRETKEYSIZE Returns the number of bits in server certificate private key
HTTPS_SERVER_ISSUER Returns the issuer field of the server certificate
HTTPS_SERVER_SUBJECT Returns the subject field of the server certificate
INSTANCE_ID The ID for the IIS instance in text format
INSTANCE_META_PATH The meta base path for the instance of IIS that responds to the request
LOCAL_ADDR Returns the server address on which the request came in
LOGON_USER Returns the Windows account that the user is logged into
PATH_INFO Returns extra path information as given by the client
PATH_TRANSLATED A translated version of PATH_INFO that takes the path and performs any necessary virtual-to-physical mapping
QUERY_STRING Returns the query information stored in the string following the question mark (?) in the HTTP request
REMOTE_ADDR Returns the IP address of the remote host making the request
REMOTE_HOST Returns the name of the host making the request
REMOTE_USER Returns an unmapped user-name string sent in by the user
REQUEST_METHOD Returns the method used to make the request
SCRIPT_NAME Returns a virtual path to the script being executed
SERVER_NAME Returns the server's host name, DNS alias, or IP address as it would appear in self-referencing URLs
SERVER_PORT Returns the port number to which the request was sent
SERVER_PORT_SECURE Returns a string that contains 0 or 1. If the request is being handled on the secure port, it will be 1. Otherwise, it will be 0
SERVER_PROTOCOL Returns the name and revision of the request information protocol
SERVER_SOFTWARE Returns the name and version of the server software that answers the request and runs the gateway
URL Returns the base portion of the URL

Friday, September 10, 2010

Table of SQL Keywords and Descriptions

SQL Keywords

 

Table of SQL Keywords and Descriptions


Code Description
ABORT Aborts the current transaction
ALTER TABLE Modifies table properties
ALTER USER Modifies user account information
BEGIN WORK Begins a transaction
CLOSE Close a cursor
CLUSTER Gives storage clustering advice to the backend
COMMIT Commits the current transaction
COPY Copies data between files and tables
CREATE AGGREGATE Defines a new aggregate function
CREATE DATABASE Creates a new database
CREATE FUNCTION Defines a new function
CREATE INDEX Constructs a secondary index
CREATE LANGUAGE Defines a new language for functions
CREATE OPERATOR Defines a new user operator
CREATE RULE Defines a new rule
CREATE SEQUENCE Creates a new sequence number generator
CREATE TABLE Creates a new table
CREATE TABLE AS Creates a new table
CREATE TRIGGER Creates a new trigger
CREATE TYPE Defines a new base data type
CREATE USER Creates account information for a new user
CREATE VIEW Constructs a virtual table
DECLARE Defines a cursor for table access
DELETE Deletes rows from a table
DROP AGGREGATE Removes the definition of an aggregate function
DROP DATABASE Destroys an existing database
DROP FUNCTION Removes a user-defined C function
DROP INDEX Removes an index from a database
DROP LANGUAGE Removes a user-defined procedural language
DROP OPERATOR Removes an operator from the database
DROP RULE Removes an existing rule from the database
DROP SEQUENCE Removes an existing sequence
DROP TABLE Removes existing tables from a database
DROP TRIGGER Removes the definition of a trigger
DROP TYPE Removes a user-defined type from the system catalogs
DROP USER Removes an user account information
DROP VIEW Removes an existing view from a database
EXPLAIN Shows statement execution details
FETCH Gets rows using a cursor
GRANT Grants access privilege to a user, a group or all users
INSERT Inserts new rows into a table
LISTEN Listen for notification on a notify condition
LOAD Dynamically loads an object file
LOCK Explicit lock of a table inside a transaction
MOVE Moves cursor position
NOTIFY Signals all frontends and backends listening on a notify condition
RESET Restores run-time parameters for session to default values
REVOKE
Revokes access privilege from a user, a group or all users.
ROLLBACK Aborts the current transaction
SELECT Retrieve rows from a table or view
SELECT INTO Create a new table from an existing table or view
SET Set run-time parameters for session
SHOW Shows run-time parameters for session
UNLISTEN Stop listening for notification
UPDATE Replaces values of columns in a table

Extended Binary-Coded Decimal Interchange Code(EBCDIC)

EBCDIC Table

 

EBCDIC stands for Extended Binary-Coded Decimal Interchange Code


Dec Hex Code Dec Hex Code Dec Hex Code Dec Hex Code
0 00 NUL 32 20   64 40 space 96 60 -
1 01 SOH 33 21   65 41   97 61 /
2 02 STX 34 22   66 42   98 62  
3 03 ETX 35 23   67 43   99 63  
4 04   36 24   68 44   100 64  
5 05 HT 37 25 LF 69 45   101 65  
6 06   38 26 ETB 70 46   102 66  
7 07 DEL 39 27 ESC 71 47   103 67  
8 08   40 28   72 48   104 68  
9 09   41 29   73 49   105 69  
10 0A   42 2A   74 4A [ 106 6A |
11 0B VT 43 2B   75 4B . 107 6B ,
12 0C FF 44 2C   76 4C < 108 6C %
13 0D CR 45 2D ENQ 77 4D ( 109 6D _
14 0E SO 46 2E ACK 78 4E + 110 6E >
15 0F SI 47 2F BEL 79 4F | ! 111 6F ?
16 10 DLE 48 30   80 50 & 112 70  
17 11   49 31   81 51   113 71  
18 12   50 32 SYN 82 52   114 72  
19 13   51 33   83 53   115 73  
20 14   52 34   84 54   116 74  
21 15   53 35   85 55   117 75  
22 16 BS 54 36   86 56   118 76  
23 17   55 37 EOT 87 57   119 77  
24 18 CAN 56 38   88 58   120 78  
25 19 EM 57 39   89 59   121 79
26 1A   58 3A   90 5A ! ] 122 7A :
27 1B   59 3B   91 5B $ 123 7B #
28 1C IFS 60 3C   92 5C * 124 7C @
29 1D IGS 61 3D NAK 93 5D ) 125 7D
30 1E IRS 62 3E   94 5E ; 126 7E =
31 1F IUS 63 3F SUB 95 5F ^ 127 7F "

 

Dec Hex Code Dec Hex Code Dec Hex Code Dec Hex Code
128 80   160 A0   192 C0 { 224 E0 \
129 81 a 161 A1 ~ 193 C1 A 225 E1  
130 82 b 162 A2 s 194 C2 B 226 E2 S
131 83 c 163 A3 t 195 C3 C 227 E3 T
132 84 d 164 A4 u 196 C4 D 228 E4 U
133 85 e 165 A5 v 197 C5 E 229 E5 V
134 86 f 166 A6 w 198 C6 F 230 E6 W
135 87 g 167 A7 x 199 C7 G 231 E7 X
136 88 h 168 A8 y 200 C8 H 232 E8 Y
137 89 i 169 A9 z 201 C9 I 233 E9 Z
138 8A   170 AA   202 CA   234 EA  
139 8B   171 AB   203 CB   235 EB  
140 8C   172 AC   204 CC   236 EC  
141 8D   173 AD   205 CD   237 ED  
142 8E   174 AE   206 CE   238 EE  
143 8F   175 AF   207 CF   239 EF  
144 90   176 B0   208 D0 } 240 F0 0
145 91 j 177 B1   209 D1 J 241 F1 1
146 92 k 178 B2   210 D2 K 242 F2 2
147 93 l 179 B3   211 D3 L 243 F3 3
148 94 m 180 B4   212 D4 M 244 F4 4
149 95 n 181 B5   213 D5 N 245 F5 5
150 96 o 182 B6   214 D6 O 246 F6 6
151 97 p 183 B7   215 D7 P 247 F7 7
152 98 q 184 B8   216 D8 Q 248 F8 8
153 99 r 185 B9   217 D9 R 249 F9 9
154 9A   186 BA   218 DA   250 FA  
155 9B   187 BB   219 DB   251 FB  
156 9C   188 BC   220 DC   252 FC  
157 9D   189 BD   221 DD   253 FD  
158 9E   190 BE   222 DE   254 FE  
159 9F   191 BF   223 DF   255 FF  

Table of Delphi keywords and Descriptions

Table of Delphi keywords and Descriptions



Delphi Keywords

 
Table of Delphi keywords and Descriptions. Delphi was a language developed by the Borland Corporation in the 1990’s. It is an object oriented language that resembles Pascal. The Delphi keywords reflect it’s origins as an off shoot of the Pascal language. The following Delphi keywords are the building blocks of the programming language. A Delphi program is constructed by creating a syntactically and procedurally correct program file that can be compiled by the Delphi compiler.

Code Description
And Boolean and or bitwise and of two arguments
Array A data type holding indexable collections of data
As Used for casting object references
Begin Keyword that starts a statement block
Case A mechanism for acting upon different values of an Ordinal
Class Starts the declaration of a type of object class
Const Starts the definition of fixed data values
Constructor Defines the method used to create an object from a class
Destructor Defines the method used to destroy an object
Div Performs integer division, discarding the remainder
Do Defines the start of some controlled action
DownTo Prefixes an decremental for loop target value
Else Starts false section of if, case and try statements
End Keyword that terminates statement blocks
Except Starts the error trapping clause of a Try statement
File Defines a typed or untyped file
Finally Starts the unconditional code section of a Try statement
For Starts a loop that executes a finite number of times
Function Defines a subroutine that returns a value
Goto Forces a jump to a label, regardless of nesting
If Starts a conditional expression to determine what to do next
Implementation Starts the implementation (code) section of a Unit
In Used to test if a value is a member of a set
Inherited Used to call the parent class constructor or destructor method
Interface Used for Unit external definitions, and as a Class skeleton
Is Tests whether an object is a certain class or ascendant
Mod Performs integer division, returning the remainder
Not Boolean Not or bitwise not of one arguments
Object Allows a subroutine data type to refer to an object method
Of Linking keyword used in many places
On Defines exception handling in a Try Except clause
Or Boolean or or bitwise or of two arguments
Packed Compacts complex data types into minimal stor
Procedure Defines a subroutine that does not return a value
Program Defines the start of an application
Property Defines controlled access to class fields
Raise Raise an exception
Record A structured data type - holding fields of data
Repeat Repeat statements until a ternmination condition is met
Set Defines a set of up to 255 distinct values
Shl Shift an integer value left by a number of bits
Shr Shift an integer value right by a number of bits
Then Part of an if statement - starts the true clause
ThreadVar Defines variables that are given separate instances per thread
To Prefixes an incremental for loop target value
Try Starts code that has error trapping
Type Defines a new category of variable or process
Unit Defines the start of a unit file - a Delphi module
Until Ends a Repeat control loop
Uses Declares a list of Units to be imported
Var Starts the definition of a section of data variables
While Repeat statements whilst a continuation condition is met
With A means of simplifying references to structured variables
Xor Boolean Xor or bitwise Xor of two arguments

Table of C# keywords and Descriptions

C# Keywords Table

C# Keywords Table

 

Table of C# keywords and Descriptions. C# was a language developed by the Microsoft Corporation in the late 1990’s. It is an object oriented language that resembles both C and Java. The C# keywords reflect it’s origins as an off shoot of the C language. The following C# keywords are the building blocks of the programming language. A C# program is constructed by creating a syntactically and procedurally correct program file that can be compiled by a C# compiler.


Code Description
abstract The abstract modifier can be used with classes, methods, properties, indexers, and events.
as The as operator is used to perform conversions between compatible types.
base The base keyword is used to access members of the base class from within a derived class
bool The bool keyword is an alias of System.Boolean. It is used to declare variables to store the Boolean values, true and false.
break The break statement terminates the closest enclosing loop or switch statement in which it appears.
byte The byte keyword denotes an integral type that stores values as indicated in the following table.
case The switch statement is a control statement that handles multiple selections by passing control to one of the case statements within its body.
catch The try-catch statement consists of a try block followed by one or more catch clauses, which specify handlers for different exceptions.
char The char keyword is used to declare a Unicode character in the range indicated in the following table.
checked The checked keyword is used to control the overflow-checking context for integral-type arithmetic operations and conversions.
class Classes are declared using the keyword class.
const The const keyword is used to modify a declaration of a field or local variable.
continue The continue statement passes control to the next iteration of the enclosing iteration statement in which it appears.
decimal The decimal keyword denotes a 128-bit data type.
default The switch statement is a control statement that handles multiple selections by passing control to one of the case statements within its body.
delegate A delegate declaration defines a reference type that can be used to encapsulate a method with a specific signature.
do The do statement executes a statement or a block of statements repeatedly until a specified expression evaluates to false.
double The double keyword denotes a simple type that stores 64-bit floating-point values.
else The if-else statement selects a statement for execution based on the value of a Boolean expression.
enum The enum keyword is used to declare an enumeration, a distinct type consisting of a set of named constants called the enumerator list.
event

Specifies an event.

explicit The explicit keyword is used to declare an explicit user-defined type conversion operator
extern Use the extern modifier in a method declaration to indicate that the method is implemented externally.
false In C#, the false keyword can be used as an overloaded operator or as a literal
finally The finally block is useful for cleaning up any resources allocated in the try block.
fixed Prevents relocation of a variable by the garbage collector.
float The float keyword denotes a simple type that stores 32-bit floating-point values.
for The for loop executes a statement or a block of statements repeatedly until a specified expression evaluates to false.
foreach The foreach statement repeats a group of embedded statements for each element in an array or an object collection.
goto The goto statement transfers the program control directly to a labeled statement.
if The if statement selects a statement for execution based on the value of a Boolean expression.
implicit The implicit keyword is used to declare an implicit user-defined type conversion operator.
in The foreach,in statement repeats a group of embedded statements for each element in an array or an object collection.
int The int keyword denotes an integral type that stores values according to the size and range shown in the following table.
interface An interface defines a contract. A class or struct that implements an interface must adhere to its contract.
internal The internal keyword is an access modifier for types and type members.
is The is operator is used to check whether the run-time type of an object is compatible with a given type.
lock The lock keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a statement, and then releasing the lock.
long The long keyword denotes an integral type that stores values according to the size and range shown in the following table.
namespace The namespace keyword is used to declare a scope. This namespace scope lets you organize code and gives you a way to create globally-unique types.
new

In C#, the new keyword can be used as an operator or as a modifier.

null The null keyword is a literal that represents a null reference, one that does not refer to any object.
object The object type is an alias for System.Object in the .NET Framework.
operator The operator keyword is used to declare an operator in a class or struct declaration.
out The out method parameter keyword on a method parameter causes a method to refer to the same variable that was passed into the method
override Use the override modifier to modify a method, a property, an indexer, or an event.
params

The params keyword lets you specify a method parameter that takes an argument where the number of arguments is variable.

private The private keyword is a member access modifier.
protected The protected keyword is a member access modifier.
public The public keyword is an access modifier for types and type members.
readonly The readonly keyword is a modifier that you can use on fields.
ref The ref method parameter keyword on a method parameter causes a method to refer to the same variable that was passed into the method.
return The return statement terminates execution of the method in which it appears and returns control to the calling method.
sbyte

The sbyte keyword denotes an integral type that stores values according to the size and range shown in the following table.

sealed A sealed class cannot be inherited.
short

The short keyword denotes an integral data type that stores values according to the size and range shown in the following table.

sizeof The sizeof operator is used to obtain the size in bytes for a value type.
stackalloc

Allocates a block of memory on the stack.

static Use the static modifier to declare a static member, which belongs to the type itself rather than to a specific object.
string The string type represents a string of Unicode characters.
struct A struct type is a value type that can contain constructors, constants, fields, methods, properties, indexers, operators, events, and nested types.
switch The switch statement is a control statement that handles multiple selections by passing control to one of the case statements within its body.
this The this keyword refers to the current instance of the class. Static member functions do not have a this pointer.
throw The throw statement is used to signal the occurrence of an anomalous situation (exception) during the program execution.
true

In C#, the true keyword can be used as an overloaded operator or as a literal.

try The try-catch statement consists of a try block followed by one or more catch clauses, which specify handlers for different exceptions.
typeof The typeof operator is used to obtain the System.Type object for a type.
uint

The uint keyword denotes an integral type that stores values according to the size and range shown in the following table.

ulong

The ulong keyword denotes an integral type that stores values according to the size and range shown in the following table.

unchecked The unchecked keyword is used to control the overflow-checking context for integral-type arithmetic operations and conversions.
unsafe

The unsafe keyword denotes an unsafe context, which is required for any operation involving pointers.

ushort

The ushort keyword denotes an integral data type that stores values according to the size and range shown in the following table.

using The using keyword has two major uses.
virtual The virtual keyword is used to modify a method or property declaration, in which case the method or the property is called a virtual member.
volatile

The volatile keyword indicates that a field can be modified in the program by something such as the operating system, the hardware, or a concurrently executing thread.

void

When used as the return type for a method, void specifies that the method does not return a value.

while The while statement executes a statement or a block of statements until a specified expression evaluates to false.

ASCII Table

ASCII Table

ASCII Table

 
ASCII stands for American Standard Code for Information Interchange. The ASCII character set was first published as a standard in 1967 and was last updated in 1986. The ASCII character set was mostly used by small to mid-range computers systems. The ASCII character set is the human readable representation of binary numbers. The below ASCII table shows the 33 non-printable and 95 printable characters.

Dec Hex Oct Char Description
0 0 000   null
1 1 001   start of heading
2 2 002   start of text
3 3 003   end of text
4 4 004   end of transmission
5 5 005   enquiry
6 6 006   acknowledge
7 7 007   bell
8 8 010   backspace
9 9 011   horizontal tab
10 A 012   new line
11 B 013   vertical tab
12 C 014   new page
13 D 015   carriage return
14 E 016   shift out
15 F 017   shift in
16 10 020   data link escape
17 11 021   device control 1
18 12 022   device control 2
19 13 023   device control 3
20 14 024   device control 4
21 15 025   negative acknowledge
22 16 026   synchronous idle
23 17 027   end of trans. block
24 18 030   cancel
25 19 031   end of medium
26 1A 032   substitute
27 1B 033   escape
28 1C 034   file separator
29 1D 035   group separator
30 1E 036   record separator
31 1F 037   unit separator
32 20 040   space
33 21 041 !  
34 22 042 "  
35 23 043 #  
36 24 044 $  
37 25 045 %  
38 26 046 &  
39 27 047 '  
40 28 050 (  
41 29 051 )  
42 2A 052 *  
43 2B 053 +  
44 2C 054 ,  
45 2D 055 -  
46 2E 056 .  
47 2F 057 /  
48 30 060 0  
49 31 061 1  
50 32 062 2  
51 33 063 3  
52 34 064 4  
53 35 065 5  
54 36 066 6  
55 37 067 7  
56 38 070 8  
57 39 071 9  
58 3A 072 :  
59 3B 073 ;  
60 3C 074 <  
61 3D 075 =  
62 3E 076 >  
63 3F 077 ?  
Dec Hex Oct Char
64 40 100 @
65 41 101 A
66 42 102 B
67 43 103 C
68 44 104 D
69 45 105 E
70 46 106 F
71 47 107 G
72 48 110 H
73 49 111 I
74 4A 112 J
75 4B 113 K
76 4C 114 L
77 4D 115 M
78 4E 116 N
79 4F 117 O
80 50 120 P
81 51 121 Q
82 52 122 R
83 53 123 S
84 54 124 T
85 55 125 U
86 56 126 V
87 57 127 W
88 58 130 X
89 59 131 Y
90 5A 132 Z
91 5B 133 [
92 5C 134 \
93 5D 135 ]
94 5E 136 ^
95 5F 137 _
96 60 140 `
97 61 141 a
98 62 142 b
99 63 143 c
100 64 144 d
101 65 145 e
102 66 146 f
103 67 147 g
104 68 150 h
105 69 151 i
106 6A 152 j
107 6B 153 k
108 6C 154 l
109 6D 155 m
110 6E 156 n
111 6F 157 o
112 70 160 p
113 71 161 q
114 72 162 r
115 73 163 s
116 74 164 t
117 75 165 u
118 76 166 v
119 77 167 w
120 78 170 x
121 79 171 y
122 7A 172 z
123 7B 173 {
124 7C 174 |
125 7D 175 }
126 7E 176 ~
127 7F 177 DEL