<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-364606613135475254</id><updated>2012-01-02T08:42:03.077-08:00</updated><category term='C and VC articles'/><category term='Flash - ActionScript'/><category term='Freelance'/><category term='Free Online Services'/><category term='Web crawling'/><category term='SQL Server'/><category term='Others'/><category term='Protocols'/><category term='Dos on winxp'/><category term='Oracle'/><category term='Bài tiếng Việt'/><category term='Web 2.0'/><category term='ASP.NET'/><category term='Web service'/><category term='window service'/><category term='Whats I read'/><category term='Windows issues'/><category term='Web server'/><category term='.Net articles'/><category term='DOM Javascript HTML trick'/><category term='Networking'/><category term='HTML and JavaScript'/><category term='Multithreading'/><category term='Regular Expression'/><category term='COM interop'/><category term='Outsourcing'/><category term='window OS'/><title type='text'>Coding experience sharing...</title><subtitle type='html'>A blog about programming tips, fix bugs, collection of answer-articles for some programming issues and more...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>72</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-7681408332605462023</id><published>2008-11-26T02:01:00.000-08:00</published><updated>2008-11-26T02:01:00.722-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web service'/><title type='text'>Development  Web Service Internal with standards</title><content type='html'>&lt;h2&gt;&lt;span style="color: #274e13; font-size: small; font-weight: normal;"&gt;I found an interested guide with suggests as 'Standard' for Web Service development, it's really worthy to take reading.&lt;/span&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2&gt;Coding Standards (HTML/ASP/JavaScript)&lt;/h2&gt;In general, Web Services uses a form of Hungarian notation for file, table, field, and variable naming where the first letter of the name is lowercase and capital letters are used to divide multiple words in a name (e.g., "itemAdd.asp," "rsStudentList," "mlHours," etc.).&lt;br /&gt;&lt;h3&gt;File and folder names&lt;a class="anchorGlyph" href="" name="filenames"&gt; &lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;All folders will contain an index.html (or .shtml, .asp) file.  &lt;/li&gt;&lt;li&gt;Sites should be organized in a logical, hierarchical manner. Do not place all files in a single directory.  &lt;/li&gt;&lt;li&gt;All file names will begin with lowercase letter or a number.  &lt;/li&gt;&lt;li&gt;A letter following a number in a filename will be lowercase (e.g., "2editImage.asp").  &lt;/li&gt;&lt;li&gt;Multiple word names will be separated by a capital letter (e.g., "itemEdit.asp").  &lt;/li&gt;&lt;li&gt;Do &lt;strong&gt;not&lt;/strong&gt; use underscores ("_") or dashes ("-") in file names.  &lt;/li&gt;&lt;li&gt;Do &lt;strong&gt;not&lt;/strong&gt; use spaces in file names.  &lt;/li&gt;&lt;li&gt;Grouped pages will be begin with the same word or string (e.g., "itemAdd", "itemAdded", "itemEdit", "itemEdited"). This makes it easier to find related pages. &lt;/li&gt;&lt;li&gt;For files that use server side includes (all template-based files), .shtml will be used for the file extension, &lt;strong&gt;not&lt;/strong&gt; .htm or .html.  &lt;/li&gt;&lt;li&gt;Acronyms that are used at the beginning of a file or folder name shall be all lowercase (e.g., "atecStaffList.asp", "imcResources.shtml"). &lt;/li&gt;&lt;/ol&gt;&lt;h4&gt;Examples&lt;/h4&gt;&lt;blockquote&gt; &lt;strong&gt;Right:&lt;/strong&gt; tlpServices.shtml&lt;br /&gt;&lt;strong&gt;Wrong:&lt;/strong&gt; TLPServices.shtml&lt;br /&gt;&lt;strong&gt;Wrong:&lt;/strong&gt; tLPServices.shtml&lt;br /&gt;&lt;strong&gt;Wrong:&lt;/strong&gt; tlp-services.shtml&lt;br /&gt;&lt;strong&gt;Wrong:&lt;/strong&gt; tlp_services.shtml&lt;br /&gt;&lt;strong&gt;Wrong:&lt;/strong&gt; tlpServices.htm&lt;br /&gt;&lt;strong&gt;Wrong:&lt;/strong&gt; tlpservices.shtml&lt;/blockquote&gt;&lt;h4&gt;Standard Folder Names&lt;a class="anchorGlyph" href="" name="standardnames"&gt; &lt;/a&gt;&lt;/h4&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Image files&lt;/strong&gt; should be placed in a folder called "/images/."  &lt;ol&gt;&lt;li&gt;For sites with few images, this folder should reside at the site's root level and contain all of the site's images.  &lt;/li&gt;&lt;li&gt;For sites with many images on many pages at different levels, it may be better to create "images" folders within each subfolder of the site, and place all images used in each subfolder's pages in each "images" folder. &lt;/li&gt;&lt;li&gt;For sites that use small thumbnail images to represent larger images, all thumbnail images should reside in a "thumbnails" folder &lt;strong&gt;within&lt;/strong&gt; the "images" folder. All thumbnail images should be named &lt;strong&gt;exactly the same&lt;/strong&gt; as the full-size image file. &lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Include files&lt;/strong&gt; should be placed in a folder called "/_include/" in the root directory of the site.  &lt;/li&gt;&lt;li&gt;&lt;strong&gt;JavaScript files&lt;/strong&gt; should be placed in a folder called "/_scripts/" in the root directory of the site.  &lt;/li&gt;&lt;li&gt;&lt;strong&gt;CGI script files&lt;/strong&gt; should be placed in a folder called "/cgi-bin/" in the root directory of the site, or in the directory where the script is used. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Style sheet files&lt;/strong&gt; should be placed in a folder called "/_styles/" in the root directory of the site.  &lt;/li&gt;&lt;li&gt;Files used in &lt;strong&gt;developing&lt;/strong&gt; a new site should be placed in a folder called "/_dev/" in the root directory of the site. &lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;Variable Names (JavaScript, ASP)&lt;a class="anchorGlyph" href="" name="variables"&gt; &lt;/a&gt;&lt;/h3&gt;Variable names will also follow Hungarian notation.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;All variable names will begin with lowercase letter (no numbers).  &lt;/li&gt;&lt;li&gt;Multiple word names will be separated by a capital letter (e.g., "firstName").  &lt;/li&gt;&lt;li&gt;Do not use underscores ("_") or dashes ("-") in variable names.  &lt;/li&gt;&lt;li&gt;Avoid non-descriptive or highly abbreviated variable names; spell out what each variable stands for (e.g., "firstName" not "fn"); "i" or "x" are fine when just running a "for" loop. &lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;HTML/ASP formatting&lt;a class="anchorGlyph" href="" name="formatting"&gt; &lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;All pages, where practical, should be converted to XHTML Transitional and validated.  &lt;/li&gt;&lt;li&gt;All ASP code (including Response.Write statements) should generate valid XHTML.  &lt;/li&gt;&lt;li&gt;The first letter of all words within ASP commands and statements should be capitalized. (e.g. "Do While Not...", "Response.Write(...") &lt;/li&gt;&lt;li&gt;All connections will use an include file.  &lt;/li&gt;&lt;li&gt;With a few exceptions, all recordset declarations will be placed above the  tag at the top of the document.  &lt;/li&gt;&lt;li&gt;All recordset names will begin with "rs" (e.g., "rsItemInfo").  &lt;/li&gt;&lt;li&gt;All pages that use a connection shall close the connection at the end of the page (below the tag).  &lt;/li&gt;&lt;li&gt;All QueryString variables will have an identifier (e.g., "itemEdit.asp?itemID=33", NOT "itemEdit.asp?33").  &lt;/li&gt;&lt;li&gt;Variable, recordset, and querystring identifier names will  &lt;ol&gt;&lt;li&gt;Begin with a lowercase letter  &lt;/li&gt;&lt;li&gt;Use capital letters to divide words within the variable (e.g., "userFirstName")  &lt;/li&gt;&lt;li&gt;Not use underscores &lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;If the first letter is part of an acronym, the whole acronym will be lowercase (e.g., "sqlString," not "sQLString").  &lt;/li&gt;&lt;li&gt;All but the shortest statements should include some inline documentation explaining their purpose.  &lt;/li&gt;&lt;li&gt;Multi-line statements should be clearly formatted with brackets separated from code:  &lt;span class="code"&gt;&amp;lt;%&lt;br /&gt;&amp;nbsp;&amp;nbsp;If aspStatement Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;?&lt;br /&gt;&amp;nbsp;&amp;nbsp;?&lt;br /&gt;&amp;nbsp;&amp;nbsp;End If&lt;br /&gt;%&amp;gt;&lt;/span&gt;&lt;a href="file:///C:/Documents%20and%20Settings/Huynh%20Nhan/Desktop/Personal/BlogEn/code.html#top"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;Cascading Style Sheets&lt;a class="anchorGlyph" href="" name="css"&gt; &lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Style names will be all lowercase (caps are not allowed for XHTML validation), with no underscores.  &lt;/li&gt;&lt;li&gt;Styles shall be used exclusively for formatting (all  tags should be removed from all documents).  &lt;/li&gt;&lt;li&gt;Use existing HTML elements as much as possible, do not add classes like .head1 when the existing h1 style will accomplish what's needed. &lt;/li&gt;&lt;li&gt;Use existing style sheets. Only create new styles when absolutely necessary. Link style sheets using root-based referencing.  &lt;/li&gt;&lt;li&gt;List styles in alphabetical order within style sheets to make maintenance easier.  &lt;/li&gt;&lt;li&gt;Styles created for specific pages will be defined within the page header. &lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;&lt;span&gt;JavaScript&lt;a class="anchorGlyph" href="" name="javascript"&gt; &lt;/a&gt;&lt;/span&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;For validation purposes, all &lt;script&gt;&lt;/script&gt; tags must include a type and language. Use type="text/JavaScript". However, &lt;strong&gt;do not&lt;/strong&gt; use language="JavaScript" because it won't validate when the Document Type is XHTML Strict.  &lt;/li&gt;&lt;li&gt;JavaScript variables will follow ASP variable naming conventions.  &lt;/li&gt;&lt;li&gt;All custom JavaScript functions (that are used on only one page) will be placed in the header of the page it is used on.  &lt;/li&gt;&lt;li&gt;Functions that are used on more than one page must be placed in a .js file. Our standard is to place .js files in a root/_scripts/ folder. &lt;/li&gt;&lt;li&gt;The most commonly used functions are available in centralized JavaScript files. Use root-based referencing to reference these files on your page.&lt;a href="file:///C:/Documents%20and%20Settings/Huynh%20Nhan/Desktop/Personal/BlogEn/code.html#top"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;&lt;span&gt;SQL Formatting&lt;a class="anchorGlyph" href="" name="sqlformatting"&gt; &lt;/a&gt;&lt;/span&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;All SQL reserved words will be typed in all caps (e.g., SELECT * FROM tableName WHERE dtStartDate &amp;gt; '3/3/03').  &lt;/li&gt;&lt;li&gt;Multiple table queries will always be declared using JOIN statements. Non-ANSI type multiple table queries are not allowed.&lt;a href="file:///C:/Documents%20and%20Settings/Huynh%20Nhan/Desktop/Personal/BlogEn/code.html#top"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;&lt;span&gt;SQL Tables and Fields&lt;a class="anchorGlyph" href="" name="sqltables"&gt; &lt;/a&gt;&lt;/span&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Table and field names will  &lt;ol&gt;&lt;li&gt;Begin with a lowercase letter  &lt;/li&gt;&lt;li&gt;Use capital letters to divide words within the variable (e.g., "userFirstName")  &lt;/li&gt;&lt;li&gt;Not use underscores  &lt;/li&gt;&lt;li&gt;If the first letter is part of an acronym, the whole acronym will be lowercase (e.g., "sqlString", not "sQLString") &lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Tables that are grouped together shall begin with the same string (e.g., "atecCheckout", "atecFacility", "atecEquipment").  &lt;/li&gt;&lt;li&gt;Avoid the use of plurals in table names.  &lt;/li&gt;&lt;li&gt;Avoid the use of numbers in table and field names.  &lt;/li&gt;&lt;li&gt;Field names will record the data type of the field in the first character  &lt;ol&gt;&lt;li&gt;String datatypes (char, varChar, etc.) will begin with "s" (e.g. "sFirstName")  &lt;/li&gt;&lt;li&gt;Integer datatypes will begin with "i" (e.g., "iFacilityID"), with the exception of primary key identity fields, which will be named "ID" &lt;/li&gt;&lt;li&gt;Floating point (decimal) datatypes will begin with "f"&amp;nbsp;  &lt;/li&gt;&lt;li&gt;DateTime datatypes will begin with "dt"  &lt;/li&gt;&lt;li&gt;Bit datatypes will begin with "b"  &lt;/li&gt;&lt;li&gt;Text datatypes will begin with "t"&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;All tables will have a primary key identity field named "ID." Do not name this field after the table name (e.g., "ID," not "userListID") since the table will be identified anyway in multiple table queries (e.g., "userList.ID"). &lt;/li&gt;&lt;li&gt;Views and stored procedures will begin with "view" and "proc" respectively to separate them from tables (e.g., "viewCurrentStaff," "procCalcDaysLeft"). &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-7681408332605462023?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/7681408332605462023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=7681408332605462023' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7681408332605462023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7681408332605462023'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/11/development-web-service-internal-with.html' title='Development  Web Service Internal with standards'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-6940903269921686482</id><published>2008-11-25T01:33:00.000-08:00</published><updated>2008-11-25T01:33:00.379-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>ORACLE Architecture and Terminology</title><content type='html'>This section will provide a basic understanding of ORACLE including the concepts and terminology of the ORACLE Server. It is important that you read through this section to familiarize yourself with the concepts and terminology to be used throughout this manual. Most of the information contained in this section is DIRECTLY extracted from ``ORACLE7 Server  Concepts Manual'' and all credit should be attributed to ORACLE.  &lt;br /&gt;Before you can begin to use ORACLE, you must have a basic understanding of the architecture of ORACLE to help you start thinking about an ORACLE database in the correct conceptual manner. &lt;br /&gt;Figure 1 illustrates a typical variation of ORACLE's memory and process structures; some of the memory structures and processes in this diagram are discussed in the following section.  For more information on these memory structures and processes, see page 1-15 of ``ORACLE7 Server Concepts Manual.'' &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_Mtmv2gkQdGA/SSp1GpU5GcI/AAAAAAAABLo/i44byY7LjAw/s1600-h/fig1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_Mtmv2gkQdGA/SSp1GpU5GcI/AAAAAAAABLo/i44byY7LjAw/s320/fig1.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h5 align="centre"&gt;Figure 1. ORACLE Architecture &lt;/h5&gt;&lt;h2&gt;&lt;a href="http://draft.blogger.com/post-create.g?blogID=364606613135475254" name="section21"&gt; Memory Structures and Processes &lt;/a&gt; &lt;/h2&gt;The mechanisms of ORACLE execute by using memory structures and      processes. All memory structures exist in the main memory of the      computers that constitute the database system. Processes are jobs      or tasks that work in the memory of these computers. &lt;br /&gt;&lt;h3&gt;&lt;a href="http://draft.blogger.com/post-create.g?blogID=364606613135475254" name="section211"&gt; Memory Structures &lt;/a&gt; &lt;/h3&gt;ORACLE creates and uses memory structures to complete several jobs.   For example, memory is used to store program code being executed   and data that is shared among users. Several basic memory structures   are associated with ORACLE: the system global area (which includes   the database and redo log buffers, and the shared pool) and the    program global area. &lt;br /&gt;System Global Area (SGA) is a shared memory region allocated by   ORACLE that contains data and control information for one ORACLE   instance. &lt;br /&gt;An ORACLE instance contains the SGA and the background processes. &lt;br /&gt;The SGA is allocated when an instance starts and deallocated when the    instance shuts down. Each instance that is started has its own SGA. &lt;br /&gt;The Program Global Area (PGA) is a memory buffer that contains data   and control information for a server process. A PGA is created by    ORACLE when a server process is started. The information in a PGA   depends on the configuration of ORACLE. &lt;br /&gt;&lt;h3&gt;&lt;a href="http://draft.blogger.com/post-create.g?blogID=364606613135475254" name="section212"&gt; Processes &lt;/a&gt; &lt;/h3&gt;A process is a ``thread of control'' or a mechanism in an operating   system that can execute a series of steps. Some operating systems   use the terms job or task. An ORACLE database system has two general   types of processes: user processes and ORACLE processes. &lt;br /&gt;A user process is created and maintained to execute the software code   of an application program (such as a PRO*C program) or an ORACLE tool   (such as SQL*PLUS). The user process also manages the communication   with the server processes. User processes communicate with the server   processes through the program interface. &lt;br /&gt;ORACLE processes are called by other processes to perform functions   on behalf of the invoking process. ORACLE creates a server process   to handle requests from connected user processes. ORACLE also creates   a set of background processes for each instance (see ``ORACLE7 Server   Concepts Manual'' pages 1-18, 1-19). &lt;br /&gt;&lt;h2&gt;&lt;a href="http://draft.blogger.com/post-create.g?blogID=364606613135475254" name="section22"&gt; Database Structures &lt;/a&gt; &lt;/h2&gt;The relational model has three major aspects: &lt;br /&gt;&lt;dl&gt;&lt;dt&gt; Structures  &lt;/dt&gt;&lt;dd&gt;Structures are well-defined objects that store the   data of a database. Structures and the data contained   within them can be manipulated by operations.   &lt;/dd&gt;&lt;dt&gt; Operations  &lt;/dt&gt;&lt;dd&gt;Operations are clearly defined actions that allow   users to manipulate the data and structures of a    database. The operations on a database must adhere   to a pre-defined set of integrity rules.   &lt;/dd&gt;&lt;dt&gt; Integrity Rule  &lt;/dt&gt;&lt;dd&gt;Integrity rules are the laws that govern which   operations are allowed on the data and structures   of a database. Integrity rules protect the data and   the structures of a database. &lt;/dd&gt;&lt;/dl&gt;An ORACLE database has both a physical and a logical structure. By       separating physical and logical database structure, the physical storage      of data can be managed without affecting the access to logical storage      structures. &lt;br /&gt;&lt;h3&gt;&lt;a href="http://draft.blogger.com/post-create.g?blogID=364606613135475254" name="section221"&gt; Logical Database Structure &lt;/a&gt; &lt;/h3&gt;An ORACLE database's logical structure is determined by:  &lt;br /&gt;&lt;ul&gt;&lt;li&gt; one or more tablespaces.  &lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; the database's schema objects (e.g., tables, views, indexes, clusters, sequences, stored procedures). &lt;/li&gt;&lt;/ul&gt;The logical storage structures, including tablespaces, segments, and   extents, dictate how the physical space of a database is used. The   schema objects and the relationships among them form the relational   design of a database. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tablespaces and Data Files &lt;/b&gt;     Tablespaces are the primary logical storage structures of any ORACLE database.   The usable data of an ORACLE database is logically stored in the   tablespaces and physically stored in the data files associated with   the corresponding tablespace.  Figure 2 illustrates this relationship. &lt;br /&gt;Although databases, tablespaces, data files, and segments are closely   related, they have important differences: &lt;br /&gt;&lt;br /&gt;&lt;dl&gt;&lt;dt&gt; databases and tablespaces &lt;/dt&gt;&lt;dd&gt;An ORACLE database is comprised of one or more logical storage units      called tablespaces. The  database's data is collectively stored in the      database's tablespaces.   &lt;/dd&gt;&lt;dt&gt; tablespaces and data files &lt;/dt&gt;&lt;dd&gt;Each tablespace in an ORACLE database is comprised of one or more      operating system files called data files. A tablespace's data files      physically store the associated database data on disk.   &lt;/dd&gt;&lt;dt&gt; databases and data files &lt;/dt&gt;&lt;dd&gt;A database's data is collectively stored in the data files that      constitute each tablespace of the database. For example, the simplest       ORACLE database would have one tablespace, with one data file. A more       complicated database might have three tablespaces, each comprised of       two data files (for a total of six data files).   &lt;/dd&gt;&lt;dt&gt; schema objects, segments, and tablespaces &lt;/dt&gt;&lt;dd&gt;When a schema object such as a table or index is created, its segment      is created within a  designated tablespace in the database.  For      example, suppose a table is created in a specific tablespace using the       CREATE TABLE command with the TABLESPACE option. The space for this       table's data segment is allocated in one or more of the data files that       constitute the specified tablespace. An object's segment allocates space       in only one tablespace of a database.  &lt;/dd&gt;&lt;/dl&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_Mtmv2gkQdGA/SSp1moNEd6I/AAAAAAAABLw/yiSg6ArXuds/s1600-h/fig2.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_Mtmv2gkQdGA/SSp1moNEd6I/AAAAAAAABLw/yiSg6ArXuds/s320/fig2.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h5 align="centre"&gt;Figure 2. Data Files and Tablespaces &lt;/h5&gt;&lt;br /&gt;A database is divided into one or more logical storage units called  tablespaces. A database administrator can use tablespaces to do the  following: &lt;br /&gt;&lt;ul&gt;&lt;li&gt; Control disk space allocation for database data. &lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Assign specific space quotas for database users. &lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Control availability of data by taking individual tablespaces online or offline. &lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Perform partial database backup or recovery operations. &lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Allocate data storage across devices to improve performance. &lt;/li&gt;&lt;/ul&gt;Every ORACLE database contains a tablespace named SYSTEM, which is  automatically created when the database is created. The SYSTEM   tablespace always contains the data dictionary tables for the entire  database.  You can query these data dictionary tables to obtain          pertinent information about the database; for example, the names of          the tables that are owned by you or ones to which you have access.           See Chapter 3 for more information on how to access data dictionary          tables. &lt;br /&gt;Data files associated with a tablespace store all the database data in  that tablespace. One or more datafiles form a logical unit of database  storage called a tablespace. A data file can be associated with only  one tablespace, and only one database. &lt;br /&gt;After a data file is initially created, the allocated disk space does  not contain any data; however, the space is reserved to hold only the  data for future segments of the associated tablespace - it cannot store  any other program's data. As a segment (such as the data segment for a  table) is created and grows in a tablespace, ORACLE uses the free space  in the associated data files to allocate extents for the segment. &lt;br /&gt;The data in the segments of objects (data segments, index segments,  rollback segments, and so on) in a tablespace are physically stored   in one or more of the data files that constitute the tablespace. Note  that a schema object does not correspond to a specific data file;  rather, a data file is a repository for the data of any object within  a specific tablespace. The extents of a single segment can be allocated  in one or more data files of a tablespace (see Figure 3); therefore,          an object can ``span'' one or more data files. The database          administrator and end-users cannot control which data file stores an          object. &lt;br /&gt;&lt;br /&gt;&lt;b&gt; Data Blocks, Extents, and Segments &lt;/b&gt;   ORACLE allocates database space for all data in a database. The units of logical database allocations are data blocks, extents, and segments. Figure 3 illustrates the relationships between these data structures. &lt;br /&gt;&lt;dl&gt;&lt;dt&gt; Data Blocks  &lt;/dt&gt;&lt;dd&gt;At the finest level of granularity, an ORACLE database's data is stored       in data blocks (also called logical blocks, ORACLE blocks, or pages).        An ORACLE database uses and allocates free database space in ORACLE data       blocks.  Figure 4 illustrates a typical ORACLE data block.   &lt;/dd&gt;&lt;dt&gt; Extents  &lt;/dt&gt;&lt;dd&gt;The next level of logical database space is called an extent. An extent       is a specific number of contiguous data blocks that are allocated for       storing a specific type of information.   &lt;/dd&gt;&lt;dt&gt; Segments  &lt;/dt&gt;&lt;dd&gt;The level of logical database storage above an extent is called a       segment. A segment is a set of extents which have been allocated for a       specific type of data structure, and all are stored in the same       tablespace. For example, each table's data is stored in its own data       segment, while each index's data is stored in its own index segment.        ORACLE allocates space for segments in extents. Therefore, when the       existing extents of a segment are full, ORACLE allocates another extent       for that segment.  Because extents are allocated as needed, the extents       of a segment may or may not be contiguous on disk, and may or may not       span files. An extent cannot span files, though. &lt;/dd&gt;&lt;/dl&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_Mtmv2gkQdGA/SSp1ryFV6xI/AAAAAAAABL4/2WjM6QXodqc/s1600-h/fig3.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_Mtmv2gkQdGA/SSp1ryFV6xI/AAAAAAAABL4/2WjM6QXodqc/s320/fig3.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h5 align="centre"&gt;Figure 3. The Relationship Among Segments, Extents and Data       Blocks &lt;/h5&gt;ORACLE manages the storage space in the data files of a database in  units called data blocks. A data block is the smallest unit of I/O used  by a database. A data block corresponds to a block of physical bytes on  disk, equal to the ORACLE data block size (specifically set when the  database is created - 2048). This block size can differ from the          standard I/O block size of the operating system that executes ORACLE. &lt;br /&gt;The ORACLE block format is similar regardless of whether the data block  contains table, index, or clustered data.  Figure 4 shows the format of          a data block. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_Mtmv2gkQdGA/SSp1wdqcLkI/AAAAAAAABMA/45_HUyHHH_c/s1600-h/fig4.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_Mtmv2gkQdGA/SSp1wdqcLkI/AAAAAAAABMA/45_HUyHHH_c/s320/fig4.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h5 align="centre"&gt;Figure 4. Data Block Format &lt;/h5&gt;&lt;br /&gt;&lt;dl&gt;&lt;dt&gt; Header (Common and Variable) &lt;/dt&gt;&lt;dd&gt;The header contains general block information, such as block address,      segment type, such as data, index, or rollback. While some block overhead       is fixed in size (about 107 bytes), the total block overhead size is       variable.   &lt;/dd&gt;&lt;dt&gt; Table Directory  &lt;/dt&gt;&lt;dd&gt;The table directory portion of the block contains information about the       tables having rows in this block.   &lt;/dd&gt;&lt;dt&gt; Row Directory  &lt;/dt&gt;&lt;dd&gt;This portion of the block contains row information about the actual rows       in the block (including addresses for each row piece in the row data       area).  Once the space has been allocated in the row directory of a       block's header, this space is not reclaimed when the row is deleted.   &lt;/dd&gt;&lt;dt&gt; Row Data  &lt;/dt&gt;&lt;dd&gt;This portion of the block contains table or index data. Rows can span       blocks.   &lt;/dd&gt;&lt;dt&gt; Free Space  &lt;/dt&gt;&lt;dd&gt;Free space is used to insert new rows and for updates to rows that       require additional space (e.g., when a trailing null is updated to a       non-null value). Whether issued insertions actually occur in a given       data block is a function of the value for the space management parameter       PCTFREE and the amount of current free space in that data block.   &lt;/dd&gt;&lt;dt&gt; Space Used for Transaction Entries &lt;/dt&gt;&lt;dd&gt;Data blocks allocated for the data segment of a table, cluster, or the       index segment of an index can also use free space for transaction entries. &lt;/dd&gt;&lt;/dl&gt;Two space management parameters, PCTFREE and PCTUSED, allow a developer  to control the use of free space for inserts of and updates to the rows  in data blocks. Both of these parameters can only be specified when   creating or altering tables and clusters (data segments). In addition,  the storage parameter PCTFREE can also be specified when creating or  altering indicies (index segments).     The PCTFREE parameter is used to set the percentage of a block to be  reserved (kept free) for possible updates to rows that already are  contained in that block. For example, assume that you specify the   following parameter within a CREATE TABLE statement: &lt;br /&gt;pctfree 20    This states that 20\% of each data block used for this table's data  segment will be kept free and available for possible updates to the  existing rows already within each block.  &lt;br /&gt;After a data block becomes full, as determined by PCTFREE, the block is  not considered for the insertion of new rows until the percentage of  the block being used falls below the parameter PCTUSED. Before this  value is achieved, the free space of the data block can only be used for  updates to rows already contained in the data block. For example, assume  that you specify the following parameter within a CREATE TABLE  statement: &lt;br /&gt;pctused 40    In this case, a data block used for this table's data segment is not  considered for the insertion of any new rows until the amount of used  space in the blocks falls to 39\% or less (assuming that the block's          used space has previously reached PCTFREE). &lt;br /&gt;No matter what type, each segment in a database is created with at least  one extent to hold its data. This extent is called the segment's initial  extent.  &lt;br /&gt;If the data blocks of a segment's initial extent become full and more  space is required to hold new data, ORACLE automatically allocates an  incremental extent for that segment. An incremental extent is a   subsequent extent of the same or incremented size of the previous  extent in that segment. &lt;br /&gt;Every non-clustered table in an ORACLE database has a single data   segment to hold all of its data. The data segment for a table is   indirectly created via the CREATE TABLE/SNAPSHOT command. &lt;br /&gt;Storage parameters for a table, snapshot, or cluster control the way  that  a data segment's extents are allocated. Setting these storage  parameters directly via the CREATE TABLE/SNAPSHOT/CLUSTER or ALTER  TABLE/SNAPSHOT/CLUSTER commands affects the efficiency of data retrieval  and storage for that data segment. &lt;br /&gt;For more information on Data Blocks, Segments and Extents, see ``ORACLE7  Server Concepts Manual.'' &lt;br /&gt;&lt;h3&gt;&lt;a href="http://draft.blogger.com/post-create.g?blogID=364606613135475254" name="section222"&gt; Physical Database Structure &lt;/a&gt; &lt;/h3&gt;An ORACLE database's physical structure is determined by the operating system  files that constitute the database.  Each ORACLE database is comprised of  these types of files: one or more data files, two or more redo log files, and  one or more control files.  The files of a database provide the actual  physical storage for database information.  For more information on these  physical storage files, see ``ORACLE7 Server Concepts Manual.'' &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_Mtmv2gkQdGA/SSp11F6XkyI/AAAAAAAABMI/MoBM16b1nVI/s1600-h/fig5.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_Mtmv2gkQdGA/SSp11F6XkyI/AAAAAAAABMI/MoBM16b1nVI/s320/fig5.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h5 align="centre"&gt;Figure 5. Maintaining the Free Space of Data Blocks          with PCTFREE and PCTUSED &lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-6940903269921686482?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/6940903269921686482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=6940903269921686482' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6940903269921686482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6940903269921686482'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/11/oracle-architecture-and-terminology.html' title='ORACLE Architecture and Terminology'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Mtmv2gkQdGA/SSp1GpU5GcI/AAAAAAAABLo/i44byY7LjAw/s72-c/fig1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-243167557438173471</id><published>2008-11-24T01:22:00.000-08:00</published><updated>2008-11-24T01:24:53.376-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web server'/><title type='text'>Response buffer limit exceeded : Error message when a Web browser sends a request for an active server page to a Web server that is running IIS 6.0</title><content type='html'>&lt;h2 class="subTitle" id="tocHeadRef"&gt;SYMPTOMS&lt;/h2&gt;&lt;script type="text/javascript"&gt;loadTOCNode(1, 'symptoms');&lt;/script&gt;&lt;div class="sbody"&gt;Consider the following scenario. A client Web browser sends a request for an active server page (ASP) to a Web server that is running Internet Information Services (IIS) 6.0. The ASP request generates a large response. In this scenario, the following symptoms may occur: &lt;table class="list ul"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="bullet"&gt;•&lt;/td&gt;&lt;td class="text"&gt;The response fails.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="bullet"&gt;•&lt;/td&gt;&lt;td class="text"&gt;An HTTP 500 server error occurs, and you receive the following error message in the client Web browser:&lt;div class="errormsg"&gt;Response object error 'ASP 0251 : 80004005' &lt;br /&gt;Response Buffer Limit Exceeded &lt;br /&gt;/&lt;var&gt;PageName.asp&lt;/var&gt;, line &lt;var&gt;LineNumber&lt;/var&gt;&lt;/div&gt;&lt;b&gt;Note &lt;/b&gt;&lt;var&gt;PageName.asp&lt;/var&gt; represents the name of the ASP page that was requested. &lt;var&gt;LineNumber&lt;/var&gt; represents the last line number in the file that was processed before the response buffer exceeded the limit.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="bullet"&gt;•&lt;/td&gt;&lt;td class="text"&gt;The IIS log file contains the following error in the &lt;b&gt;cs-uri-query&lt;/b&gt; field:&lt;div class="errormsg"&gt;|0|ASP_0251_:_80004005|Response_Buffer_Limit_Exceeded&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;h2 class="subTitle" id="tocHeadRef"&gt;CAUSE&lt;/h2&gt;&lt;script type="text/javascript"&gt;loadTOCNode(1, 'cause');&lt;/script&gt;&lt;div class="sbody"&gt;This issue occurs because of a change in behavior that was introduced in IIS 6.0 and added to IIS 5.0. These versions of IIS enforce a default ASP response buffer limit of 4 MB. This limit prevents large ASP responses from adversely affecting the IIS process that hosts the Web application. If an ASP request generates a response that is larger than the configured buffer limit, you experience the symptoms that are mentioned in the "Symptoms" section.&lt;/div&gt;&lt;h2 class="subTitle" id="tocHeadRef"&gt;RESOLUTION&lt;/h2&gt;&lt;script type="text/javascript"&gt;loadTOCNode(1, 'resolution');&lt;/script&gt;In most scenarios, the 4 MB buffer limit is sufficient for ASP responses that are sent to Web clients. If this limit is insufficient, use one of the following methods:&lt;h3 id="tocHeadRef"&gt;Method 1: Decrease the response size&lt;/h3&gt;&lt;script type="text/javascript"&gt;loadTOCNode(2, 'resolution');&lt;/script&gt;If the response is larger than the 4 MB default value, this size frequently causes a poor user experience. The Web browser must receive the large response over the network. Then, the Web browser must parse and display a very large HTML response.&lt;br /&gt;&lt;br /&gt;If the Web client that receives the response does not have to view the whole response as a single page, you can decrease the response size. For example, you can rewrite the ASP-based application so that data is presented in a grid. Therefore, the Web client can browse the data one page at a time. You can use the &lt;b&gt;GridView&lt;/b&gt; class in Microsoft ASP.NET to achieve this effect. For more information about the &lt;b&gt;GridView&lt;/b&gt; class in ASP.NET, visit the following Microsoft Developer Network (MSDN) Web site: &lt;div class="indent"&gt;&lt;span class="ll"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx&lt;/a&gt;&lt;/span&gt;&lt;span class="pLink"&gt; (http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx)&lt;/span&gt;&lt;/div&gt;&lt;h3 id="tocHeadRef"&gt;Method 2: Use the Response.Flush method&lt;/h3&gt;&lt;script type="text/javascript"&gt;loadTOCNode(2, 'resolution');&lt;/script&gt;If you use a loop in the ASP file to build a large table or construct data, you can use the &lt;b&gt;Response.Flush&lt;/b&gt; method. When you use this method, you can still use buffering. However, you also have complete control over the amount of data that is sent to the Web client, and you can control the buffer size of the response. For more information about the &lt;b&gt;Response.Flush&lt;/b&gt; method, visit the following MSDN Web site: &lt;div class="indent"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms525560.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms525560.aspx&lt;/a&gt;&lt;span class="pLink"&gt;&lt;/span&gt;&lt;a href="file:///C:/Documents%20and%20Settings/Huynh%20Nhan/Desktop/Personal/BlogEn/925764.htm#top"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 id="tocHeadRef"&gt;Method 3: Disable buffering&lt;/h3&gt;&lt;script type="text/javascript"&gt;loadTOCNode(2, 'resolution');&lt;/script&gt;You can disable buffering on the Web server, at the application level, or at the page level. When you disable buffering, the Web server uses HTTP chunked-transfer encoding to send the response to the Web client.&lt;br /&gt;&lt;br /&gt;To disable buffering at the application level, you can use the &lt;b&gt;AspBufferingOn&lt;/b&gt; IIS metabase property. For more information about the &lt;b&gt;AspBufferingOn&lt;/b&gt; IIS metabase property, visit the following Microsoft Web site: &lt;div class="indent"&gt;&lt;span class="ll"&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/fbe1bd5f-52d4-4a26-8ab1-7bb897bb3d53.mspx"&gt;http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/fbe1bd5f-52d4-4a26-8ab1-7bb897bb3d53.mspx&lt;/a&gt;&lt;/span&gt;&lt;span class="pLink"&gt; (http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/fbe1bd5f-52d4-4a26-8ab1-7bb897bb3d53.mspx)&lt;/span&gt;&lt;/div&gt;To disable buffering at the page level, you can use the &lt;b&gt;Response.Buffer&lt;/b&gt; property. For more information about the &lt;b&gt;Response.Buffer&lt;/b&gt; property, visit the following MSDN Web site: &lt;div class="indent"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms526001.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms526001.aspx&lt;/a&gt;&lt;span class="pLink"&gt;&lt;/span&gt;&lt;a href="file:///C:/Documents%20and%20Settings/Huynh%20Nhan/Desktop/Personal/BlogEn/925764.htm#top"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 id="tocHeadRef"&gt;Method 4: Increase the buffer limit&lt;/h3&gt;&lt;script type="text/javascript"&gt;loadTOCNode(2, 'resolution');&lt;/script&gt;You can increase the buffering limit if one of the following conditions is true:&lt;table class="list ul"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="bullet"&gt;•&lt;/td&gt;&lt;td class="text"&gt;The client is not a Web browser.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="bullet"&gt;•&lt;/td&gt;&lt;td class="text"&gt;You cannot redesign the application to take advantage of a paging technology, such as the &lt;b&gt;GridView&lt;/b&gt; class.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;If you must increase the buffer limit, select a buffer limit that allows for the largest known response size. If you do not know the largest response size in advance, you can increase the buffer limit to a large value during testing. After you finish testing, use the largest value that is in the &lt;b&gt;sc-bytes&lt;/b&gt; field in the IIS log file for the response that is generated for the page.&lt;br /&gt;&lt;br /&gt;To increase the buffering limit, follow these steps:&lt;table class="list ol"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;1.&lt;/td&gt;&lt;td class="text"&gt;Click &lt;strong class="uiterm"&gt;Start&lt;/strong&gt;, click &lt;strong class="uiterm"&gt;Run&lt;/strong&gt;, type &lt;span class="userInput"&gt;cmd&lt;/span&gt;, and then click &lt;strong class="uiterm"&gt;OK&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="number"&gt;2.&lt;/td&gt;&lt;td class="text"&gt;Type the following command, and then press ENTER:&lt;div class="indent"&gt;&lt;span class="userInput"&gt;cd /d %systemdrive%\inetpub\adminscripts&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="number"&gt;3.&lt;/td&gt;&lt;td class="text"&gt;Type the following command, and then press ENTER:&lt;div class="indent"&gt;&lt;span class="userInput"&gt;cscript.exe adsutil.vbs SET w3svc/aspbufferinglimit &lt;var&gt;LimitSize&lt;/var&gt;&lt;/span&gt;&lt;/div&gt;&lt;b&gt;Note &lt;/b&gt;&lt;var&gt;LimitSize&lt;/var&gt; represents the buffering limit size in bytes. For example, the number 67108864 sets the buffering limit size to 64 MB.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;To confirm that the buffer limit is set correctly, follow these steps:&lt;table class="list ol"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="number"&gt;1.&lt;/td&gt;&lt;td class="text"&gt;Click &lt;strong class="uiterm"&gt;Start&lt;/strong&gt;, click &lt;strong class="uiterm"&gt;Run&lt;/strong&gt;, type &lt;span class="userInput"&gt;cmd&lt;/span&gt;, and then click &lt;strong class="uiterm"&gt;OK&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="number"&gt;2.&lt;/td&gt;&lt;td class="text"&gt;Type the following command, and then press ENTER:&lt;div class="indent"&gt;&lt;span class="userInput"&gt;cd /d %systemdrive%\inetpub\adminscripts&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="number"&gt;3.&lt;/td&gt;&lt;td class="text"&gt;Type the following command, and then press ENTER:&lt;div class="indent"&gt;&lt;span class="userInput"&gt;cscript.exe adsutil.vbs GET w3svc/aspbufferinglimit&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-243167557438173471?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/243167557438173471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=243167557438173471' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/243167557438173471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/243167557438173471'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/11/response-buffer-limit-exceeded-error.html' title='Response buffer limit exceeded : Error message when a Web browser sends a request for an active server page to a Web server that is running IIS 6.0'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-3538899556992242074</id><published>2008-09-18T07:00:00.000-07:00</published><updated>2008-09-20T11:13:07.999-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML and JavaScript'/><title type='text'>Blogger JSON feed and a JSON recent posts widget</title><content type='html'>&lt;h2 id="toc1"&gt; What is a JSON-Feed?&lt;/h2&gt;Your Blogger Blog generates newsfeeds that can be read by Newsreaders. The standard feeds are RSS-feeds, using the XML-standard, or Atom-feeds.&lt;br /&gt;But if you want to use the contents of your feeds in another web-applications, you need access to the feed to read its contents and display them on your webpage. The XML-file that contains your feed is located on one of the servers of Blogger, inside the blogger.com domain. For security reasons, browsers will not allow accessing XML-files on other domains. So if your webpage is not inside the blogger.com domain, how can we get access to it?&lt;br /&gt;This is where the JSON-feed comes in handy.&lt;br /&gt;JSON means: &lt;b&gt;J&lt;/b&gt;ava&lt;b&gt;S&lt;/b&gt;cript &lt;b&gt;O&lt;/b&gt;bject &lt;b&gt;N&lt;/b&gt;otation. A JSON-feed is not formatted as an XML-file, but as a Javascript Object. To make it accessible cross-domain, we use a &lt;i&gt;call-back&lt;/i&gt; function. In plain English: we ask the Blogger Server to hand over the JSON-object to a function that we have written, and this function parses the JSON-object to retrieve the feed. And because it is already a Javascript Object, parsing it is very easy.&lt;br /&gt;&lt;h2 id="toc2"&gt;Getting the JSON-feed&lt;/h2&gt;To get the JSON-feed, we need the following Javascript code on our Blog:&lt;br /&gt;&lt;div class="code"&gt;&lt;pre&gt;&lt;code&gt;&lt;script src="http://yourblog.blogspot.com/feeds/posts/default?alt=json-in-script&amp;amp;callback=showfeedcontent"&gt;&lt;/script&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Replace yourblog with the name of your blog. You will also have to write a Javascript function showfeedcontent(json), that takes the JSON-object and parses it.&lt;br /&gt;&lt;h2 id="toc3"&gt;Examining the feed&lt;/h2&gt;Open Notepad, and copy the following code to a new document. Save the document as a HTML-document (e.g. parser.html). Again, replace yourblog with the name of your blog.&lt;br /&gt;Then, open the document in your browser, and it will display the contents of your feed. In fact: it will display the contents of any JSON-object. Try it out with Google Calendar, and you will be able to see the contents of that feed too. This small and simple html-page is a powerfull tool to examine th structure of JSON-objects, so that you can write a parser for it.&lt;br /&gt;&lt;br /&gt;&lt;h2 id="toc5"&gt;How to parse a JSON-feed&lt;/h2&gt;In the table below the most important elements of the JSON object structure are explained.&lt;br /&gt;&lt;table class="wiki-content-table"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;b&gt;Object&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Meaning&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Example content&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json&lt;/td&gt; &lt;td&gt;The JSON-object&lt;/td&gt; &lt;td&gt;-&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed&lt;/td&gt; &lt;td&gt;The feed&lt;/td&gt; &lt;td&gt;-&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.title.$t&lt;/td&gt; &lt;td&gt;Blog name&lt;/td&gt; &lt;td&gt;Beautiful Beta&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.updated.$t&lt;/td&gt; &lt;td&gt;Date and time of last feed update&lt;/td&gt; &lt;td&gt;2007-03-18, 20:43&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.author[]&lt;/td&gt; &lt;td&gt;Array of Blog author names&lt;/td&gt; &lt;td&gt;-&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.author[0].name.$t&lt;/td&gt; &lt;td&gt;Name of first Blog author&lt;/td&gt; &lt;td&gt;Beta Bloke&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.openSearch$totalResults&lt;/td&gt; &lt;td&gt;Number of posts in the Blog&lt;/td&gt; &lt;td&gt;74&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.entry[]&lt;/td&gt; &lt;td&gt;Array of Blog entries&lt;/td&gt; &lt;td&gt;-&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.entry[i].title.$t&lt;/td&gt; &lt;td&gt;Title of the i&lt;sup&gt;th&lt;/sup&gt; post&lt;/td&gt; &lt;td&gt;What's up here?&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.entry[i].category[]&lt;/td&gt; &lt;td&gt;Array of labels of i&lt;sup&gt;th&lt;/sup&gt; post&lt;/td&gt; &lt;td&gt;-&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.entry[i].category[j].term&lt;/td&gt; &lt;td&gt;j&lt;sup&gt;th&lt;/sup&gt; label of i&lt;sup&gt;th&lt;/sup&gt; post&lt;/td&gt; &lt;td&gt;tools&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.entry[i].published.$t&lt;/td&gt; &lt;td&gt;Date and time i&lt;sup&gt;th&lt;/sup&gt; post was published&lt;/td&gt; &lt;td&gt;2007-03-18, 12:27&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.entry[i].updated.$t&lt;/td&gt; &lt;td&gt;Date and time i&lt;sup&gt;th&lt;/sup&gt; post was updated&lt;/td&gt; &lt;td&gt;2007-03-18, 12:35&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.entry[i].author[]&lt;/td&gt; &lt;td&gt;Array of i&lt;sup&gt;th&lt;/sup&gt; post author names&lt;/td&gt; &lt;td&gt;-&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.entry[i].author[0].name.$t&lt;/td&gt; &lt;td&gt;Name of first author of i&lt;sup&gt;th&lt;/sup&gt; post&lt;/td&gt; &lt;td&gt;Beta Bloke&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.entry[i].content.$t&lt;/td&gt; &lt;td&gt;The content of the i&lt;sup&gt;th&lt;/sup&gt; post, as html&lt;/td&gt; &lt;td&gt;It has been very quiet on ….&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;json.feed.entry[i].link[]&lt;/td&gt; &lt;td&gt;Array of links of the i&lt;sup&gt;th&lt;/sup&gt; post&lt;/td&gt; &lt;td&gt;Explained below&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The feed contains links for each entry, in the array json.feed.entry[i].link[]. One of those links is the permalink to the post. Its "rel"-field is set to "alternate". Its "href"-field contains the url of the post-page.&lt;br /&gt;Now let's take a look at the json.feed.link[]-array. This array contains some usefull links as well.&lt;br /&gt;One of these links has its "rel"-field set to "alternate"; its "href"-field holds the url of your blog's main page. Another link has its "rel"-field set to "next"; its "href"-field holds the url for calling the next 25 feed entries.&lt;br /&gt;&lt;h2 id="toc6"&gt;A basic Recent Posts Widget&lt;/h2&gt;Now, with this knowledge, we can write a basic Recent Posts Widget, that has the following functionality:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;List 5 most recent posts&lt;/li&gt;&lt;li&gt;Display post title&lt;/li&gt;&lt;li&gt;Display link to the post&lt;/li&gt;&lt;li&gt;Display post date&lt;/li&gt;&lt;li&gt;Display post author&lt;/li&gt;&lt;li&gt;Display first 100 characters of post content&lt;/li&gt;&lt;/ul&gt;You can copy the code below to a new Notepad-document, and save it as html. Replace yourblog with the name of your blog. Open the file in your browser to see your widget at work.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;div style="text-align: right;"&gt;&lt;i&gt;&lt;code&gt;Beautiful Beta&lt;/code&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: right;"&gt;&lt;pre&gt;&lt;code&gt;beautifulbeta.blogspot.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-3538899556992242074?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/3538899556992242074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=3538899556992242074' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/3538899556992242074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/3538899556992242074'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/09/blogger-json-feed-and-json-recent-posts.html' title='Blogger JSON feed and a JSON recent posts widget'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-7576981475883045793</id><published>2008-09-17T07:00:00.000-07:00</published><updated>2008-09-17T07:00:01.234-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Forms Authentication - Redirect Page and http to https problem</title><content type='html'>A worthy article by&amp;nbsp; &lt;i&gt;&lt;span style="font-size: x-small;"&gt;Harish Ranganathan &lt;/span&gt;&lt;/i&gt;&lt;span style="font-size: x-small;"&gt;about&lt;/span&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/i&gt;FormsAuthentication, my experience on this is when we didn't use RedirectFromLoginPage to navigate, must call SetAuthcookie() to authenticate our privilege. After that, just use ourself navigation. Some variable in Require.ServerVariables are useful for this purpose.&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;If Request.ServerVariables("SERVER_PORT")=80 Then 'If Request.ServerVariables("HTTPS")= "on"&lt;br /&gt;      Dim strSecureURL&lt;br /&gt;      strSecureURL = "https://"&lt;br /&gt;      strSecureURL = strSecureURL &amp;amp; Request.ServerVariables("SERVER_NAME")&lt;br /&gt;      strSecureURL = strSecureURL &amp;amp; Request.ServerVariables("URL")&lt;br /&gt;      Response.Redirect strSecureURL&lt;br /&gt;   End If&lt;/pre&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;In this article I will explain how to redirect users to a specific page rather than the generic default.aspx upon successful authentication of the user. &lt;br /&gt;&lt;br /&gt;While using ASP.NET Forms authentication, if we try to access a protected page, the user would be taken to the login.aspx page with the ReturnUrl parameter having the path for the originally requested page. &lt;br /&gt;&lt;br /&gt;Once, the user's credentials are verified, the RedirectFromLoginPage method can be used to take the user back to the originally requested page. &lt;br /&gt;&lt;br /&gt;However, if there is no specified ReturnUrl, then FormsAuthentication by default takes the user to the default.aspx page upon successful authentication. &lt;br /&gt;&lt;br /&gt;If we do not have a default.aspx page or we want to take the users to our custom page etc., then we can use the Setauthcookie method to set the cookie and then redirect users to our desired page. The following code establishes the same. &lt;br /&gt;&lt;br /&gt;// Once the user's entered credentials are verified // &lt;br /&gt;if(Request.Params["ReturnUrl"] != null) &lt;br /&gt;{ &lt;br /&gt;FormsAuthentication.RedirectFromLoginPage(txtUserName.text, false); &lt;br /&gt;} &lt;br /&gt;else &lt;br /&gt;{ &lt;br /&gt;FormsAuthentication.SetAuthcookie(txtUserName.text, false); &lt;br /&gt;Response.Redirect("CustomPage.aspx"); &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;The above code first verifies whether there is any ReturnUrl parameter such that if exists, it should take to the originally requested page. &lt;br /&gt;&lt;br /&gt;Else, it sets the authcookie and then redirects user to a custom page. &lt;br /&gt;&lt;br /&gt;The txtUserName is the ID of the textbox which is used to capture the username. &lt;br /&gt;&lt;br /&gt;This article applies to ASP.NET 1.0 &amp;amp; 1.1 Versions.&lt;br /&gt;&lt;div style="text-align: right;"&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: right;"&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt;Harish Ranganathan&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;h1&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-7576981475883045793?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/7576981475883045793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=7576981475883045793' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7576981475883045793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7576981475883045793'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/09/forms-authentication-redirect-page-and.html' title='Forms Authentication - Redirect Page and http to https problem'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-7938997015827263014</id><published>2008-09-16T07:00:00.000-07:00</published><updated>2008-09-16T07:00:00.289-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET authentication with SSL and http to https, https to http problems</title><content type='html'>&lt;div class="MsoBodyText"&gt;So you read the available documentation an put together the basic Forms authentication framework for an ASP.NET application (for which there’s a good &lt;a href="http://www.ondotnet.com/pub/a/dotnet/2003/01/20/formsauthp2.html"&gt;article by Abel Banda on O’Reilly&lt;/a&gt;) and you say to yourself, boy it really sucks that these passwords are being sent over the internet unencrypted; which leads to the next logical step of using SSL for the login.aspx page.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;The steps to follow are these:&lt;/div&gt;&lt;div class="MsoBodyText" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;1.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Add a server certificate to the web site root folder (Internet Information Services&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Default Web Site&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Properties&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Directory Security&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Server Certificate…)&lt;/div&gt;&lt;div class="MsoBodyText" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;2.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Create folder in your web app for which you will require SSL access. Call it “ssl”.&lt;/div&gt;&lt;div class="MsoBodyText" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;3.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Move your login.aspx file to ssl/login.aspx.&lt;/div&gt;&lt;div class="MsoBodyText" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;4.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Make sure the NTFS security settings on the web application folder includes the anonymous IIS user account (IUSR_machine typically).&lt;/div&gt;&lt;div class="MsoBodyText" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;5.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Disable Integrated Windows authentication and make sure Anonymous access is enabled for the web app (Internet Information Services&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;web app folder&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Properties&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Directory Security&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Anonymous access and authentication control&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Edit…)&lt;/div&gt;&lt;div class="MsoBodyText" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;6.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Require SSL for your ssl folder (Internet Information Services&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;ssl folder&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Properties&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Directory Security&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;Server Certificate…&lt;span style="font-family: Wingdings;"&gt;à&lt;/span&gt;check the “Require Secure Channel” box.)&lt;/div&gt;&lt;div class="MsoBodyText" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;7.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Modify the loginURL attribute of the Forms element in your web.config file to reference the new login.aspx location with an absolute url beginning with “https://”.&lt;/div&gt;&lt;div class="MsoBodyText" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;8.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Test your application.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;At this point if you’re like me, a few things will begin to annoy you. First you’ll be reminded that you can’t debug under Visual Studio 2003 without Integrated Windows authentication. That’s okay. Leave it off for now. Just open a browser and manually try to hit your test page.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Again, if you’re like me, you should be getting a 401.2 error attempting to get the login.aspx page.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;You might even try directly accessing the login page from the browser with https – no good. And you might try changing the loginUrl back to a relative url (“ssl/login.aspx”) and requesting your test page with https. Wow! That works!?! Hmm… You might also test what happens if you change the “deny users=”?”” to “deny users=”bob””. Again it works accessing each page with https, but you’ve given up forcing the redirect to the login page. If you actually tried any of these things, put things back the way they were and move on to the solution.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Add this in front of your existing &lt;system.web _moz-userdefined=""&gt; element in the web.config file:&lt;/system.web&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon; font-family: 'Courier New'; font-size: 10pt;"&gt;location&lt;/span&gt;&lt;span style="color: magenta; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New'; font-size: 10pt;"&gt;path&lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;="ssl/login.aspx"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;system.web&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;authorization&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;allow&lt;/span&gt;&lt;span style="color: magenta;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;users&lt;/span&gt;&lt;span style="color: blue;"&gt;="?"&lt;/span&gt;&lt;span style="color: magenta;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: maroon;"&gt;authorization&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: maroon;"&gt;system.web&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;&lt;span style="color: maroon;"&gt;location&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;This block tells the authorization logic to explicitly allow the anonymous user to access the ssl/login.aspx page and overrides the blanket deny element that comes later. There seems to be some special case code that handles relative login URLs but fails on absolute login URLs.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Change your loginUrl attribute back to an absolute “https://” &amp;nbsp;url and the authentication should work.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;One annoyance remains: The ReturnUrl passed to the login page doesn’t include the request scheme (the “http://” part) so you end up stuck in SSL after you login.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;So I tried taking charge of the redirect URL with the following code. Thanks &lt;a href="http://www.hanselman.com/blog/PermaLink.aspx?guid=859d9aed-3d2d-4064-bf9f-9169f8c17806"&gt;to Scott Hanselman for the xml timeout hack&lt;/a&gt;, and yes, it needs better packaging for production:&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;System.Xml.XmlDocument x =&lt;span style="color: blue;"&gt;new&lt;/span&gt; System.Xml.XmlDocument();&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;x.Load(Request.PhysicalApplicationPath + "web.config");&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;System.Xml.XmlNode node = x.SelectSingleNode("/configuration/system.web/authentication/forms");&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; timeout = &lt;span style="color: blue;"&gt;int&lt;/span&gt;.Parse(node.Attributes["timeout"].Value, System.Globalization.CultureInfo.InvariantCulture.NumberFormat); &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;string&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; userData = "Place application specific data for this user here.";&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;FormsAuthenticationTicket ticket = &lt;span style="color: blue;"&gt;new&lt;/span&gt; FormsAuthenticationTicket(&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1,&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserName.Value,&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.DateTime.Now,&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.DateTime.Now.AddMinutes(timeout), &lt;span style="color: green;"&gt;// Should be timout from web.config&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PersistCookie.Checked,&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userData,&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FormsAuthentication.FormsCookiePath);&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;string&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; encTicket = FormsAuthentication.Encrypt(ticket);&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;Response.Cookies.Add(&lt;span style="color: blue;"&gt;new&lt;/span&gt; HttpCookie(FormsAuthentication.FormsCookieName, encTicket));&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;string&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; url = FormsAuthentication.GetRedirectUrl(UserName.Value, PersistCookie.Checked);&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;Uri uri = Request.Url;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;url = uri.Scheme.Replace("https", "http") + "://" + uri.Host + url;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;Response.Redirect(url, &lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;That does the trick but generates a very annoying Security Alert dialog (“You are about to be redirected to a connection that is not secure.”).&lt;/div&gt;&lt;div class="MsoBodyText"&gt;To avoid this warning which is intended to remind naïve users that they are being taken away from the protection of https by the never-to-be-trusted server you must arrange for the client to request the shift back to non-SSL traffic.&lt;/div&gt;&lt;div class="MsoBodyText"&gt;Instead of the “Response.Redirect(url, true)” at the end of the previous block of code, replace it with:&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;(FindControl("RedirectUrl") &lt;span style="color: blue;"&gt;as&lt;/span&gt; System.Web.UI.HtmlControls.HtmlInputHidden).Value = url;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;And merge the following bit of code into the login.aspx file:&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;script language="javascript"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;!--&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function DoOnLoad() {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (Form1.RedirectUrl.value)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;window.navigate(Form1.RedirectUrl.value);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/script&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;form id="Form1" method="post" runat="server"&gt;&lt;/form&gt;&lt;/span&gt; &lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;input id="RedirectUrl" name="RedirectUrl" runat="server" type="hidden" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;&lt;/div&gt;&lt;div class="MsoBodyText"&gt;That should do it. Nothing could be simpler…. &lt;span style="font-family: Wingdings;"&gt;J&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;The following notes are from Jason Loader,&lt;/div&gt;&lt;div class="MsoNormal"&gt;2005-04-08&lt;/div&gt;&lt;span style="font-size: x-small;"&gt; Hi Tone,&lt;br /&gt;You know, you're the only person whose posted a solution to this problem I could find. Anyway, I was getting a windows login prompt/401.2 error (I was using Anonymous/Integrated Authentication on IIS), which was odd, as my application uses role-based security, but I'd already given anonymous/all users access to the login page via a location element. I tried what you suggested, but it still didn't work (it did get rid of the windows login prompt though), I couldn't find an explicit solution to the problem, but it would appear that the answer is actually in the Duwamish 7.0 sample.&lt;br /&gt;You need to give the login page subdirectory it's own web config file that gives access to it for all users (that's all that needs to be in there) if you want to hard code the absolute url in the forms loginurl e.g.&lt;br /&gt;In the application web.config file, you'd put -&lt;br /&gt;&lt;forms _moz-userdefined="" loginurl="https://[your server]/[your applicationdirectory]/Secure/login.aspx" name="AuthCookie" path="/" protection="All" slidingexpiration="true" timeout="30"&gt;&lt;/forms&gt;&lt;br /&gt;&lt;br /&gt;In the Secure subdirectory web.config file, you'd put -&lt;br /&gt;&lt;system.web _moz-userdefined=""&gt;&lt;/system.web&gt;&lt;br /&gt;&amp;nbsp; &lt;authorization _moz-userdefined=""&gt;&lt;/authorization&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;allow _moz-userdefined="" users="*"&gt;&lt;/allow&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;then remove the location section for the login page from the main app config file (the bit below) -&lt;br /&gt;&lt;location _moz-userdefined="" path="Secure/Logon.aspx"&gt;&lt;/location&gt;&lt;br /&gt;&amp;nbsp; &lt;system.web _moz-userdefined=""&gt;&lt;/system.web&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;authorization _moz-userdefined=""&gt;&lt;/authorization&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;allow _moz-userdefined="" users="?"&gt;&lt;/allow&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;From what I can tell, it's probably something to do with ASP.NET not picking up the authentication from the config file for the sub directories correctly when using absolute urls, as it works when you use relative urls and SSL for the whole site.&lt;br /&gt;However, you still had to change the config file if you moved the directories, changed the server name etc. With a bit of playing about, I found that you can force Forms Authentication to use SSL without hard-coding HTTPS in the loginURL by using the following code in globals.aspx -&lt;br /&gt;Sub Application_EndRequest(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.EndRequest&lt;br /&gt;Dim responseURI As System.Uri&lt;br /&gt;Dim responseURIBuilder As System.UriBuilder&lt;br /&gt;Dim pageName As String&lt;br /&gt;' check to see if we're being redirected to the login page&lt;br /&gt;If Not Response.RedirectLocation Is Nothing AndAlso Response.RedirectLocation.Length &amp;gt; 0 Then&lt;br /&gt;' load the redirect into the uri&lt;br /&gt;responseURI = New System.Uri(Request.Url,&lt;br /&gt;Response.RedirectLocation)&lt;br /&gt;pageName = GetPageFromURL(responseURI.AbsolutePath).ToLower()&lt;br /&gt;If pageName = "login.aspx" AndAlso responseURI.Scheme &amp;lt;&amp;gt; "https"&lt;br /&gt;Then&lt;br /&gt;' force it to be HTTPS&lt;br /&gt;responseURIBuilder = New System.UriBuilder(responseURI)&lt;br /&gt;responseURIBuilder.Scheme = "https"&lt;br /&gt;' remove the port number from the url and write it back&lt;br /&gt;Response.RedirectLocation = Replace(responseURIBuilder.ToString(), ":" &amp;amp; responseURIBuilder.Port &amp;amp; "/",&lt;br /&gt;"/")&lt;br /&gt;ElseIf pageName &amp;lt;&amp;gt; "login.aspx" AndAlso responseURI.Scheme = "https" Then&lt;br /&gt;' force it to be HTTP&lt;br /&gt;responseURIBuilder = New System.UriBuilder(responseURI)&lt;br /&gt;responseURIBuilder.Scheme = "http"&lt;br /&gt;' remove the port number from the url and write it back&lt;br /&gt;Response.RedirectLocation = Replace(responseURIBuilder.ToString(), ":" &amp;amp; responseURIBuilder.Port &amp;amp; "/",&lt;br /&gt;"/")&lt;br /&gt;End If&lt;br /&gt;End If&lt;br /&gt;End Sub&lt;br /&gt;GetPageFromURL is a function which gets the page from a URL string, there's plenty of examples out there if you need to do the same. &lt;br /&gt;What Duwamish does is automatically prefix absolute urls in the aspx files so you can turn SSL on and off through web.config, but I prefer to do that in the vb code so I can use relative links. One thing I haven't done is check that the login page is always being requested over secure sockets and if not force it to be, but you can get round that through IIS configuration (just in case you don't configure IIS and someone tries to access the login page directly). The next step is to make this configurable, like Duwamish is, and possibly picking up the HTTP/HTTPS ports if you've changed them (I've only tried it on default ports with IE).&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: right;"&gt;&lt;span style="font-size: x-small;"&gt;Cheers,&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;div style="text-align: right;"&gt;&lt;span style="font-size: x-small;"&gt;Jason Loader&lt;br /&gt;Software Developer, GVAS&lt;br /&gt;Wealth Management Software PLC&lt;br /&gt;E-mail: &lt;a href="mailto:jason.loader@wms-plc.com"&gt;jason.loader@wms-plc.com&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-7938997015827263014?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/7938997015827263014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=7938997015827263014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7938997015827263014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7938997015827263014'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/09/aspnet-authentication-with-ssl-and-http.html' title='ASP.NET authentication with SSL and http to https, https to http problems'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-5833488318942962155</id><published>2008-09-15T07:00:00.000-07:00</published><updated>2008-09-15T07:00:01.421-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><title type='text'>Efficient debug in Visual Studio 2005</title><content type='html'>What percentage of your development time would you say that you spend debugging code? Here are some useful debugging techniques for developer productivity.&lt;br /&gt;&lt;br /&gt;Most developers I've talked to say they spend anywhere from 30% to 50% or more of their time -- not writing the code -- but debugging and fixing it. Not only do we use the debugger to check code we've written before we can go on to write some more, we also use it in testing a completed project under various scenarios. And when there is a complaint about deployed code, we often need to resort to running it in debug mode to attempt to isolate and identify the reported problem.&lt;br /&gt;&lt;br /&gt;With Visual Studio 2005, the debugging environment has become vastly superior to anything previously available. Developers migrating from other platforms to .NET often revel in the greatly superior debugger support we have in .NET, compared to what they have to work with in other environments.&lt;br /&gt;&lt;br /&gt;Common logic would dictate that the better you are at a particular skill, the less time you will spend doing it and therefore the more efficient you become at the overall process. However, its a known fact that the debugging skills of a majority of developers consist primarily of knowing how to set a breakpoint with the F9 key or clicking the left margin on a line to set a breakpoint. An even bigger advance we master is how to write "System.Diagnostics.Debug.WriteLine(e.Message +e.StackTrace)" inside a catch block, set a breakpoint on it, and read the exception information (doh!).&lt;br /&gt;&lt;br /&gt;How many developers do you know that routinely use the locals, autos, call stack, watch, quickwatch, or the "this" window? Who know there are at least two documents in the documentation tree for Visual Studio&amp;nbsp; that describe the debuggers? How many know you can change the value of a variable in any of the debug-related windows, or that you can set multi-statement breakpoints on a single line of code? Who knows how to debug a single thread in a multithreaded application?&lt;br /&gt;&lt;br /&gt;In this short piece, I'll share a few of the (what I think are) cool debugger techniques I've learned, as well as point you to some resources on debugging, and if you have a particular technique or trick you'd like to share, you can post it on our article discussion board.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tip: Call Stack Window Debugging: &lt;/b&gt;Many developers are not aware that you can set breakpoints in the Call Stack Window (except when doing SQL debugging). Just highlight the call you want to stop on and either press F9 or right-click on the line and select Insert Breakpoint from the shortcut menu. You can also right-click on any breakpoint in the Call Stack Window to enable, disable or set the properties of the breakpoint. For those unfamiliar with the Call Stack Window, this is how you find out "how did I get here" - it enables you to go back up the call stack to find out "from where" the method that you are in was called. Not only can you see where it was called from, you can actually go "Back there" and trace the exact execution path in the debugger. Not to be an evangelist, but if you haven't discovered it yet, please do so now and "get religion".&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tip: Use Run to Cursor for one-shot breakpoints&lt;/b&gt;: All you need to do is right-click on the line you want and choose "Run to Cursor" from the menu, and program execution will immediately continue to the point where you are at. Many developers are not aware that this is available from both debugging and editing. In edit mode, this will actually start the debugger and run your program to the cursor location. As with breakpoints, right-clicking in the Call Stack window pops up the shortcut menu that also offers this feature.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tip: Set sub-expression breakpoints:&lt;/b&gt; For example, if you have the expression:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;for (int j=0; m=0;j&lt;activelines.count ;j++;m--)="" _moz-userdefined=""&gt;&lt;/activelines.count&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;when debugging, and you click in the margin next to the line, the breakpoint doesn't extend on the subexpressions that do the incrementing. By placing the cursor in the j++ or m-- portion of the line and hitting F9, you can set multiple breakpoints on the subexpressions and view these as separate entries in the Breakpoints window.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tip: Use the BreakPoints Window:&lt;/b&gt; If you know the name of the class and method you want to break on, you can choose New from the Breakpoints window and type it directly into the Function area of the window. Developers can spend 15 minutes wandering through their projects opening files just so they can position the cursor over a line of code and hit the F9 key to set a breakpoint. If you know the name of the class and method, doing it this way will find it and set the breakpoint. In addition, you can click it in the Breakpoints list of the window and go to the location automatically.&lt;br /&gt;&lt;br /&gt;You can also set a breakpoint by just entering the method name, if it is unique in your application. And, if it isn't you will actually get a list of ALL the locations where the method can be found, which is extremely useful for setting multiple breakpoints on a commonly used function throughout your project. It also displays for overloaded methods in the same class.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tip: Use the Find ComboBox:&lt;/b&gt; If you enter a method name in the Find Box (that's on the top menu bar, just to the right of the Configuration dropdown that reads Debug, Release, Configuration Manager) and hit F9, this will also find the method and set a breakpoint.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tip: Use Hit Counts:&lt;/b&gt; In the Breakpoints window, when you right-click and choose Properties and then click the Hit Counts button, you can modify a breakpoint with four possible combinations of choices. Experiment with this to see how useful it can be. What makes this especially useful is that when you have stopped in the Debugger, it tells you how many times your breakpoint has executed. You can also create conditional expressions that will trigger the debugger only if your expression evaluates to true or has changed since the last time it was evaluated.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tip: Use the Watch window (and its brethren):&lt;/b&gt; The power offered by the Watch window and its close cousins, the Quick Watch Dialog, Autos window, Locals window, and the This / Me window are what can make the difference between hopping around aimlessly all day looking for a bug and quickly solving a problem. Also, you can use any of these windows to change a variable's value by simply typing in a new value.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tip: Break only when a specific thread calls a method: &lt;/b&gt;To set a per-thread breakpoint, you need to uniquely identify a particular thread that you have given a name with its Name property. You can set a conditional breakpoint for a thread by creating a conditional expression such as "ThreadToStopOn" == Thread.CurrentThread.Name .&lt;br /&gt;&lt;br /&gt;You can manually change the name of a thread in the Watch window by watching variable "myThread" and entering a Name value for it in the value window. If you don't have a current thread variable to work with, you can use Thread.CurrentThread.Name to set the current thread's name. There is also a private integer variable in the Thread class, DONT_USE_InternalThread, this is unique to each thread. You can use the Threads window to get to the thread you want to stop on, and in the Watch window, enter Thread.CurrentThread.DONT_USE_InternalThread to see the value of it so you can create the right conditional breakpoint expression.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tip: Use Assertion Debugging: &lt;/b&gt;The idea behind asserts is very simple: When you are writing code, you understand that some condition is always expected to be true. If that condition is ever not true, then there is a bug. Asserts can be written so that if this condition is ever not true, the debugger will be launched at that exact point in your code:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;System.Diagnostics.Debug.Assert (myValue &amp;gt;=0)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The nice thing about Assert windows is that they not only give you the opportunity to break or not, they also show you the stack trace at that point. A very powerful, yet highly under-utilized feature.&lt;br /&gt;&lt;br /&gt;That's it for now. You can find out about the above tips and much more by reading some of the following books (there are many others besides these):&lt;br /&gt;&lt;br /&gt;Debugging Applications for Microsoft .NET and Microsoft Windows by John Robbins (MS Press)&lt;br /&gt;&lt;br /&gt;Debugging Strategies for .NET Developers by Darin Dillon (aPress)&lt;br /&gt;&lt;br /&gt;Comprehensive VB.NET Debugging by Mark Pearce (aPress)&lt;br /&gt;&lt;br /&gt;Finally, consider looking over the following documents:&lt;br /&gt;&lt;br /&gt;in the Documentation or on MSDN Online in the section "Building Debugging and Testing":&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/d8k88a0k%28vs.80%29.aspx"&gt;&lt;br /&gt;http://msdn2.microsoft.com/en-us/library/d8k88a0k(vs.80).aspx&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: right;"&gt;&lt;i&gt;&lt;span id="ctl00_MiddleContent_ArticleAuthorName"&gt;By Peter Bromberg&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-5833488318942962155?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/5833488318942962155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=5833488318942962155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5833488318942962155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5833488318942962155'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/09/efficient-debug-in-visual-studio-2005.html' title='Efficient debug in Visual Studio 2005'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-5000524835945183659</id><published>2008-09-14T19:22:00.000-07:00</published><updated>2008-09-14T19:24:58.416-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Others'/><title type='text'>Pass parameters to Install Shield ( MSI ) setup project</title><content type='html'>&lt;div class="date"&gt;12-31-2003, 05:06 PM&lt;/div&gt;&lt;div class="posttext"&gt;I have an InstallScript MSI project and I am trying to pass the command line parameters /z”abc” to setup.exe through the CmdLine entry in the setup.ini. It doesn’t seem to be working. If I do it directly by typing:&lt;br /&gt;&lt;br /&gt;setup.exe /z”abc”&lt;br /&gt;&lt;br /&gt;Everything works great and CMDLINE is equal to “abc”.  However, if I edit the setup.ini to read:&lt;br /&gt;&lt;br /&gt;[Startup]&lt;br /&gt;CmdLine=/z”abc”&lt;br /&gt;&lt;br /&gt;It doesn’t seem that anything gets into the variable CMDLINE in InstallScript.&lt;br /&gt;&lt;br /&gt;Does anyone have any ideas?&lt;/div&gt;&lt;hr /&gt;   &lt;div class="post"&gt;&lt;div class="posttop"&gt;&lt;div class="username"&gt;mr_anderson&lt;/div&gt;&lt;div class="date"&gt;01-02-2004, 03:27 AM&lt;/div&gt;&lt;/div&gt;&lt;div class="posttext"&gt;The values specified in the CmdLine get passed to msiexec and not to setup.exe. Thus the command line specified in setup.ini actually gets passed to msiexec's command line as /v"&lt;value_of_cmdline _moz-userdefined=""&gt;". &lt;br /&gt;&lt;br /&gt;Hope this helps.&lt;/value_of_cmdline&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr /&gt;   &lt;div class="post"&gt;&lt;div class="posttop"&gt;&lt;div class="username"&gt;cindyj&lt;/div&gt;&lt;div class="date"&gt;01-12-2004, 04:47 PM&lt;/div&gt;&lt;/div&gt;&lt;div class="posttext"&gt;You might be correct that this is how it works. However, IS's documentation says nothing about that. If there is no way to get /z to work from CmdLine in setup.ini then functionality has been lost if you have upgraded from IS Professional. This seems like a bug to me and I hope IS has a work order for it.&lt;br /&gt;&lt;br /&gt;http://documentation.installshield.com/robo/bin/robo.dll?tpc=%2frobo%2fprojects%2fhelplibdevstudio9%2fsetupini.htm%3frinolog28301%3dt&amp;amp;mgr=agm&amp;amp;wnd=installshieldlivinghelp%7cmain%20window&lt;br /&gt;&lt;br /&gt;CmdLine&lt;br /&gt;Setup reads the command line parameters specified in Setup.ini first, and then appends any command line parameters passed to Setup.exe from the command prompt.&lt;/div&gt;&lt;/div&gt;&lt;hr /&gt;   &lt;div class="post"&gt;&lt;div class="posttop"&gt;&lt;div class="username"&gt;kmoulton&lt;/div&gt;&lt;div class="date"&gt;06-29-2004, 02:18 PM&lt;/div&gt;&lt;/div&gt;&lt;div class="posttext"&gt;I am using DevStudio 9.  I have an InstallScript MSI project.&lt;br /&gt;&lt;br /&gt;How do you pass a command line parameter to setup.exe using Setup.ini?&lt;br /&gt;&lt;br /&gt;Is it true that "CmdLine=" in Setup.ini only passes this command to msiexec and not to setup.exe?&lt;br /&gt;&lt;br /&gt;I realize that I can pass a command line variable to setup.exe using:&lt;br /&gt;&lt;br /&gt;setup.exe /z"Whatever".&lt;br /&gt;&lt;br /&gt;I would have expected that using CmdLine=/z"Whatever" in setup.ini would have passed this command line variable to setup.exe. However, it does not.&lt;br /&gt;&lt;br /&gt;Has this functionality been lost?&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;--Kim&lt;/div&gt;&lt;/div&gt;&lt;hr /&gt;   &lt;div class="post"&gt;&lt;div class="posttop"&gt;&lt;div class="username"&gt;cindyj&lt;/div&gt;&lt;div class="date"&gt;06-29-2004, 02:26 PM&lt;/div&gt;&lt;/div&gt;&lt;div class="posttext"&gt;Unfortunately, I have never been able to get this to work and it is my opinion that it is functionality that has been lost. I hope someone at IS will read this and do something about it. PLEASE!!!!&lt;/div&gt;&lt;/div&gt;&lt;hr /&gt;   &lt;div class="post"&gt;&lt;div class="posttop"&gt;&lt;div class="username"&gt;Christopher Painter&lt;/div&gt;&lt;div class="date"&gt;06-29-2004, 04:11 PM&lt;/div&gt;&lt;/div&gt;&lt;div class="posttext"&gt;Setup /Z and CMDLINE is for InstallScript MSI projects only, not Basic MSI projects.&lt;br /&gt;&lt;br /&gt;If you really want to be able to pass data to MSI from the setup.ini then I suggest you just declare a public MSI property and pass the data with a setup /v"PROP=DATA"&lt;br /&gt;&lt;br /&gt;For example public MSI property PROP&lt;br /&gt;&lt;br /&gt;setup /v"PROP=DATA"&lt;br /&gt;&lt;br /&gt;or setup.exe with setup.ini&lt;br /&gt;&lt;br /&gt;[Startup]&lt;br /&gt;CmdLine=TEST=OOPS&lt;br /&gt;&lt;br /&gt;You have to remember MSI is not InstallShield Professional. Natively MSI only knows what an MSI file is and its processed by msiexec. Setup.exe is just a wrapper EXE that tries to bring the files along and transfer control to MSIEXEC. Basic MSI doesn't understand what CMDLINE is or what /Z is, only InstallScript projects do. Personally I avoid InstallScript projects because they are a combination of the worst of pure IShield Pro and MSI.&lt;/div&gt;&lt;/div&gt;&lt;hr /&gt;   &lt;div class="post"&gt;&lt;div class="posttop"&gt;&lt;div class="username"&gt;cindyj&lt;/div&gt;&lt;div class="date"&gt;06-29-2004, 05:03 PM&lt;/div&gt;&lt;/div&gt;&lt;div class="posttext"&gt;As both Kim and I clearly state we are using InstallScript MSI projects, not everyone wants to use a Basic MSI. If you are wondering why this post is in the Windows Installer projects section and not in the InstallScript projects section, maybe it should be in the other section, but InstallScript MSI projects are neither just one nor the other, so they have ended up in both sections from what I can tell.&lt;br /&gt;&lt;br /&gt;Your suggestion sounds like a good work around, but this is still lost functionality. DevStudio was advertised as bring InstallShield Professional and InstallShield Developer together into one software package. Setup.exe is a wrapper but it is from InstallShield so they should be able to fix this issue. If you are using an InstallScript or an InstallScript MSI project you still should be able to get information to CMDLINE via the setup.ini. Just because MSI is being used as the engine to install your files, it shouldn’t have any impact on this issue.&lt;br /&gt;&lt;br /&gt;Personally, for very complex installs I find InstallScript MSI projects much friendlier to work with. I find Basic MSI’s, just that basic.&lt;/div&gt;&lt;/div&gt;&lt;hr /&gt;   &lt;div class="post"&gt;&lt;div class="posttop"&gt;&lt;div class="username"&gt;Christopher Painter&lt;/div&gt;&lt;div class="date"&gt;06-29-2004, 07:56 PM&lt;/div&gt;&lt;/div&gt;&lt;div class="posttext"&gt;Originally posted by cindyj &lt;br /&gt;As both Kim and I clearly state we are using InstallScript MSI projects, not everyone wants to use a Basic MSI. If you are wondering why this post is in the Windows Installer projects section and not in the InstallScript projects section, maybe it should be in the other section, but InstallScript MSI projects are neither just one nor the other, so they have ended up in both sections from what I can tell.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;They used to have 3 seperate forums, Professional , BasicMSI and InstallScript MSI. Now they only have Professional and WindowsInstaller with no distinction made for InstallScript MSI projects. Sorry I didn't realize you were doing an InstallScript MSI based on your posts.&lt;br /&gt;&lt;br /&gt;Personally, for very complex installs I find InstallScript MSI projects much friendlier to work with. I find Basic MSI’s, just that basic. &lt;br /&gt;&lt;br /&gt;Many of us find InstallScript MSI projects are just a hacked up combination of MSI and Professional technology.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-5000524835945183659?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/5000524835945183659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=5000524835945183659' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5000524835945183659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5000524835945183659'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/09/pass-parameters-to-install-shield-msi.html' title='Pass parameters to Install Shield ( MSI ) setup project'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-1617055715784556083</id><published>2008-09-11T07:00:00.000-07:00</published><updated>2008-09-11T07:00:02.891-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Detecting Session Timeout in ASP.NET 2.0 Web Application</title><content type='html'>&lt;strong&gt;Problem:&lt;/strong&gt; An ASP.NET 2.0 web application needs to detect a session timeout condition so that the user can be redirected to a different page and / or an error message is displayed.&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt; There are three ways of approaching this problem, starting off with the simplest one to the most complicated one. So, here it goes:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Using Session["xxx"] value to determine the session timeout:&lt;/strong&gt; This is a &lt;em&gt;"quick and dirty"&lt;/em&gt; hack that can be introduced into an application to figure out whether a timeout has occured. We need to do two things here. &lt;br /&gt;&lt;em&gt;First, in Global.asax, create your own GUID and put it in the session object,&lt;/em&gt;&lt;br /&gt;&lt;span style="color: blue; font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; Session_Start(&lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;object&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; sender, &lt;/span&gt;&lt;span style="color: #2b91af; font-size: x-small;"&gt;EventArgs&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; e) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: green; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Code that runs when a new session is started&lt;br /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Session["CustomSessionId"] = &lt;span style="color: #2b91af; font-size: x-small;"&gt;Guid&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;.NewGuid();&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;em&gt;&lt;br /&gt;Second&lt;/em&gt;, BasePage.cs which would have inherited Page, in PageLoad() event, check whether the Session["CustomSessionId"] == null, if it&amp;nbsp;IS null, it means that the session was timed-out and AspNet runtime cleared it out.&lt;br /&gt;&lt;span style="color: blue; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;( Session[&lt;/span&gt;&lt;span style="color: #a31515; font-size: x-small;"&gt;"CustomSessionId"&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;] == &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;null&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect(&lt;/span&gt;&lt;span style="color: #a31515; font-size: x-small;"&gt;"TimeoutPage.htm"&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/li&gt;&lt;li&gt; &lt;div mce_keep="true"&gt;&lt;strong&gt;Using a combination of Session.IsNewSession and Request.Cookies collection:&lt;/strong&gt; Leveraging the behavior of ASP.NET runtime, we can check whether the Session.IsNewSession flag is true, if its true and we find that &lt;span style="font-size: x-small;"&gt;Request.Cookies[&lt;/span&gt;&lt;span style="color: #a31515; font-size: x-small;"&gt;"ASP.NET_SessionId"&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;] has a valid value, it means that a timeout occured and a new request was generated by the runtime. This code fragment can be inserted into the OnInit(...) method in the BasePage class so that it applies across the application.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: blue; font-size: x-small;"&gt;protected&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;override&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;void&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; OnInit(&lt;/span&gt;&lt;span style="color: #2b91af; font-size: x-small;"&gt;EventArgs&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; e)&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; base&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;.OnInit(e);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;if&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; (Context.Session != &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;null&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green; font-size: x-small;"&gt;//check whether a new session was generated&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; (Session.IsNewSession)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green; font-size: x-small;"&gt;//check whether a cookies had already been associated with this request&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af; font-size: x-small;"&gt;HttpCookie&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; sessionCookie = Request.Cookies[&lt;/span&gt;&lt;span style="color: #a31515; font-size: x-small;"&gt;"ASP.NET_SessionId"&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;if&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; (sessionCookie != &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;null&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;string&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; sessionValue = sessionCookie.Value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;if&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; (!&lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;string&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;.IsNullOrEmpty(sessionValue))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: green; font-size: x-small;"&gt;// we have session timeout condition!&lt;br /&gt;&lt;/span&gt;&lt;span style="color: green; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Response.Redirect("SessionTimeout.htm");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-size: x-small;"&gt;Session[&lt;/span&gt;&lt;span style="color: #a31515; font-size: x-small;"&gt;"IsSessionTimeOut"&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;] = &lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;true&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;&lt;em&gt;&lt;strong&gt;WARNING&lt;/strong&gt;:- We will have to wireup the&amp;nbsp;"&lt;span style="color: blue; font-size: x-small;"&gt;void&lt;/span&gt;&lt;span style="color: black; font-size: x-small;"&gt; Session_Start(&lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;object&lt;/span&gt;&lt;span style="color: black; font-size: x-small;"&gt; sender, &lt;/span&gt;&lt;span style="color: #2b91af; font-size: x-small;"&gt;EventArgs&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt; e)&lt;/span&gt;&lt;/span&gt;" method in the Global.asax to use the Session.IsNewSession meaningfully. ASP.NET 2.0 runtime is a bit weird in the sense that it will always return the value of Session.IsNewSession as true in case the Event is not wireup!&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;strong&gt;Using HTTP Module:&lt;/strong&gt; Arguably the most complex but robust way to tackle this situation. I would rather not go into this as this carries the risk of opening security holes in the HTTP stream&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: right;"&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;from Nikhil's Blog&lt;/i&gt;&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1&gt;&lt;/h1&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-1617055715784556083?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/1617055715784556083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=1617055715784556083' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1617055715784556083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1617055715784556083'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/09/detecting-session-timeout-in-aspnet-20.html' title='Detecting Session Timeout in ASP.NET 2.0 Web Application'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-7064207265676954091</id><published>2008-09-10T07:00:00.000-07:00</published><updated>2008-09-10T07:00:09.845-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Build an ASP.NET Session Timeout Redirect Control</title><content type='html'>We often get forum posts here asking "How can I tell if a user's &lt;span id="srch" style="background-color: lightcyan;" title="Click to Search Related.."&gt;Session&lt;/span&gt; is timed out, and perform some action in response?" Often this involves the incorrect assumption that the Session_End event can be used for this. ASP.NET implements a rolling timeout mechanism that extinguishes the session information for a user if no request is received within the timeout period. Session_End happens on the server automatically regardless of whether a user has requested a page, so the idea of using it to do anything other than cleanup-type operations is a mistake; it is independent of the page lifecycle and there is no active Request or Response object to access there. &lt;br /&gt;It is often important for the business logic of an ASP.NET site to know for a particular request if the user’s session information is valid (e.g., a timeout has not occurred). Without this technique it is difficult to know, when a session variable is not found, whether it was never set properly or that the user simply waited too long between requests.&amp;nbsp; Logic normally dictates that if a session is expired, any saved state needs to be recycled back to its starting state, and typically the user should also be required to re-authenticate to the site in order to enable them to start whatever process they abandoned again from the beginning. &lt;br /&gt;&lt;table align="center" border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="center" valign="bottom"&gt;&lt;div id="AdPage" name="AdPage"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;ASP.NET developers habitually reference Session variables without ever checking for null first to see if they are actually present,&amp;nbsp;&amp;nbsp;which causes the "Object reference not set" exception.&amp;nbsp;That yellow error page doesn't look very professional to the user, either. &lt;br /&gt;So, I set out to do some more research and see what solutions might be possible. One of the ideas I got was that a site-wide session-expiry mechanism might be overkill, since usually only certain pages (such as those involved in a shopping cart) are involved in the need for protection against expired sessions. That's what brought me to think of the idea of a "drop on the page" Session Timeout "Detect and Redirect" Control. You should be able to just drop it on the pages that need it, set the redirect url, and you would be "good to go". (I should add here that based on some reader confusion in the posts below, if you do not need a page-specific solution, you can just use the Base Page class approach, or if you don't want to use a base Page class, instead you could write an HttpModule to do this and register it in web.config.) &lt;br /&gt;The only credible information I found came from a source whose work I have relied on before, Robert Boedigheimer. Robert's original article about this &lt;a href="http://aspalliance.com/520" target="_blank"&gt;may be viewed here&lt;/a&gt;. In sum, what Robert found was that the ASP.NET HttpSessionState class's IsNewSession( ) method returns true if a new session was created for a given request.&amp;nbsp; If this is a new session but the ASP.NET_SessionId cookie is present, this indicates a timeout situation.&amp;nbsp;You may need to think about this for a while, but eventually the logic should make sense. In addition, he determined that one must access this cookie from the Request Headers collection rather than the expected Cookie collection. This is because the intrinsic Response.Cookies and Request.Cookies objects actually share the same collection, and in this test we only want to inspect the actual cookie from the Request Headers. &lt;br /&gt;With this information in hand, it was very easy to create a "non-visible" ASP.NET Server control that would hook and override a late Page LifeCycle event, PreRender, to perform this check. Add a public property for the RedirectUrl, call SignOut on any Forms Authentication to force the user to login to the site over again, and send them to the login page. Let's take a look at the code for the control:&lt;br /&gt;&lt;br /&gt;&lt;div style="-moz-background-clip: -moz-initial; -moz-background-inline-policy: -moz-initial; -moz-background-origin: -moz-initial; background: lightgrey none repeat scroll 0% 50%; border: 1pt solid windowtext; color: black; font-family: Arial; font-size: 10pt; padding: 0pt; width: 675px;"&gt;&lt;div style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; PAB.WebControls&lt;/div&gt;&lt;div style="margin: 0px;"&gt;{&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.ComponentModel;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Web;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Web.Security;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Web.UI;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DefaultProperty("Text"),&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ToolboxData("&amp;lt;{0}:SessionTimeoutControl runat=server&amp;gt;")]&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; SessionTimeoutControl : Control&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; _redirectUrl;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [Bindable(&lt;span style="color: blue;"&gt;true&lt;/span&gt;),&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Category("Appearance"),&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DefaultValue("")]&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; RedirectUrl&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; _redirectUrl; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt; { _redirectUrl = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; Visible&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;false&lt;/span&gt;; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; EnableViewState&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;false&lt;/span&gt;; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;protected&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Render(HtmlTextWriter writer)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (HttpContext.Current == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; writer.Write("[ *** SessionTimeout: " + &lt;span style="color: blue;"&gt;this&lt;/span&gt;.ID + " *** ]");&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;base&lt;/span&gt;.Render(writer);&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;protected&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; OnPreRender(EventArgs e)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;base&lt;/span&gt;.OnPreRender(e);&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (&lt;span style="color: blue;"&gt;this&lt;/span&gt;._redirectUrl == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; InvalidOperationException("RedirectUrl Property Not Set.");&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (Context.Session != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (Context.Session.IsNewSession)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; sCookieHeader = Page.Request.Headers["Cookie"];&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; ((&lt;span style="color: blue;"&gt;null&lt;/span&gt; != sCookieHeader) &amp;amp;&amp;amp; (sCookieHeader.IndexOf("ASP.NET_SessionId") &amp;gt;= 0))&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (Page.Request.IsAuthenticated)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FormsAuthentication.SignOut();&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.Redirect(&lt;span style="color: blue;"&gt;this&lt;/span&gt;._redirectUrl);&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;}&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;In the OnPreRender event, we let the page control tree do it's thing first, then we do ours. First I check to see if the developer forgot to set the RedirectUrl property on the Control, because without that we would be all dressed up with no place to go. Then we check to see if there is actually a Session, and if so, we check the IsNewSession property. If it is true, we need to check our cookie, so we strip it out of the Request's Headers Collection and test for the "ASP.NET_SessionId" standard cookie name. If the sCookieHeader string is not null and the "ASP.NET_SessionId" cookie name is there, we know we have a timeout situation for this user. First we check to see if Authentication is being used and call the Forms SignOut method. This will ensure that the user must re-authenticate. Finally, we redirect the user to the specified redirect page on the site.&lt;br /&gt;The beauty of this arrangement is that it requires no base page class to inherit from; you simply drop the control onto any page that needs to be involved in this process. Not only that, but because there is a separate instance of the control on each page that needs it, you could even have more than one RedirectUrl depending on the particular business logic, each presenting different information to the user. The downloadable solution below contains the source code and project for the Control, as well as a test web project with a starting page (that has the control) and a redirect page. The Session Timeout in the web.config is set to 1 minute so you can easily test it. This should work equally well in Visual Studio 2005 with ASP.NET 2.0.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: right;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;b&gt;&lt;span style="font-family: Verdana,Arial,Helvetica,sans-serif;"&gt;             by             Peter A. Bromberg, Ph.D.&lt;/span&gt;&lt;/b&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-7064207265676954091?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/7064207265676954091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=7064207265676954091' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7064207265676954091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7064207265676954091'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/09/build-aspnet-session-timeout-redirect.html' title='Build an ASP.NET Session Timeout Redirect Control'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-3732299965646708583</id><published>2008-09-09T07:00:00.000-07:00</published><updated>2008-09-09T07:00:01.568-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'></title><content type='html'>We often get forum posts here asking "How can I tell if a user's &lt;span id="srch" style="background-color: lightcyan;" title="Click to Search Related.."&gt;Session&lt;/span&gt; is timed out, and perform some action in response?" Often this involves the incorrect assumption that the Session_End event can be used for this. ASP.NET implements a rolling timeout mechanism that extinguishes the session information for a user if no request is received within the timeout period. Session_End happens on the server automatically regardless of whether a user has requested a page, so the idea of using it to do anything other than cleanup-type operations is a mistake; it is independent of the page lifecycle and there is no active Request or Response object to access there. &lt;br /&gt;It is often important for the business logic of an ASP.NET site to know for a particular request if the user’s session information is valid (e.g., a timeout has not occurred). Without this technique it is difficult to know, when a session variable is not found, whether it was never set properly or that the user simply waited too long between requests.&amp;nbsp; Logic normally dictates that if a session is expired, any saved state needs to be recycled back to its starting state, and typically the user should also be required to re-authenticate to the site in order to enable them to start whatever process they abandoned again from the beginning. &lt;br /&gt;&lt;table align="center" border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="center" valign="bottom"&gt;&lt;div id="AdPage" name="AdPage"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;ASP.NET developers habitually reference Session variables without ever checking for null first to see if they are actually present,&amp;nbsp;&amp;nbsp;which causes the "Object reference not set" exception.&amp;nbsp;That yellow error page doesn't look very professional to the user, either. &lt;br /&gt;So, I set out to do some more research and see what solutions might be possible. One of the ideas I got was that a site-wide session-expiry mechanism might be overkill, since usually only certain pages (such as those involved in a shopping cart) are involved in the need for protection against expired sessions. That's what brought me to think of the idea of a "drop on the page" Session Timeout "Detect and Redirect" Control. You should be able to just drop it on the pages that need it, set the redirect url, and you would be "good to go". (I should add here that based on some reader confusion in the posts below, if you do not need a page-specific solution, you can just use the Base Page class approach, or if you don't want to use a base Page class, instead you could write an HttpModule to do this and register it in web.config.) &lt;br /&gt;The only credible information I found came from a source whose work I have relied on before, Robert Boedigheimer. Robert's original article about this &lt;a href="http://aspalliance.com/520" target="_blank"&gt;may be viewed here&lt;/a&gt;. In sum, what Robert found was that the ASP.NET HttpSessionState class's IsNewSession( ) method returns true if a new session was created for a given request.&amp;nbsp; If this is a new session but the ASP.NET_SessionId cookie is present, this indicates a timeout situation.&amp;nbsp;You may need to think about this for a while, but eventually the logic should make sense. In addition, he determined that one must access this cookie from the Request Headers collection rather than the expected Cookie collection. This is because the intrinsic Response.Cookies and Request.Cookies objects actually share the same collection, and in this test we only want to inspect the actual cookie from the Request Headers. &lt;br /&gt;With this information in hand, it was very easy to create a "non-visible" ASP.NET Server control that would hook and override a late Page LifeCycle event, PreRender, to perform this check. Add a public property for the RedirectUrl, call SignOut on any Forms Authentication to force the user to login to the site over again, and send them to the login page. Let's take a look at the code for the control:&lt;br /&gt;&lt;div style="-moz-background-clip: -moz-initial; -moz-background-inline-policy: -moz-initial; -moz-background-origin: -moz-initial; background: lightgrey none repeat scroll 0% 50%; border: 1pt solid windowtext; color: black; font-family: Arial; font-size: 10pt; padding: 0pt; width: 675px;"&gt;&lt;div style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; PAB.WebControls&lt;/div&gt;&lt;div style="margin: 0px;"&gt;{&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.ComponentModel;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Web;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Web.Security;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Web.UI;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DefaultProperty("Text"),&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ToolboxData("&amp;lt;{0}:SessionTimeoutControl runat=server&amp;gt;")]&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; SessionTimeoutControl : Control&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; _redirectUrl;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [Bindable(&lt;span style="color: blue;"&gt;true&lt;/span&gt;),&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Category("Appearance"),&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DefaultValue("")]&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; RedirectUrl&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; _redirectUrl; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt; { _redirectUrl = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; Visible&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;false&lt;/span&gt;; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; EnableViewState&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;false&lt;/span&gt;; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;protected&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Render(HtmlTextWriter writer)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (HttpContext.Current == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; writer.Write("[ *** SessionTimeout: " + &lt;span style="color: blue;"&gt;this&lt;/span&gt;.ID + " *** ]");&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;base&lt;/span&gt;.Render(writer);&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;protected&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; OnPreRender(EventArgs e)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;base&lt;/span&gt;.OnPreRender(e);&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (&lt;span style="color: blue;"&gt;this&lt;/span&gt;._redirectUrl == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; InvalidOperationException("RedirectUrl Property Not Set.");&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (Context.Session != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (Context.Session.IsNewSession)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; sCookieHeader = Page.Request.Headers["Cookie"];&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; ((&lt;span style="color: blue;"&gt;null&lt;/span&gt; != sCookieHeader) &amp;amp;&amp;amp; (sCookieHeader.IndexOf("ASP.NET_SessionId") &amp;gt;= 0))&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (Page.Request.IsAuthenticated)&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FormsAuthentication.SignOut();&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.Redirect(&lt;span style="color: blue;"&gt;this&lt;/span&gt;._redirectUrl);&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="margin: 0px;"&gt;}&lt;/div&gt;&lt;/div&gt;In the OnPreRender event, we let the page control tree do it's thing first, then we do ours. First I check to see if the developer forgot to set the RedirectUrl property on the Control, because without that we would be all dressed up with no place to go. Then we check to see if there is actually a Session, and if so, we check the IsNewSession property. If it is true, we need to check our cookie, so we strip it out of the Request's Headers Collection and test for the "ASP.NET_SessionId" standard cookie name. If the sCookieHeader string is not null and the "ASP.NET_SessionId" cookie name is there, we know we have a timeout situation for this user. First we check to see if Authentication is being used and call the Forms SignOut method. This will ensure that the user must re-authenticate. Finally, we redirect the user to the specified redirect page on the site.&lt;br /&gt;The beauty of this arrangement is that it requires no base page class to inherit from; you simply drop the control onto any page that needs to be involved in this process. Not only that, but because there is a separate instance of the control on each page that needs it, you could even have more than one RedirectUrl depending on the particular business logic, each presenting different information to the user. The downloadable solution below contains the source code and project for the Control, as well as a test web project with a starting page (that has the control) and a redirect page. The Session Timeout in the web.config is set to 1 minute so you can easily test it. This should work equally well in Visual Studio 2005 with ASP.NET 2.0.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: right;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;strong&gt;&lt;span style="font-family: Verdana,Arial,Helvetica,sans-serif;"&gt;             by             Peter A. Bromberg, Ph.D.&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-3732299965646708583?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/3732299965646708583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=3732299965646708583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/3732299965646708583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/3732299965646708583'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/09/we-often-get-forum-posts-here-asking.html' title=''/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-9033231932973451083</id><published>2008-09-08T07:00:00.000-07:00</published><updated>2008-09-08T07:00:01.238-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bài tiếng Việt'/><title type='text'>Hướng dẫn config và sử dụng ASP.NET Session State</title><content type='html'>&lt;table border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td id="spanstoryTitle" style="padding-left: 9px;"&gt;&lt;br /&gt;&lt;/td&gt;                       &lt;/tr&gt;&lt;tr&gt;                     &lt;td style="padding-left: 5px;"&gt;&lt;span id="tdStoryTeaser"&gt;&lt;span class="story_teaser" id="StoryTeaser" style="padding-left: 4px;"&gt;Với ASP.net trạng thái của session (session state) có thể được server lưu trữ dưới nhiều dạng khác nhau và mỗi dạng lưu trữ sẽ có những ưu điểm riêng.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                    &lt;/tr&gt;&lt;tr&gt;                     &lt;td&gt;&lt;span id="tdStoryPrice"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;                    &lt;/tr&gt;&lt;tr&gt;                     &lt;td height="6"&gt;&lt;br /&gt;&lt;/td&gt;                    &lt;/tr&gt;&lt;tr&gt;                     &lt;td&gt;&lt;span class="content" id="tdStoryBody"&gt;&lt;span style="color: #ff9933; font-size: 12pt;"&gt;&lt;span style="color: #ff9933; font-size: 12pt;"&gt;&lt;span style="color: #333399; font-size: 11pt;"&gt;&lt;span style="color: #333399; font-size: 11pt;"&gt; &lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;b&gt;Môi trường minh họa&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;-&amp;nbsp;Operation: Windows XP sp2 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;-&amp;nbsp;Webserver: IIS 6 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;-&amp;nbsp;.netframework: 2.0 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;-&amp;nbsp;SQL server 2005 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;b&gt;Giới thiệu:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;Đa số các ứng dụng web đều quản lý thông tin session khi ứng dụng đó có phân quyền. Với ASP.net trạng thái của session (session state) có thể được server lưu trữ dưới nhiều dạng khác nhau và mỗi dạng lưu trữ sẽ có những ưu điểm riêng. Trong bài này chúng ta sẽ tìm hiểu về các dạng lưu trữ session của asp.net và cách sử dụng nó.&lt;/span&gt;&lt;/div&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;b&gt;Nội dung:&lt;br /&gt;&lt;/b&gt;Các vấn đề thường gặp khi sử dụng sesson với asp cổ điền và khắc phục với asp.net&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;Với các lập trình viên asp thì session là một tính năng thật tuyệt vời nhưng vẫn còn tồn tại nhiều giới hạn:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;§ Vấn đề Độc lập trong xử lý: asp session tồn tại luồng xử lý (process) của server đặt website, các tác động lên luồng xử lý của server đặt website đồng nghĩa với sự tác động lên session.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;§ Vấn đề giới hạn Server farm : Với những server load balancing (chạy song song 2 hoặc nhiều server cho 1 website) session không thể chia sẻ giữa các server.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;§ Vấn đề phụ thuộc cookie : Nếu trình duyệt disable cookie thì coi như session cũng đi theo ông bà luôn :D.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;Những cải tiến của asp.net session state giải quyết các giới hạn của session dùng trong asp cổ điển:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;§ Vấn đề Độc lập trong xử lý: asp.net session state có thể load độc lập với tiến trình xử lý của web server đặt website (the ASP.NET host process) như thế session vẫn có thể tồn tại khi tiến trình sử lý của webserver bị ngắt hoặc dán đoạn. Tất nhiên bạn cũng có thể config cho asp.net state làm việc giống asp cổ điển.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;§ Vấn đề giới hạn Server farm : Với việc xử lý độc lập session thì asp.net có thể support luôn mô hình load balancing.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;§ Vấn đề phụ thuộc cookie: mặc dù giải pháp không phụ thuộc cookie (cookieless) đã có từ thời asp nhưng sử dụng nó rất phức tạp. Với asp.net chỉ cần 1 thông số config là mọi chuyện ok. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;Nơi config asp.net session state và giải thích thuộc tính khi config&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;Các thông tin config cho asp.net session state đều nằm trong tập tin web.config:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;configuration _moz-userdefined=""&gt;&lt;/configuration&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;system.web _moz-userdefined=""&gt;&lt;/system.web&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;sessionstate _moz-userdefined=""&gt; &lt;/sessionstate&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;Các thuộc tính config trong element "sessionState":&lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;Một ví dụ : &lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;sessionstate _moz-userdefined=""&gt;&lt;/sessionstate&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;mode="StateServer"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;cookieless="false"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;timeout="20"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;sqlConnectionString="data source=127.0.0.1;userid sa;password = your passwords"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;stateConnectionString="tcpip=127.0.0.1:42424"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;b&gt;Thuộc tính mode:&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt; &lt;div style="margin: 6pt 0in;"&gt;&lt;span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;Attribute&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt; &lt;div style="margin: 6pt 0in;"&gt;&lt;span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;Option&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt; &lt;div style="margin: 6pt 0in;"&gt;&lt;span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;Description&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td&gt; &lt;div style="margin: 6pt 0in;"&gt;&lt;span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;mode&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt; &lt;/td&gt; &lt;td&gt; &lt;div style="margin: 6pt 0in;"&gt;&lt;span&gt;&lt;span style="color: black; font-size: x-small;"&gt;Chỉ định nơi lưu trữ trạng thái session&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td&gt; &lt;/td&gt; &lt;td&gt; &lt;div style="margin: 6pt 0in;"&gt;&lt;span&gt;&lt;span style="color: black; font-size: x-small;"&gt;Off&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt; &lt;span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;Tắt chế độ session&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td&gt; &lt;/td&gt; &lt;td&gt; &lt;div style="margin: 6pt 0in;"&gt;&lt;span&gt;&lt;span style="color: black; font-size: x-small;"&gt;InProc&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt;&lt;br /&gt;&lt;li style="margin-bottom: 6pt; margin-top: 6pt;"&gt;&lt;span&gt; &lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;Sử dụng giống asp cổ điển, nghĩa là tiến trình xử lý session sẽ chung với tiến trình xử lý webserver.&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td&gt; &lt;/td&gt; &lt;td&gt; &lt;div style="margin: 6pt 0in;"&gt;&lt;span&gt;&lt;span style="color: black; font-size: x-small;"&gt;StateServer&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt;&lt;br /&gt;&lt;li style="margin-bottom: 6pt; margin-top: 6pt;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;Trạng thái session được lưu trữ độc lập với tiến trình xử lý của webserver và được quản lý bởi 1 service chạy trên nền windows.Thông tin về service này được quy định bởi thuộc tính &lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-family: 'Courier New';"&gt;stateConnectionString&lt;/span&gt;&lt;span&gt;.&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;&lt;br /&gt;&lt;li style="margin-bottom: 6pt; margin-top: 6pt;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;Hỗ trợ Load Balancing&lt;/span&gt;&lt;span&gt;&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt; &lt;/li&gt;&lt;br /&gt;&lt;li style="margin-bottom: 6pt; margin-top: 6pt;"&gt;&lt;span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;Với dạng lưu trữ này session chỉ có thể bị mất khi service đề cập ở trên ngưng hoạt động (không tính dzụ time out và tắt trình duyệt nha ^_^)&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td&gt; &lt;/td&gt; &lt;td&gt; &lt;div style="margin: 6pt 0in;"&gt;&lt;span&gt;&lt;span style="color: black; font-size: x-small;"&gt;SQLServer&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt; &lt;ul style="margin-top: 0in;"&gt;&lt;li style="margin-bottom: 6pt; margin-top: 6pt;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;Giống như StateServer nhưng trạng thái session đươc lưu trữ dưới database và thuộc tính &lt;/span&gt;sqlConnectionString &lt;span&gt;sẽ chứa thông tin về cần thiết để truy cập database.&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt; &lt;/li&gt;&lt;li style="margin-bottom: 6pt; margin-top: 6pt;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;Hỗ trợ Load Balancing&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt; &lt;/li&gt;&lt;li style="margin-bottom: 6pt; margin-top: 6pt;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;Với dạng lưu trữ này session chỉ có thể mất khi time out hoặc khi bạn tắt trình duyệt&lt;/span&gt;&lt;span&gt;&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div align="justify"&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;Thuộc tính &lt;span style="color: red; font-family: 'Courier New';"&gt;cookieless&lt;/span&gt;: khi thuộc tình này có giá trị là true thì asp.net session state sẽ không sử dụng cookie để xửlý session. Lúc đó thông tin sẽ được lưu trữ ngay trên url và asp.net sẽ tự thêm vào url bình thường của bạn những chuỗi ký tự mã hóa. Ví dụ:&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="BBcode"&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&lt;span style="color: black; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;http://localhost/(lit3py55t21z5v55vlm25s55)/Appliction/SessionTest.aspx&lt;/span&gt;&lt;/span&gt;&lt;o:p _moz-userdefined=""&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div align="justify" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span&gt;§&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;Thuộc tính &lt;span style="color: red; font-family: 'Courier New';"&gt;timeout: &lt;/span&gt;&lt;span&gt;chứa giá trị quy định thời gian time out của session (tính bằng phút).&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span&gt;§&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Thuộc tính &lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New';"&gt;sqlConnectionString: &lt;/span&gt;&lt;span&gt;chứa chuỗi kết nối databse khi thuộc tính mode là SQLServer.&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span&gt;§&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Thuộc tính &lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New';"&gt;stateConnectionString: &lt;/span&gt;&lt;span&gt;chứa thông tin về server, port, giao thức truy cập host chứa db khi thuộc tính mode là SQLServer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="color: #333399; font-size: 11pt;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;b&gt;Cách config các dạng lưu trữ session state trong web.config&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-left: 39pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span&gt;1.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;InProc&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;: khi mode được set giá trị này thì chỉ có thuộc tính timeout có tác dụng, với thiết lập này session của asp.net sẽ làm việc giống asp cổ điển.&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Ví dụ: &lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New';"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: 'Courier New';"&gt;sessionState&lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New';"&gt; &lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New';"&gt;mode&lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;InProc&lt;/span&gt;"&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;timeout&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;20&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;o:p _moz-userdefined=""&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-left: 39pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span&gt;2.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;StateServer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;: để sử dụng được chế độ này bạn hãy khởi động service “&lt;st1:place _moz-userdefined="" w:st="on"&gt;&lt;st1:placename _moz-userdefined="" w:st="on"&gt;Asp.net&lt;/st1:placename&gt; &lt;st1:place _moz-userdefined="" w:st="on"&gt;State&lt;/st1:place&gt;&lt;/st1:place&gt; service“&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt; &lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;ví dụ:&lt;span style="color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: 'Courier New';"&gt;sessionstate &lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New';"&gt;mode&lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;"&lt;span style="color: blue;"&gt;stateserver&lt;/span&gt;" &lt;span style="color: blue;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;cookieless&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;false&lt;/span&gt;" &lt;span style="color: blue;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;timeout&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;20&lt;/span&gt;"&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span&gt;3.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;SQLServer&lt;/span&gt;&lt;span&gt;: Để sử dụng chế độ này bạn phải:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div style="margin-left: 75pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;span&gt;o&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Khởi động service “asp.net state service” giống như trên.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-left: 75pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;span&gt;o&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;Cài đặt database cho asp.net sesssion : &lt;br /&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;vào start --&amp;gt; run --&amp;gt; cmd &lt;br /&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;gõ lệnh : CD C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727&lt;br /&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;gõ lệnh : osql –S [server name] –U [user] –P [password] &lt;installsqlstate.sql _moz-userdefined=""&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;với [server name] là tên hosting, [User] là tên truy cập sql, [password]là password truy cập sql.&lt;br /&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;(ví dụ: osql -S kokichi\sqlexpress -U sa -P 123456 &lt;installsqlstate.sql) _moz-userdefined=""&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;sau khi lện này chạy thành công, một database với tên “ASPState” sẽ được tạo để chứa dữ liệu của session.&lt;/installsqlstate.sql)&gt;&lt;/installsqlstate.sql&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-left: 75pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;span&gt;o&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;Thiết lập thông tin trong web.config&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ví dụ: &lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New';"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: 'Courier New';"&gt;sessionState&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: blue; font-family: 'Courier New';"&gt; &lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New';"&gt;mode&lt;/span&gt;&lt;span style="color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt;"&lt;span style="color: blue;"&gt;InProc&lt;/span&gt;"&lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: blue;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;cookieless&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;false&lt;/span&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: blue;"&gt; &lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;timeout&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;20&lt;/span&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: blue;"&gt; &lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;sqlConnectionString&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;data source=127.0.0.1;user id=sa;password=123456&lt;/span&gt;" &lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: red;"&gt;stateConnectionString&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;tcpip=127.0.0.1:42424&lt;/span&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black; font-family: Verdana; font-size: x-small;"&gt; &lt;br /&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="color: #ff9933; font-size: 12pt;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;b&gt;Tham khảo&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-left: 39pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span&gt;&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;http://www.codeproject.com/aspnet/ASPNETSessionInternals.asp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-left: 39pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Verdana;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span&gt;&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;http://msdn2.microsoft.com/en-us/library/ms972429.aspx&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-9033231932973451083?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/9033231932973451083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=9033231932973451083' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/9033231932973451083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/9033231932973451083'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/09/hng-dn-config-v-s-dng-aspnet-session.html' title='Hướng dẫn config và sử dụng ASP.NET Session State'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-6829471953649496711</id><published>2008-09-07T18:29:00.000-07:00</published><updated>2008-09-07T18:34:11.353-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How ASP.NET Sessions Are Implemented</title><content type='html'>&lt;span id="intellitTxt"&gt;&lt;a class="pageTitle" href="" id="#Page1"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="KonaBody"&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;ASP.NET provides a framework for storing data that is specific to an individual user with the Session object. A page can add information to the Session object, and any other page can then retrieve the information for the same user. In order to preserve server memory, ASP.NET implements a rolling timeout mechanism which discards the session information for a user if no request is seen within the timeout period (default 20 minutes which is reset with each request). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;It is often useful in an ASP.NET site to know for a particular request if the user’s session information is still intact (that a timeout has not occurred). One common need is to be able to inform the user why they lost their session information, by redirecting to a page that describes the timeout amount and how to avoid the problem in the future.&amp;nbsp; Without this technique it is difficult to know if a session variable is not present whether it was never set properly or the user waited too long between requests.&amp;nbsp; Many ASP.NET developers just reference session variables without first ensuring they are actually present.&amp;nbsp;&amp;nbsp;This causes the infamous "Object reference not set" exception, which can be very difficult to trace back to the specific cause.&amp;nbsp; Code that checks for null session values is useful, but does not help the developer understand if it was never set properly or if the user just lost her session.&amp;nbsp; This technique can help to clearly identify&amp;nbsp;that the user waited to long between requests and the session storage information was removed.&lt;br /&gt;&lt;br /&gt;This is not the same as using the Session_OnEnd event which can be used for cleanup, logging, or other purposes.&amp;nbsp; It is also not for enforcing security on a web site.&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;h3&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;How Sessions Are Implemented &lt;/span&gt;&lt;/h3&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;Since the HTTP protocol used by web browsers to request files from web servers is stateless, ASP.NET needs to determine which requests were from the same user. The primary mechanism utilizes a non-persistent cookie that is issued by the web server that contains a session id value. The id provided by this cookie is the key used to index into the session infrastructure to access the user's specific data. The session framework is implemented by the HTTP module System.Web.SessionState.SessionStateModule, which executes before the .aspx page events. The module uses the EnableSessionState attribute from the @Page directive to determine if it must retrieve the user’s session information (and whether it needs to write out changes when the request is complete). If the EnableSessionState attribute is true (which it is by default), the module retrieves all of the user’s session information and sets the Session property of the Page class to an instance of the HttpSessionState class. This article focuses on the cookie mechanism, although a cookie-less method of sessions is implemented in ASP.NET (the session id is embedded in the URL string). The Session information can be stored in-process (default, stores in web server memory), with a state service, or a SQL Server database. This article will focus on the in-process storage, but the technique applies to all three locations. &lt;/span&gt;&lt;br /&gt;&lt;h3&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;Example User Session &lt;/span&gt;&lt;/h3&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;A user opens a browser instance and requests an ASP.NET page from a site. If the EnableSessionState attribute is true, the session module adds the ASP.NET_SessionId cookie to the response. On subsequent requests to the same web site, the browser supplies the ASP.NET_SessionId cookie which the server side module uses to access the proper user’s information.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;The ASP.NET HttpSessionState class provides a useful IsNewSession( ) method that returns true if a new session was created for this request.&amp;nbsp; The key to detecting a session timeout is to also look for the ASP.NET_SessionId cookie in the request.&amp;nbsp; If this is a new session but the cookie is present, this indicates a timeout situation.&amp;nbsp; In order to implement this effectively for an entire web site, it is useful to utilize the “Base Page” concept described in a &lt;a href="http://aspalliance.com/63"&gt;previous article&lt;/a&gt;.&lt;/span&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;basePageSessionExpire.cs&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="background-color: transparent; color: black; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;&amp;nbsp;&lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;public&lt;/span&gt; &lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;class&lt;/span&gt; basePageSessionExpire : System.Web.UI.Page&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;public&lt;/span&gt; basePageSessionExpire()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;override&lt;/span&gt; &lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;protected&lt;/span&gt; &lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;void&lt;/span&gt; OnInit(EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;base&lt;/span&gt;.OnInit(e);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;//It appears from testing&amp;nbsp;that the Request and Response both share the&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// same cookie collection.&amp;nbsp; If I set a cookie myself in the Reponse, it is&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// also immediately visible to the Request collection.&amp;nbsp; This just means that&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// since the ASP.Net_SessionID is set in the Session HTTPModule (which&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// has already run), thatwe can't use our own code to see if the cookie was&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// actually sent by the agent with the request using the collection. Check if&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// the given page supports session or not (this tested as reliable indicator&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// if EnableSessionState is true),&amp;nbsp;should not care about a page that does&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// not need session&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;if&lt;/span&gt; (Context.Session !&lt;span style="background-color: transparent; color: red; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;=&lt;/span&gt; &lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;null&lt;/span&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;//Tested and the IsNewSession is more advanced then simply checking if&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// a cookie is present, it does&amp;nbsp;take into account a session timeout, because&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// I tested a timeout and it did show as a new session&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;if&lt;/span&gt; (Session.IsNewSession)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// If it says it is a new session, but an existing cookie exists, then it must&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// have timed out (can't use&amp;nbsp;the cookie collection because even on first&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// request it already contains the cookie (request and response&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: green; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;// seem to share the collection)&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;string&lt;/span&gt; szCookieHeader &lt;span style="background-color: transparent; color: red; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;=&lt;/span&gt; Request.Headers[&lt;span style="background-color: #e4e4e4; color: #666666; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;"Cookie"&lt;/span&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;if&lt;/span&gt; ((&lt;span style="background-color: transparent; color: blue; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;null&lt;/span&gt; !&lt;span style="background-color: transparent; color: red; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;=&lt;/span&gt; szCookieHeader) &amp;amp;&amp;amp; (szCookieHeader.IndexOf(&lt;span style="background-color: #e4e4e4; color: #666666; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;"ASP.NET_SessionId"&lt;/span&gt;) &amp;gt;= 0))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Redirect(&lt;span style="background-color: #e4e4e4; color: #666666; font-family: Courier New; font-size: 11px; font-weight: normal;"&gt;"sessionTimeout.htm"&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;em&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;sessionTimeout.htm&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;This can be any page on the site, example just redirects to this page so just show a simple "A timeout has occurred" message for this article.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;Each other page on the site just needs to derive from this new base page instead of the default System.Web.UI.Page, so just change the line in the code behind class from ": System.Web.UI.Page" to ": basePageSessionExpire".&amp;nbsp; Each page should also set the EnableSessionState variable as appropriate:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;false - page request does not access any session information (the base page uses this to know&amp;nbsp;that it does not need to check for timeout on this request since it does not require session information)&amp;nbsp;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;ReadOnly - page request uses session information but does not modify it &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;true - page request reads and updates session information&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;Conclusion&lt;/span&gt;&lt;/h3&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;It is often useful to know for a given request whether the user’s session information is still present.&amp;nbsp; The technique demonstrated is a straightforward implementation that can be easily applied to an entire web site that uses cookie based ASP.NET Session objects.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="KonaBody"&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;div style="text-align: right;"&gt;      by &lt;b&gt;&lt;span class="author" id="author"&gt;Robert Boedigheimer&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-6829471953649496711?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/6829471953649496711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=6829471953649496711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6829471953649496711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6829471953649496711'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/09/how-aspnet-sessions-are-implemented.html' title='How ASP.NET Sessions Are Implemented'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-6758503521127625745</id><published>2008-08-25T21:14:00.000-07:00</published><updated>2008-08-25T21:29:40.239-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DOM Javascript HTML trick'/><title type='text'>About Html encoding, remind character entity references</title><content type='html'>Here is indexes table for remind ASCII and Latin character entity references&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;ASCII Characters&lt;/h3&gt;This table shows the hex code, decimal code and entity name (if known) for the printable ASCII character set, omitting the letters and numbers.&lt;br /&gt;&lt;pre&gt;Description               Hex Code    Code (Dec.)    Entity&lt;br /&gt;=======================   ========    ===========    ==============&lt;br /&gt;space                       %20         &amp;amp;#32;  -&amp;gt;  &lt;br /&gt;!                           %21         &amp;amp;#33;  -&amp;gt; !&lt;br /&gt;"                           %22         &amp;amp;#34;  -&amp;gt; "    " -&amp;gt; "&lt;br /&gt;#                           %23         &amp;amp;#35;  -&amp;gt; #&lt;br /&gt;$                           %24         &amp;amp;#36;  -&amp;gt; $&lt;br /&gt;%                           %25         &amp;amp;#37;  -&amp;gt; %&lt;br /&gt;&amp;amp;                           %26         &amp;amp;#38;  -&amp;gt; &amp;amp;    &amp;amp; -&amp;gt; &amp;amp;&lt;br /&gt;'                           %27         &amp;amp;#39;  -&amp;gt; '&lt;br /&gt;(                           %28         &amp;amp;#40;  -&amp;gt; (&lt;br /&gt;)                           %29         &amp;amp;#41;  -&amp;gt; )&lt;br /&gt;*                           %2A         &amp;amp;#42;  -&amp;gt; *&lt;br /&gt;+                           %2B         &amp;amp;#43;  -&amp;gt; +&lt;br /&gt;,                           %2C         &amp;amp;#44;  -&amp;gt; ,&lt;br /&gt;-                           %2D         &amp;amp;#45;  -&amp;gt; -&lt;br /&gt;.                           %2E         &amp;amp;#46;  -&amp;gt; .&lt;br /&gt;/                           %29         &amp;amp;#47;  -&amp;gt; /&lt;br /&gt;&amp;nbsp;&lt;br /&gt;:                           %3A         &amp;amp;#58;  -&amp;gt; :&lt;br /&gt;;                           %3B         &amp;amp;#59;  -&amp;gt; ;&lt;br /&gt;&amp;lt;                           %3C         &amp;amp;#60;  -&amp;gt; &amp;lt;    &amp;lt; -&amp;gt; &amp;lt;&lt;br /&gt;=                           %3D         &amp;amp;#61;  -&amp;gt; =&lt;br /&gt;&amp;gt;                           %3E         &amp;amp;#62;  -&amp;gt; &amp;gt;    &amp;gt; -&amp;gt; &amp;gt;&lt;br /&gt;?                           %40         &amp;amp;#63;  -&amp;gt; ?&lt;br /&gt;@                           %41         &amp;amp;#64;  -&amp;gt; @&lt;br /&gt;&amp;nbsp;&lt;br /&gt;^                           %5E         &amp;amp;#94;  -&amp;gt; ^&lt;br /&gt;_                           %60         &amp;amp;#95;  -&amp;gt; _&lt;br /&gt;`                           %61         &amp;amp;#96;  -&amp;gt; `&lt;br /&gt;&amp;nbsp;&lt;br /&gt;{                           %7B         &amp;amp;#123;  -&amp;gt; {&lt;br /&gt;|                           %7C         &amp;amp;#124;  -&amp;gt; |&lt;br /&gt;}                           %7D         &amp;amp;#125;  -&amp;gt; }&lt;br /&gt;~                           %7E         &amp;amp;#126;  -&amp;gt; ~&lt;br /&gt;&amp;nbsp;&lt;/pre&gt;&lt;h3&gt;&lt;a href="" name="ISOLatin1Chars"&gt;&lt;/a&gt;ISO Latin 1Characters&lt;/h3&gt;This shows the ISO Latin 1 (also known as ISO 8859-1) character set, excluding ASCII characters. Not all browsers will display all these characters correctly, and browsers seem to handle even fewer named entities than numeric codes. The list may not be complete.&lt;br /&gt;For more information on special characters, one source is &lt;a href="http://www.cs.tu-berlin.de/%7Eczyborra/charsets/"&gt;this site&lt;/a&gt; in Germany.&lt;br /&gt;&lt;pre&gt;Description                           Code           Entity&lt;br /&gt;===================================   ===========    ==============&lt;br /&gt;non-breaking space                    &amp;amp;#160; -&amp;gt; &amp;nbsp;    &amp;amp;nbsp; -&amp;gt; &amp;nbsp;&lt;br /&gt;inverted exclamation mark             &amp;amp;#161; -&amp;gt; ¡    &amp;amp;iexcl; -&amp;gt; ¡&lt;br /&gt;cent sign                             &amp;amp;#162; -&amp;gt; ¢    &amp;amp;cent; -&amp;gt; ¢&lt;br /&gt;pound sign                            &amp;amp;#163; -&amp;gt; £    &amp;amp;pound; -&amp;gt; £&lt;br /&gt;currency sign                         &amp;amp;#164; -&amp;gt; ¤    &amp;amp;curren; -&amp;gt; ¤&lt;br /&gt;yen sign                              &amp;amp;#165; -&amp;gt; ¥    &amp;amp;yen; -&amp;gt; ¥&lt;br /&gt;broken vertical bar                   &amp;amp;#166; -&amp;gt; ¦    &amp;amp;brvbar; -&amp;gt; ¦&lt;br /&gt;section sign                          &amp;amp;#167; -&amp;gt; §    &amp;amp;sect; -&amp;gt; §&lt;br /&gt;spacing diaresis                      &amp;amp;#168; -&amp;gt; ¨    &amp;amp;uml; -&amp;gt; ¨&lt;br /&gt;copyright sign                        &amp;amp;#169; -&amp;gt; ©    &amp;amp;copy; -&amp;gt; ©&lt;br /&gt;feminine ordinal indicator            &amp;amp;#170; -&amp;gt; ª    &amp;amp;ordf; -&amp;gt; ª&lt;br /&gt;angle quotation mark, left            &amp;amp;#171; -&amp;gt; «    &amp;amp;laquo; -&amp;gt; «&lt;br /&gt;negation sign                         &amp;amp;#172; -&amp;gt; ¬    &amp;amp;not; -&amp;gt; ¬&lt;br /&gt;soft hyphen                           &amp;amp;#173; -&amp;gt; &amp;amp;endash;    &amp;amp;shy; -&amp;gt; &amp;amp;endash;&lt;br /&gt;circled R registered sign             &amp;amp;#174; -&amp;gt; ®    &amp;amp;reg; -&amp;gt; ®&lt;br /&gt;spacing macron                        &amp;amp;#175; -&amp;gt; ¯    &amp;amp;hibar; -&amp;gt; &amp;amp;hibar;&lt;br /&gt;degree sign                           &amp;amp;#176; -&amp;gt; °    &amp;amp;deg; -&amp;gt; °&lt;br /&gt;plus-or-minus sign                    &amp;amp;#177; -&amp;gt; ±    &amp;amp;plusmn; -&amp;gt; ±&lt;br /&gt;superscript 2                         &amp;amp;#178; -&amp;gt; ²    &amp;amp;sup2; -&amp;gt; ²&lt;br /&gt;superscript 3                         &amp;amp;#179; -&amp;gt; ³    &amp;amp;sup3; -&amp;gt; ³&lt;br /&gt;spacing acute                         &amp;amp;#180; -&amp;gt; ´    &amp;amp;acute; -&amp;gt; ´&lt;br /&gt;micro sign                            &amp;amp;#181; -&amp;gt; µ    &amp;amp;micro; -&amp;gt; µ&lt;br /&gt;paragraph sign                        &amp;amp;#182; -&amp;gt; ¶    &amp;amp;para; -&amp;gt; ¶&lt;br /&gt;middle dot                            &amp;amp;#183; -&amp;gt; ·    &amp;amp;middot; -&amp;gt; ·&lt;br /&gt;spacing cedilla                       &amp;amp;#184; -&amp;gt; ¸    &amp;amp;cedil; -&amp;gt; ¸&lt;br /&gt;superscript 1                         &amp;amp;#185; -&amp;gt; ¹    &amp;amp;sup1; -&amp;gt; ¹&lt;br /&gt;masculine ordinal indicator           &amp;amp;#186; -&amp;gt; º    &amp;amp;ordm; -&amp;gt; º&lt;br /&gt;angle quotation mark, right           &amp;amp;#187; -&amp;gt; »    &amp;amp;raquo; -&amp;gt; »&lt;br /&gt;fraction 1/4                          &amp;amp;#188; -&amp;gt; ¼    &amp;amp;frac14; -&amp;gt; ¼&lt;br /&gt;fraction 1/2                          &amp;amp;#189; -&amp;gt; ½    &amp;amp;frac12; -&amp;gt; ½&lt;br /&gt;fraction 3/4                          &amp;amp;#190; -&amp;gt; ¾    &amp;amp;frac34; -&amp;gt; ¾&lt;br /&gt;inverted question mark                &amp;amp;#191; -&amp;gt; ¿    &amp;amp;iquest; -&amp;gt; ¿&lt;br /&gt;capital A, grave accent               &amp;amp;#192; -&amp;gt; À    &amp;amp;Agrave; -&amp;gt; À&lt;br /&gt;capital A, acute accent               &amp;amp;#193; -&amp;gt; Á    &amp;amp;Aacute; -&amp;gt; Á&lt;br /&gt;capital A, circumflex accent          &amp;amp;#194; -&amp;gt; Â    &amp;amp;Acirc; -&amp;gt; Â&lt;br /&gt;capital A, tilde                      &amp;amp;#195; -&amp;gt; Ã    &amp;amp;Atilde; -&amp;gt; Ã&lt;br /&gt;capital A, dieresis or umlaut mark    &amp;amp;#196; -&amp;gt; Ä    &amp;amp;Auml; -&amp;gt; Ä&lt;br /&gt;capital A, ring                       &amp;amp;#197; -&amp;gt; Å    &amp;amp;Aring; -&amp;gt; Å&lt;br /&gt;capital AE diphthong (ligature)       &amp;amp;#198; -&amp;gt; Æ    &amp;amp;AElig; -&amp;gt; Æ&lt;br /&gt;capital C, cedilla                    &amp;amp;#199; -&amp;gt; Ç    &amp;amp;Ccedil; -&amp;gt; Ç&lt;br /&gt;capital E, grave accent               &amp;amp;#200; -&amp;gt; È    &amp;amp;Egrave; -&amp;gt; È&lt;br /&gt;capital E, acute accent               &amp;amp;#201; -&amp;gt; É    &amp;amp;Eacute; -&amp;gt; É&lt;br /&gt;capital E, circumflex accent          &amp;amp;#202; -&amp;gt; Ê    &amp;amp;Ecirc; -&amp;gt; Ê&lt;br /&gt;capital E, dieresis or umlaut mark    &amp;amp;#203; -&amp;gt; Ë    &amp;amp;Euml; -&amp;gt; Ë&lt;br /&gt;capital I, grave accent               &amp;amp;#204; -&amp;gt; Ì    &amp;amp;Igrave; -&amp;gt; Ì&lt;br /&gt;capital I, acute accent               &amp;amp;#205; -&amp;gt; Í    &amp;amp;Iacute; -&amp;gt; Í&lt;br /&gt;capital I, circumflex accent          &amp;amp;#206; -&amp;gt; Î    &amp;amp;Icirc; -&amp;gt; Î&lt;br /&gt;capital I, dieresis or umlaut mark    &amp;amp;#207; -&amp;gt; Ï    &amp;amp;Iuml; -&amp;gt; Ï&lt;br /&gt;capital Eth, Icelandic                &amp;amp;#208; -&amp;gt; Ð    &amp;amp;ETH; -&amp;gt; Ð&lt;br /&gt;capital N, tilde                      &amp;amp;#209; -&amp;gt; Ñ    &amp;amp;Ntilde; -&amp;gt; Ñ&lt;br /&gt;capital O, grave accent               &amp;amp;#210; -&amp;gt; Ò    &amp;amp;Ograve; -&amp;gt; Ò&lt;br /&gt;capital O, acute accent               &amp;amp;#211; -&amp;gt; Ó    &amp;amp;Oacute; -&amp;gt; Ó&lt;br /&gt;capital O, circumflex accent          &amp;amp;#212; -&amp;gt; Ô    &amp;amp;Ocirc; -&amp;gt; Ô&lt;br /&gt;capital O, tilde                      &amp;amp;#213; -&amp;gt; Õ    &amp;amp;Otilde; -&amp;gt; Õ&lt;br /&gt;capital O, dieresis or umlaut mark    &amp;amp;#214; -&amp;gt; Ö    &amp;amp;Ouml; -&amp;gt; Ö&lt;br /&gt;multiplication sign                   &amp;amp;#215; -&amp;gt; ×    &amp;amp;times; -&amp;gt; ×&lt;br /&gt;capital O, slash                      &amp;amp;#216; -&amp;gt; Ø    &amp;amp;Oslash; -&amp;gt; Ø&lt;br /&gt;capital U, grave accent               &amp;amp;#217; -&amp;gt; Ù    &amp;amp;Ugrave; -&amp;gt; Ù&lt;br /&gt;capital U, acute accent               &amp;amp;#218; -&amp;gt; Ú    &amp;amp;amp;Uacute; -&amp;gt; Ú&lt;br /&gt;capital U, circumflex accent          &amp;amp;#219; -&amp;gt; Û    &amp;amp;Ucirc; -&amp;gt; Û&lt;br /&gt;capital U, dieresis or umlaut mark    &amp;amp;#220; -&amp;gt; Ü    &amp;amp;Uuml; -&amp;gt; Ü&lt;br /&gt;capital Y, acute accent               &amp;amp;#221; -&amp;gt; Ý    &amp;amp;Yacute; -&amp;gt; Ý&lt;br /&gt;capital THORN, Icelandic              &amp;amp;#222; -&amp;gt; Þ    &amp;amp;THORN; -&amp;gt; Þ&lt;br /&gt;small sharp s, German (sz ligature)   &amp;amp;#223; -&amp;gt; ß    &amp;amp;szlig; -&amp;gt; ß&lt;br /&gt;small a, grave accent                 &amp;amp;#224; -&amp;gt; à    &amp;amp;agrave; -&amp;gt; à&lt;br /&gt;small a, acute accent                 &amp;amp;#225; -&amp;gt; á    &amp;amp;aacute; -&amp;gt; á&lt;br /&gt;small a, circumflex accent            &amp;amp;#226; -&amp;gt; â    &amp;amp;acirc; -&amp;gt; â&lt;br /&gt;small a, tilde                        &amp;amp;#227; -&amp;gt; ã    &amp;amp;atilde; -&amp;gt; ã&lt;br /&gt;small a, dieresis or umlaut mark      &amp;amp;#228; -&amp;gt; ä    &amp;amp;auml; -&amp;gt; ä&lt;br /&gt;small a, ring                         &amp;amp;#229; -&amp;gt; å    &amp;amp;aring; -&amp;gt; å&lt;br /&gt;small ae diphthong (ligature)         &amp;amp;#230; -&amp;gt; æ    &amp;amp;aelig; -&amp;gt; æ&lt;br /&gt;small c, cedilla                      &amp;amp;#231; -&amp;gt; ç    &amp;amp;ccedil; -&amp;gt; ç&lt;br /&gt;small e, grave accent                 &amp;amp;#232; -&amp;gt; è    &amp;amp;egrave; -&amp;gt; è&lt;br /&gt;small e, acute accent                 &amp;amp;#233; -&amp;gt; é    &amp;amp;eacute; -&amp;gt; é&lt;br /&gt;small e, circumflex accent            &amp;amp;#234; -&amp;gt; ê    &amp;amp;ecirc; -&amp;gt; ê&lt;br /&gt;small e, dieresis or umlaut mark      &amp;amp;#235; -&amp;gt; ë    &amp;amp;euml; -&amp;gt; ë&lt;br /&gt;small i, grave accent                 &amp;amp;#236; -&amp;gt; ì    &amp;amp;igrave; -&amp;gt; ì&lt;br /&gt;small i, acute accent                 &amp;amp;#237; -&amp;gt; í    &amp;amp;iacute; -&amp;gt; í&lt;br /&gt;small i, circumflex accent            &amp;amp;#238; -&amp;gt; î    &amp;amp;icirc; -&amp;gt; î&lt;br /&gt;small i, dieresis or umlaut mark      &amp;amp;#239; -&amp;gt; ï    &amp;amp;iuml; -&amp;gt; ï&lt;br /&gt;small eth, Icelandic                  &amp;amp;#240; -&amp;gt; ð    &amp;amp;eth; -&amp;gt; ð&lt;br /&gt;small n, tilde                        &amp;amp;#241; -&amp;gt; ñ    &amp;amp;ntilde; -&amp;gt; ñ&lt;br /&gt;small o, grave accent                 &amp;amp;#242; -&amp;gt; ò    &amp;amp;ograve; -&amp;gt; ò&lt;br /&gt;small o, acute accent                 &amp;amp;#243; -&amp;gt; ó    &amp;amp;oacute; -&amp;gt; ó&lt;br /&gt;small o, circumflex accent            &amp;amp;#244; -&amp;gt; ô    &amp;amp;ocirc; -&amp;gt; ô&lt;br /&gt;small o, tilde                        &amp;amp;#245; -&amp;gt; õ    &amp;amp;otilde; -&amp;gt; õ&lt;br /&gt;small o, dieresis or umlaut mark      &amp;amp;#246; -&amp;gt; ö    &amp;amp;ouml; -&amp;gt; ö&lt;br /&gt;division sign                         &amp;amp;#247; -&amp;gt; ÷    &amp;amp;divide; -&amp;gt; ÷&lt;br /&gt;small o, slash                        &amp;amp;#248; -&amp;gt; ø    &amp;amp;oslash; -&amp;gt; ø&lt;br /&gt;small u, grave accent                 &amp;amp;#249; -&amp;gt; ù    &amp;amp;ugrave; -&amp;gt; ù&lt;br /&gt;small u, acute accent                 &amp;amp;#250; -&amp;gt; ú    &amp;amp;uacute; -&amp;gt; ú&lt;br /&gt;small u, circumflex accent            &amp;amp;#251; -&amp;gt; û    &amp;amp;ucirc; -&amp;gt; û&lt;br /&gt;small u, dieresis or umlaut mark      &amp;amp;#252; -&amp;gt; ü    &amp;amp;uuml; -&amp;gt; ü&lt;br /&gt;small y, acute accent                 &amp;amp;#253; -&amp;gt; ý    &amp;amp;yacute; -&amp;gt; ý&lt;br /&gt;small thorn, Icelandic                &amp;amp;#254; -&amp;gt; þ    &amp;amp;thorn; -&amp;gt; þ&lt;br /&gt;small y, dieresis or umlaut mark      &amp;amp;#255; -&amp;gt; ÿ    &amp;amp;yuml; -&amp;gt; ÿ&lt;/pre&gt;&lt;br /&gt;more information at &lt;br /&gt;&lt;a href="http://www.w3.org/TR/html4/charset.html"&gt;http://www.w3.org/TR/html4/charset.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.astro.washington.edu/owen/ROFM_CGI/Documentation/SpecialChars.html"&gt;http://www.astro.washington.edu/owen/ROFM_CGI/Documentation/SpecialChars.html &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-6758503521127625745?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/6758503521127625745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=6758503521127625745' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6758503521127625745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6758503521127625745'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/08/about-html-encoding-remind-character.html' title='About Html encoding, remind character entity references'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-8300216309813144434</id><published>2008-08-05T20:21:00.000-07:00</published><updated>2008-08-06T00:00:03.945-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DOM Javascript HTML trick'/><title type='text'>Javascript get mouse position ( compatible IE and Firefox )</title><content type='html'>following javascript help we get position of mouse event ( compatible IE and Firefox )&lt;br /&gt;&lt;blockquote&gt;var posx = 0;&lt;br /&gt;var posy = 0;&lt;br /&gt;if (!e)&lt;br /&gt;e = window.event;&lt;br /&gt;if (e.pageX || e.pageY){&lt;br /&gt;posx = e.pageX;&lt;br /&gt;posy = e.pageY;&lt;br /&gt;}&lt;br /&gt;else if (e.clientX || e.clientY){&lt;br /&gt;posx = e.clientX + document.body.scrollLeft&lt;br /&gt;+ document.documentElement.scrollLeft;&lt;br /&gt;posy = e.clientY + document.body.scrollTop&lt;br /&gt;+ document.documentElement.scrollTop;&lt;br /&gt;}&lt;/blockquote&gt;* One note is window.event can not be access direct inside function on FireFox. Solution is pass "event" as parameter when invoke the event. For example :&lt;br /&gt;    &lt;br /&gt;&amp;lt;div id="xx" onmouseover="DoSomthing(event);"&amp;gt;...&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;within IE, it's ok if we does not provide any parameter as handled in above snippet:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;if (!e)&lt;br /&gt;e = window.event;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-8300216309813144434?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/8300216309813144434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=8300216309813144434' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/8300216309813144434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/8300216309813144434'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/08/following-javascript-help-we-get.html' title='Javascript get mouse position ( compatible IE and Firefox )'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-1822346219178284358</id><published>2008-07-29T01:48:00.000-07:00</published><updated>2008-07-29T01:56:36.694-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><title type='text'>Microsoft standard Numeric Format Strings</title><content type='html'>An useful collected .Net articles about "Microsoft standard numeric format strings".&lt;br /&gt;&lt;div style="text-align: right;"&gt;&lt;a href="http://msdn.microsoft.com/"&gt;MSDN&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;Example:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Dim a as Decimal = 123456789,789&lt;/p&gt;&lt;p&gt;txt.Text = a.ToString("N0")&lt;/p&gt;&lt;p&gt;result : 123.456.790&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Standard numeric format strings are used to format common numeric types. A standard format string takes the form &lt;i&gt;Axx&lt;/i&gt; where &lt;i&gt;A&lt;/i&gt; is a single alphabetic character called the format specifier, and &lt;i&gt;xx&lt;/i&gt; is an optional integer called the precision specifier. The format specifier must be one of the built-in format characters. The precision specifier ranges from 0 to 99 and controls the number of significant digits or zeros to the right of a decimal. The format string cannot contain white spaces.&lt;/p&gt; &lt;p&gt;If the format string does not contain one of the standard format specifiers, then a &lt;a id="ctl00_rs1_mainContentContainer_ctl01" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl01',this);" href="http://msdn.microsoft.com/en-us/library/system.formatexception%28VS.71%29.aspx"&gt;FormatException&lt;/a&gt; is thrown. For example, the format string "z" is interpreted as a standard numeric format string because it contains one alphabetic character, but the alphabetic character is not one of the standard numeric format specifiers so a &lt;b&gt;FormatException&lt;/b&gt; is thrown. Any numeric format string that does not fit the definition of a standard numeric format string is interpreted as a &lt;a id="ctl00_rs1_mainContentContainer_ctl02" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl02',this);" href="http://msdn.microsoft.com/en-us/library/0c899ak8%28VS.71%29.aspx"&gt;custom numeric format string&lt;/a&gt;. The format string "c!" is interpreted as a custom format string because it contains two alphabetic characters, even though the character "c" is a standard numeric format specifier.&lt;/p&gt; &lt;p&gt;The following table describes the standard numeric format strings. Note that the result string produced by these format specifiers is influenced by the settings in the Regional Options control panel. Computers using different settings will generate different result strings.&lt;/p&gt; &lt;div class="tablediv"&gt;&lt;table class="dtTABLE"&gt; &lt;tbody&gt;&lt;tr valign="top"&gt; &lt;th width="12%"&gt;Format specifier&lt;/th&gt; &lt;th width="16%"&gt;Name&lt;/th&gt; &lt;th width="72%"&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td width="12%"&gt;C or c&lt;/td&gt; &lt;td width="16%"&gt;Currency&lt;/td&gt; &lt;td width="72%"&gt;The number is converted to a string that represents a currency amount. The conversion is controlled by the currency format information of the &lt;a id="ctl00_rs1_mainContentContainer_ctl03" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl03',this);" href="http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo%28VS.71%29.aspx"&gt;NumberFormatInfo&lt;/a&gt; object used to format the number. The precision specifier indicates the desired number of decimal places. If the precision specifier is omitted, the default currency precision given by the &lt;b&gt;NumberFormatInfo&lt;/b&gt; is used.&lt;/td&gt; &lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td width="12%"&gt;D or d&lt;/td&gt; &lt;td width="16%"&gt;Decimal&lt;/td&gt; &lt;td width="72%"&gt;This format is supported for integral types only. The number is converted to a string of decimal digits (0-9), prefixed by a minus sign if the number is negative. The precision specifier indicates the minimum number of digits desired in the resulting string. If required, the number is padded with zeros to its left to produce the number of digits given by the precision specifier.&lt;/td&gt; &lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td width="12%"&gt;E or e&lt;/td&gt; &lt;td width="16%"&gt;Scientific (exponential)&lt;/td&gt; &lt;td width="72%"&gt;The number is converted to a string of the form "-d.ddd...E+ddd" or "-d.ddd...e+ddd", where each 'd' indicates a digit (0-9). The string starts with a minus sign if the number is negative. One digit always precedes the decimal point. The precision specifier indicates the desired number of digits after the decimal point. If the precision specifier is omitted, a default of six digits after the decimal point is used. The case of the format specifier indicates whether to prefix the exponent with an 'E' or an 'e'. The exponent always consists of a plus or minus sign and a minimum of three digits. The exponent is padded with zeros to meet this minimum, if required.&lt;/td&gt; &lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td width="12%"&gt;F or f&lt;/td&gt; &lt;td width="16%"&gt;Fixed-point&lt;/td&gt; &lt;td width="72%"&gt;The number is converted to a string of the form "-ddd.ddd..." where each 'd' indicates a digit (0-9). The string starts with a minus sign if the number is negative. The precision specifier indicates the desired number of decimal places. If the precision specifier is omitted, the default numeric precision given by the &lt;b&gt;NumberFormatInfo&lt;/b&gt; is used.&lt;/td&gt; &lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td width="12%"&gt;G or g&lt;/td&gt; &lt;td width="16%"&gt;General&lt;/td&gt; &lt;td width="72%"&gt;The number is converted to the most compact of either fixed-point or scientific notation, depending on the type of the number and whether a precision specifier is present. If the precision specifier is omitted or zero, the type of the number determines the default precision, as indicated by the following list. &lt;ul type="disc"&gt;&lt;li&gt;&lt;b&gt;Byte&lt;/b&gt; or &lt;b&gt;SByte&lt;/b&gt;: 3&lt;/li&gt;&lt;li&gt;&lt;b&gt;Int16&lt;/b&gt; or &lt;b&gt;UInt16&lt;/b&gt;: 5&lt;/li&gt;&lt;li&gt;&lt;b&gt;Int32&lt;/b&gt; or &lt;b&gt;UInt32&lt;/b&gt;: 10&lt;/li&gt;&lt;li&gt;&lt;b&gt;Int64&lt;/b&gt; or &lt;b&gt;UInt64&lt;/b&gt;: 19&lt;/li&gt;&lt;li&gt;&lt;b&gt;Single&lt;/b&gt;: 7&lt;/li&gt;&lt;li&gt;&lt;b&gt;Double&lt;/b&gt;: 15&lt;/li&gt;&lt;li&gt;&lt;b&gt;Decimal&lt;/b&gt;: 29&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Fixed-point notation is used if the exponent that would result from expressing the number in scientific notation is greater than -5 and less than the precision specifier; otherwise, scientific notation is used. The result contains a decimal point if required and trailing zeroes are omitted. If the precision specifier is present and the number of significant digits in the result exceeds the specified precision, then the excess trailing digits are removed by rounding. If scientific notation is used, the exponent in the result is prefixed with 'E' if the format specifier is 'G', or 'e' if the format specifier is 'g'. &lt;/p&gt; &lt;p&gt;The exception to the preceding rule is if the number is a &lt;b&gt;Decimal&lt;/b&gt; and the precision specifier is omitted. In that case, fixed-point notation is always used and trailing zeroes are preserved. &lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td width="12%"&gt;N or n&lt;/td&gt; &lt;td width="16%"&gt;Number&lt;/td&gt; &lt;td width="72%"&gt;The number is converted to a string of the form "-d,ddd,ddd.ddd...", where each 'd' indicates a digit (0-9). The string starts with a minus sign if the number is negative. Thousand separators are inserted between each group of three digits to the left of the decimal point. The precision specifier indicates the desired number of decimal places. If the precision specifier is omitted, the default numeric precision given by the &lt;b&gt;NumberFormatInfo&lt;/b&gt; is used.&lt;/td&gt; &lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td width="12%"&gt;P or p&lt;/td&gt; &lt;td width="16%"&gt;Percent&lt;/td&gt; &lt;td width="72%"&gt;The number is converted to a string that represents a percent as defined by the &lt;a id="ctl00_rs1_mainContentContainer_ctl04" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl04',this);" href="http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.percentnegativepattern%28VS.71%29.aspx"&gt;NumberFormatInfo.PercentNegativePattern&lt;/a&gt; property or the &lt;a id="ctl00_rs1_mainContentContainer_ctl05" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl05',this);" href="http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.percentpositivepattern%28VS.71%29.aspx"&gt;NumberFormatInfo.PercentPositivePattern&lt;/a&gt; property. If the number is negative, the string produced is defined by the &lt;b&gt;PercentNegativePattern&lt;/b&gt; and starts with a minus sign. The converted number is multiplied by 100 in order to be presented as a percentage. The precision specifier indicates the desired number of decimal places. If the precision specifier is omitted, the default numeric precision given by &lt;b&gt;NumberFormatInfo&lt;/b&gt; is used.&lt;/td&gt; &lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td width="12%"&gt;R or r&lt;/td&gt; &lt;td width="16%"&gt;Round-trip&lt;/td&gt; &lt;td width="72%"&gt;The round-trip specifier guarantees that a numeric value converted to a string will be parsed back into the same numeric value. When a numeric value is formatted using this specifier, it is first tested using the general format, with 15 spaces of precision for a &lt;b&gt;Double&lt;/b&gt; and 7 spaces of precision for a &lt;b&gt;Single&lt;/b&gt;. If the value is successfully parsed back to the same numeric value, it is formatted using the general format specifier. However, if the value is not successfully parsed back to the same numeric value, then the value is formatted using 17 digits of precision for a &lt;b&gt;Double&lt;/b&gt; and 9 digits of precision for a &lt;b&gt;Single&lt;/b&gt;. Although a precision specifier can be appended to the round-trip format specifier, it is ignored. Round trips are given precedence over precision when using this specifier. This format is supported by floating-point types only.&lt;/td&gt; &lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td width="12%"&gt;X or x&lt;/td&gt; &lt;td width="16%"&gt;Hexadecimal&lt;/td&gt; &lt;td width="72%"&gt;The number is converted to a string of hexadecimal digits. The case of the format specifier indicates whether to use uppercase or lowercase characters for the hexadecimal digits greater than 9. For example, use 'X' to produce "ABCDEF", and 'x' to produce "abcdef". The precision specifier indicates the minimum number of digits desired in the resulting string. If required, the number is padded with zeros to its left to produce the number of digits given by the precision specifier. This format is supported for integral types only.&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-1822346219178284358?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/1822346219178284358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=1822346219178284358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1822346219178284358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1822346219178284358'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/07/microsoft-standard-numeric-format.html' title='Microsoft standard Numeric Format Strings'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-128382906647817847</id><published>2008-07-20T20:00:00.000-07:00</published><updated>2008-09-07T18:48:02.343-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>About ASP.NET Session State</title><content type='html'>&lt;h2 class="dtH1"&gt;ASP.NET Session State&lt;/h2&gt;ASP.NET session state solves all of the above problems associated with classic ASP session state:&lt;br /&gt;&lt;ul type="disc"&gt;&lt;li&gt;&lt;b&gt;Process independent.&lt;/b&gt; ASP.NET session state is able to run in a separate process from the ASP.NET host process. If session state is in a separate process, the ASP.NET process can come and go while the session state process remains available. Of course, you can still use session state in process similar to classic ASP, too. &lt;/li&gt;&lt;li&gt;&lt;b&gt;Support for server farm configurations.&lt;/b&gt; By moving to an out-of-process model, ASP.NET also solves the server farm problem. The new out-of-process model allows all servers in the farm to share a session state process. You can implement this by changing the ASP.NET configuration to point to a common server.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Cookie independent.&lt;/b&gt; Although solutions to the problem of cookieless state management do exist for classic ASP, they're not trivial to implement. ASP.NET, on the other hand, reduces the complexities of cookieless session state to a simple configuration setting.&lt;/li&gt;&lt;/ul&gt;Let's look at each of these features in more detail, including how the settings are configured.&lt;br /&gt;&lt;h2 class="dtH1"&gt;Using ASP.NET Session State&lt;/h2&gt;Session state settings in ASP.NET are configured through the ASP.NET XML configuration file  &lt;b&gt;web.config&lt;/b&gt;. We'll look at  &lt;b&gt;web.config&lt;/b&gt; in more detail in a later column, but for this discussion of session state let's look at it briefly.&lt;br /&gt;&lt;h3 class="dtH1"&gt; &lt;b&gt;Web.config&lt;/b&gt;&lt;/h3&gt;There are two types of configuration files: a machine configuration file and an application configuration file, both named  &lt;b&gt;web.config&lt;/b&gt;. The two are identical, except that the machine configuration file applies settings to all applications but the application configuration files are either restrictive or expansive on an application-by-application basis.&lt;br /&gt;In Beta 1, the machine  &lt;b&gt;web.config&lt;/b&gt; file is in the &lt;b&gt;WinNT\Microsoft.NET\Framework\v1.0.2204&lt;/b&gt; directory, while the optional application configuration files exist in the application's directory. Application  &lt;b&gt;web.config&lt;/b&gt; files are optional in the sense that if an application &lt;b&gt;config.web&lt;/b&gt; file doesn't exist, the machine  &lt;b&gt;web.config&lt;/b&gt;&lt;b&gt; &lt;/b&gt;settings are used instead. ASP.NET session state settings can be made in the machine  &lt;b&gt;web.config&lt;/b&gt; file and overridden in a particular application's &lt;b&gt;web.config &lt;/b&gt;file.&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt; Changes made to &lt;b&gt;web.config &lt;/b&gt;are applied immediately, unlike classic ASP, where the server has to be stopped and started for settings to take affect.&lt;br /&gt;&lt;h3 class="dtH1"&gt;Session configuration&lt;/h3&gt;Below is a sample &lt;b&gt;web.config &lt;/b&gt;file used to configure the session state settings for an ASP.NET application:&lt;br /&gt;&lt;div class="" id="ctl00_rs1_mainContentContainer_ctl03_"&gt;&lt;div class="CodeSnippetTitleBar"&gt;&lt;div class="CopyCodeButton"&gt;&lt;a class="copyCode" href="javascript:CopyCode('ctl00_rs1_mainContentContainer_ctl03');"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class="libCScode" id="ctl00_rs1_mainContentContainer_ctl03" space="preserve"&gt;&amp;lt;configuration&amp;gt;  &amp;lt;sessionstate&amp;gt;      mode="inproc"      cookieless="false"&lt;br /&gt;timeout="20"       sqlconnectionstring="data source=127.0.0.1;user id=&amp;lt;user id=""&amp;gt;&lt;br /&gt;;password=&amp;lt;password&amp;gt;"      server="127.0.0.1"       port="42424"   /&amp;gt;&lt;br /&gt;&amp;lt;/password&amp;gt;&amp;lt;/user&amp;gt;&amp;lt;/sessionstate&amp;gt;&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;/div&gt;;The settings above are used to configure ASP.NET session state. Let's look at each in more detail and cover the various uses afterward.&lt;br /&gt;&lt;ul type="disc"&gt;&lt;li&gt;&lt;b&gt;Mode.&lt;/b&gt; The mode setting supports three options: inproc, sqlserver, and stateserver. As stated earlier, ASP.NET supports two modes: in process and out of process. There are also two options for out-of-process state management: memory based (stateserver), and SQL Server based (sqlserver). We'll discuss implementing these options shortly.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Cookieless.&lt;/b&gt; The cookieless option for ASP.NET is configured with this simple Boolean setting. &lt;/li&gt;&lt;li&gt;&lt;b&gt;Timeout.&lt;/b&gt; This option controls the length of time a session is considered valid. The session timeout is a sliding value; on each request the timeout period is set to the current time plus the timeout value &lt;/li&gt;&lt;li&gt;&lt;b&gt;Sqlconnectionstring.&lt;/b&gt; The sqlconnectionstring identifies the database connection string that names the database used for mode sqlserver.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Server.&lt;/b&gt; In the out-of-process mode stateserver, it names the server that is running the required Windows NT service: ASPState.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Port.&lt;/b&gt; The port setting, which accompanies the server setting, identifies the port number that corresponds to the server setting for mode stateserver.&lt;h2 class="dtH1"&gt;In-process Mode&lt;/h2&gt;In-process mode simply means using ASP.NET session state in a similar manner to classic ASP session state. That is, session state is managed in process and if the process is re-cycled, state is lost. Given the new settings that ASP.NET provides, you might wonder why you would ever use this mode. The reasoning is quite simple: performance. The performance of session state, e.g. the time it takes to read from and write to the session state dictionary, will be much faster when the memory read to and from is in process, as cross-process calls add overhead when data is marshaled back and forth or possibly read from SQL Server.&lt;br /&gt;In-process mode is the default setting for ASP.NET. When this setting is used, the only other session &lt;b&gt;web.config&lt;/b&gt; settings used are cookieless and timeout.&lt;br /&gt;&lt;h2 class="dtH1"&gt;Performance and Reliability Considerations&lt;/h2&gt;It's worth mentioning, briefly, some of the performance and reliability issues you should consider when using ASP.NET session state modes. &lt;/li&gt;&lt;li&gt;&lt;b&gt;In process.&lt;/b&gt; In process will perform best because the session state memory is kept within the ASP.NET process. For Web applications hosted on a single server, applications in which the user is guaranteed to be re-directed to the correct server, or when session state data is not critical (in the sense that it can be re-constructed or re-populated), this is the mode to choose.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Out of process.&lt;/b&gt; This mode is best used when performance is important but you can't guarantee which server a user will request an application from. With out-of-process mode, you get the performance of reading from memory and the reliability of a separate process that manages the state for all servers.&lt;/li&gt;&lt;li&gt;&lt;b&gt;SQL Server.&lt;/b&gt; This mode is best used when the reliability of the data is fundamental to the stability of the application, as the database can be clustered for failure scenarios. The performance isn't as fast as out of process, but the tradeoff is the higher level of reliability.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-128382906647817847?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/128382906647817847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=128382906647817847' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/128382906647817847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/128382906647817847'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/07/about-aspnet-session-state.html' title='About ASP.NET Session State'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-6022687522840829962</id><published>2008-07-17T07:00:00.000-07:00</published><updated>2008-07-17T07:00:02.872-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='Regular Expression'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Microsoft Custom Numeric Format Strings</title><content type='html'>&lt;div class="ContentArea"&gt;&lt;br /&gt;&lt;div style="text-align: right;"&gt; &lt;/div&gt;&lt;div class="topic"&gt;&lt;br /&gt;&lt;div style="text-align: right;"&gt; &lt;/div&gt;&lt;div class="majorTitle" style="text-align: right;"&gt;&lt;font size="1"&gt;&lt;b&gt;MSDN .NET&amp;nbsp;Framework&amp;nbsp;Developer's&amp;nbsp;Guide&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div class="title"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="" name="cpconcustomnumericformatstrings"&gt;&lt;/a&gt;&lt;br /&gt;&lt;div id="nstext" valign="bottom"&gt; If the standard numeric format specifiers do not provide the type of  formatting you require, you can use custom format strings to further enhance  string output. A standard format string consists of a single alphabetic  character optionally followed by a sequence of digits that form a value between  0 and 99; all other format strings are custom format strings.&lt;br /&gt;The following table shows the characters you can use to create custom numeric  format strings and their definitions. Note that the result strings produced by  some of these characters are influenced by the settings in the Regional Options  control panel of the &lt;a href="http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo%28VS.71%29.aspx" id="ctl00_rs1_mainContentContainer_ctl01" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl01',this);"&gt;NumberFormatInfo&lt;/a&gt;  object associated with the current thread. Computers using different cultures  will generate different result strings.&lt;br /&gt;&lt;div class="tablediv"&gt;&lt;br /&gt;&lt;table class="dtTABLE"&gt;  &lt;tbody&gt;&lt;tr valign="top"&gt;    &lt;th width="13%"&gt;Format character&lt;/th&gt;    &lt;th width="22%"&gt;Name&lt;/th&gt;    &lt;th width="65%"&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;    &lt;td width="13%"&gt;0&lt;/td&gt;    &lt;td width="22%"&gt;Zero placeholder&lt;/td&gt;    &lt;td width="65%"&gt;If the value being formatted has a digit in the position        where the '0' appears in the format string, then that digit is copied to        the result string. The position of the leftmost '0' before the decimal        point and the rightmost '0' after the decimal point determines the range        of digits that are always present in the result string. The "00" specifier        causes the value to be rounded to the nearest digit preceding the decimal,        where rounding away from zero is always used. For example, formatting 34.5        with "00" would result in the value 35.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;    &lt;td width="13%"&gt;#&lt;/td&gt;    &lt;td width="22%"&gt;Digit placeholder&lt;/td&gt;    &lt;td width="65%"&gt;If the value being formatted has a digit in the position        where the '#' appears in the format string, then that digit is copied to        the result string. Otherwise, nothing is stored in that position in the        result string. Note that this specifier never displays the '0' character        if it is not a significant digit, even if '0' is the only digit in the        string. It will display the '0' character if it is a significant digit in        the number being displayed. The "##" format string causes the value to be        rounded to the nearest digit preceding the decimal, where rounding away        from zero is always used. For example, formatting 34.5 with "##" would        result in the value 35.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;    &lt;td width="13%"&gt;.&lt;/td&gt;    &lt;td width="22%"&gt;Decimal point&lt;/td&gt;    &lt;td width="65%"&gt;The first '.' character in the format string determines        the location of the decimal separator in the formatted value; any        additional '.' characters are ignored. The actual character used as the        decimal separator is determined by the &lt;a href="http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.numberdecimalseparator%28VS.71%29.aspx" id="ctl00_rs1_mainContentContainer_ctl02" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl02',this);"&gt;NumberDecimalSeparator&lt;/a&gt;        property of the &lt;b&gt;NumberFormatInfo&lt;/b&gt; that controls formatting.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;    &lt;td width="13%"&gt;,&lt;/td&gt;    &lt;td width="22%"&gt;Thousand separator and number scaling&lt;/td&gt;    &lt;td width="65%"&gt;The ',' character serves two purposes. First, if the        format string contains a ',' character between two digit placeholders (0        or #) and to the left of the decimal point if one is present, then the        output will have thousand separators inserted between each group of three        digits to the left of the decimal separator. The actual character used as        the decimal separator in the result string is determined by the &lt;a href="http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.numbergroupseparator%28VS.71%29.aspx" id="ctl00_rs1_mainContentContainer_ctl03" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl03',this);"&gt;NumberGroupSeparator&lt;/a&gt;        property of the current &lt;b&gt;NumberFormatInfo&lt;/b&gt; that controls formatting.        Second, if the format string contains one or more ',' characters        immediately to the left of the decimal point, then the number will be        divided by the number of ',' characters multiplied by 1000 before it is        formatted. For example, the format string "0,," will represent 100 million        as simply 100. Use of the ',' character to indicate scaling does not        include thousand separators in the formatted number. Thus, to scale a        number by 1 million and insert thousand separators you would use the        format string "#,##0,,".&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;    &lt;td width="13%"&gt;%&lt;/td&gt;    &lt;td width="22%"&gt;Percentage placeholder&lt;/td&gt;    &lt;td width="65%"&gt;The presence of a '%' character in a format string causes        a number to be multiplied by 100 before it is formatted. The appropriate        symbol is inserted in the number itself at the location where the '%'        appears in the format string. The percent character used is dependent on        the current &lt;b&gt;NumberFormatInfo&lt;/b&gt; class.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;    &lt;td width="13%"&gt;E0        E+0&lt;br /&gt;E-0&lt;br /&gt;e0&lt;br /&gt;e+0&lt;br /&gt;e-0&lt;/td&gt;    &lt;td width="22%"&gt;Scientific notation&lt;/td&gt;    &lt;td width="65%"&gt;If any of the strings "E", "E+", "E-", "e", "e+", or "e-"        are present in the format string and are followed immediately by at least        one '0' character, then the number is formatted using scientific notation        with an 'E' or 'e' inserted between the number and the exponent. The        number of '0' characters following the scientific notation indicator        determines the minimum number of digits to output for the exponent. The        "E+" and "e+" formats indicate that a sign character (plus or minus)        should always precede the exponent. The "E", "E-", "e", or "e-" formats        indicate that a sign character should only precede negative    exponents.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;    &lt;td width="13%"&gt;\&lt;/td&gt;    &lt;td width="22%"&gt;Escape character&lt;/td&gt;    &lt;td width="65%"&gt;In C# and the Managed Extensions for C++, the backslash        character causes the next character in the format string to be interpreted        as an escape sequence. It is used with traditional formatting sequences        like '\n' (new line).        In some languages, the escape character itself must be preceded by an        escape character when used as a literal. Otherwise, the compiler        interprets the character as an escape sequence. Use the string "\\" to        display '\'.&lt;br /&gt;Note that this escape character is not supported in Visual Basic;        however, &lt;b&gt;ControlChars&lt;/b&gt; provides the same functionality.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;    &lt;td width="13%"&gt;'ABC'        "ABC"&lt;/td&gt;    &lt;td width="22%"&gt;Literal string&lt;/td&gt;    &lt;td width="65%"&gt;Characters enclosed in single or double quotes are copied        to the result string literally, and do not affect formatting.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;    &lt;td width="13%"&gt;;&lt;/td&gt;    &lt;td width="22%"&gt;Section separator&lt;/td&gt;    &lt;td width="65%"&gt;The ';' character is used to separate sections for        positive, negative, and zero numbers in the format string.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;    &lt;td width="13%"&gt;Other&lt;/td&gt;    &lt;td width="22%"&gt;All other characters&lt;/td&gt;    &lt;td width="65%"&gt;All other characters are copied to the result string as        literals in the position they appear.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;Note that for fixed-point format strings (strings not containing an "E0",  "E+0", "E-0", "e0", "e+0", or "e-0"), numbers are rounded to as many decimal  places as there are digit placeholders to the right of the decimal point. If the  format string does not contain a decimal point, the number is rounded to the  nearest integer. If the number has more digits than there are digit placeholders  to the left of the decimal point, the extra digits are copied to the result  string immediately before the first digit placeholder.&lt;br /&gt;Different formatting can be applied to a string based on whether the value is  positive, negative, or zero. To produce this behavior, a custom format string  can contain up to three sections separated by semicolons: &lt;br /&gt;&lt;ul type="disc"&gt;&lt;li&gt;&lt;b&gt;One section&lt;/b&gt;: The format string applies to all values.    &lt;/li&gt;&lt;li&gt;&lt;b&gt;Two sections&lt;/b&gt;: The first section applies to positive values and    zeros, and the second section applies to negative values. If the number to be    formatted is negative, but becomes zero after rounding according to the format    in the second section, then the resulting zero is formatted according to the    first section.    &lt;/li&gt;&lt;li&gt;&lt;b&gt;Three sections&lt;/b&gt;: The first section applies to positive values, the    second section applies to negative values, and the third section applies to    zeros. The second section might be left empty (by having nothing between the    semicolons), in which case the first section applies to all nonzero values. If    the number to be formatted is nonzero, but becomes zero after rounding    according to the format in the first or second section, then the resulting    zero is formatted according to the third section. &lt;/li&gt;&lt;/ul&gt;This type of formatting ignores any preexisting formatting associated with a  number when the final value is formatted. For example, negative values are  always displayed without a minus sign when section separators are used. If you  want the final formatted value to have a minus sign, you should explicitly  include the minus sign as part of the custom format specifier. The following  example illustrates how section separators can be used to produce formatted  strings.&lt;br /&gt;&lt;br /&gt;&lt;div class="libCScode" id="ctl00_rs1_mainContentContainer_ctl04_VisualBasic"&gt;&lt;br /&gt;&lt;div class="CodeSnippetTitleBar"&gt;&lt;br /&gt;&lt;div class="CodeDisplayLanguage"&gt;&lt;b&gt;[Visual Basic]&lt;/b&gt;&lt;/div&gt;&lt;div class="CopyCodeButton"&gt;&lt;a class="copyCode" href="javascript:CopyCode('ctl00_rs1_mainContentContainer_ctl04VisualBasic');"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class="libCScode" id="ctl00_rs1_mainContentContainer_ctl04VisualBasic" space="preserve"&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt; MyPos &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Double&lt;/span&gt; = 19.95&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt; MyNeg &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Double&lt;/span&gt; = -19.95&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt; MyZero &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Double&lt;/span&gt; = 0&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt; MyString &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = MyPos.ToString(&lt;span style="color: maroon;"&gt;"$#,##0.00;($#,##0.00);Zero"&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;' In the U.S. English culture, MyString has the value: $19.95.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;MyString = MyNeg.ToString(&lt;span style="color: maroon;"&gt;"$#,##0.00;($#,##0.00);Zero"&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;' In the U.S. English culture, MyString has the value: ($19.95).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;' The minus sign is omitted by default.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;MyString = MyZero.ToString(&lt;span style="color: maroon;"&gt;"$#,##0.00;($#,##0.00);Zero"&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;' In the U.S. English culture, MyString has the value: Zero.&lt;/span&gt;&lt;br /&gt;&lt;b&gt;[C#]&lt;/b&gt;double MyPos = 19.95, MyNeg = -19.95, MyZero = 0.0;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; MyString = MyPos.ToString(&lt;span style="color: maroon;"&gt;"$#,##0.00;($#,##0.00);Zero"&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;// &lt;span style="color: blue;"&gt;In&lt;/span&gt; the U.S. English culture, MyString has the value: $19.95.&lt;br /&gt;&lt;br /&gt;MyString = MyNeg.ToString(&lt;span style="color: maroon;"&gt;"$#,##0.00;($#,##0.00);Zero"&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;// &lt;span style="color: blue;"&gt;In&lt;/span&gt; the U.S. English culture, MyString has the value: ($19.95).&lt;br /&gt;// The minus sign &lt;span style="color: blue;"&gt;is&lt;/span&gt; omitted by &lt;span style="color: blue;"&gt;default&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;MyString = MyZero.ToString(&lt;span style="color: maroon;"&gt;"$#,##0.00;($#,##0.00);Zero"&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;// &lt;span style="color: blue;"&gt;In&lt;/span&gt; the U.S. English culture, MyString has the value: Zero.&lt;/pre&gt;&lt;pre class="libCScode" id="ctl00_rs1_mainContentContainer_ctl04VisualBasic" space="preserve"&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;b&gt;The following example demonstrates custom number formatting.&lt;/b&gt;&lt;br /&gt;&lt;div class="libCScode" id="ctl00_rs1_mainContentContainer_ctl05_VisualBasic"&gt;&lt;br /&gt;&lt;div class="CodeSnippetTitleBar"&gt;&lt;br /&gt;&lt;div class="CodeDisplayLanguage"&gt;&lt;b&gt;[Visual Basic]&lt;/b&gt;&lt;/div&gt;&lt;div class="CopyCodeButton"&gt;&lt;a class="copyCode" href="javascript:CopyCode('ctl00_rs1_mainContentContainer_ctl05VisualBasic');"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class="libCScode" id="ctl00_rs1_mainContentContainer_ctl05VisualBasic" space="preserve"&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt; myDouble &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Double&lt;/span&gt; = 1234567890&lt;br /&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt; myString &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = myDouble.ToString( &lt;span style="color: maroon;"&gt;"(###) ### - ####"&lt;/span&gt; )&lt;br /&gt;&lt;span style="color: green;"&gt;' The value of myString is "(123) 456 – 7890".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt; MyInt &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Integer&lt;/span&gt; = 42&lt;br /&gt;MyString = MyInt.ToString( &lt;span style="color: maroon;"&gt;"My Number "&lt;/span&gt; + ControlChars.Lf + &lt;span style="color: maroon;"&gt;"= #"&lt;/span&gt; )&lt;br /&gt;&lt;span style="color: green;"&gt;' In the U.S. English culture, MyString has the value: &lt;/span&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;' "My Number&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;' = 42".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;[C#]&lt;/b&gt;Double myDouble = 1234567890;&lt;br /&gt;&lt;span style="color: blue;"&gt;String&lt;/span&gt; myString = myDouble.ToString( &lt;span style="color: maroon;"&gt;"(###) ### - ####"&lt;/span&gt; );&lt;br /&gt;// The value &lt;span style="color: blue;"&gt;of&lt;/span&gt; myString &lt;span style="color: blue;"&gt;is&lt;/span&gt; &lt;span style="color: maroon;"&gt;"(123) 456 – 7890"&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;int  MyInt = 42;&lt;br /&gt;MyString = MyInt.ToString( &lt;span style="color: maroon;"&gt;"My Number \n= #"&lt;/span&gt; );&lt;br /&gt;// &lt;span style="color: blue;"&gt;In&lt;/span&gt; the U.S. English culture, MyString has the value: &lt;br /&gt;// "My Number&lt;br /&gt;// = 42".&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="overflow: hidden; display: block; position: relative;"&gt;&lt;br /&gt;&lt;table border="0" cellpadding="0" cellspacing="0" style=""&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="MTPS_FooterFade" id="ctl00_rs1_mtpsFooter_FooterFadeCell"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td id="ctl00_rs1_mtpsFooter_FooterLogoCell"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div style="display: none;"&gt;&lt;img alt="Page view tracker" border="0" height="0" hspace="0" src="file:///C:/Documents%20and%20Settings/Huynh%20Nhan/Desktop/Custom%20Numeric%20Format%20Strings_files/trans_pixel.gif" width="0" /&gt;&lt;/div&gt;&lt;script src="file:///C:/Documents%20and%20Settings/Huynh%20Nhan/Desktop/Custom%20Numeric%20Format%20Strings_files/msdn.wtnvr-bn1878.0.js" type="text/javascript"&gt;&lt;/script&gt;  &lt;script src="file:///C:/Documents%20and%20Settings/Huynh%20Nhan/Desktop/Custom%20Numeric%20Format%20Strings_files/webtrendsscript-bn1878.0.js" type="text/javascript"&gt;&lt;/script&gt; &lt;noscript&gt;&lt;br /&gt;&lt;div&gt;&lt;IMG id=Img1 height=1 alt=DCSIMG src="Custom Numeric Format Strings_files/njs.gif" width=1&gt;&lt;/DIV&gt;&lt;/noscript&gt; &lt;script src="file:///C:/Documents%20and%20Settings/Huynh%20Nhan/Desktop/Custom%20Numeric%20Format%20Strings_files/CAUPPRMR.js" type="text/javascript"&gt;&lt;/script&gt;  &lt;script type="text/javascript"&gt;//&lt;![CDATA[window.setTimeout(function(){EC_Init("ctl00_rs1_ExpandCollapse","Expand All","Collapse All","http://i.msdn.microsoft.com/Platform/Controls/ExpandCollapseAll/resources/plus.gif","http://i.msdn.microsoft.com/Platform/Controls/ExpandCollapseAll/resources/minus.gif");},0);Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(CCS_BeginRequestHandler);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(CCS_EndRequestHandler);WebForm_InitCallback();var ctl00_Masthead1_ctl00_ScopeMenu_Data = new Object();ctl00_Masthead1_ctl00_ScopeMenu_Data.disappearAfter = 500;ctl00_Masthead1_ctl00_ScopeMenu_Data.horizontalOffset = -155;ctl00_Masthead1_ctl00_ScopeMenu_Data.verticalOffset = 22;ctl00_Masthead1_ctl00_ScopeMenu_Data.hoverClass = 'ctl00_Masthead1_ctl00_ScopeMenu_9 ContextMenuItemHover';ctl00_Masthead1_ctl00_ScopeMenu_Data.hoverHyperLinkClass = 'ctl00_Masthead1_ctl00_ScopeMenu_8 ContextMenuItemHover'; RegisterAutoSubmit('ctl00_ib1_Flyout_Rating1','ctl00_ib1_Flyout_btnSubmit','contentRatingaa719871VS.71en-us');//]]&gt;&lt;/script&gt;  &lt;script language="javascript" type="text/javascript"&gt;&lt;!-- function GetContentWnd(){ return parent; } function OnInitPage(){var oWnd = GetContentWnd();} function GetServerData(arg, context){} function OnSave(){ var oWnd = GetContentWnd(); window.external.addFavorite('http://msdn.microsoft.com/en-us/library/aa719871.aspx', oWnd.document.title ); }--&gt;&lt;/script&gt;  &lt;script type="text/javascript"&gt;//&lt;![CDATA[document.getElementById('ctl00_ib1_Flyout_rtgContainer').title="Click a star and provide feedback"; document.onkeypress = function(e){ ra_keyPress(e, "ctl00_rs1_raSplitter","ctl00_rs1_raLeft");};window.attachEvent('onresize', ra_OnPageResize);window.attachEvent('onload', ra_OnPageResize);Sys.Application.initialize();TFly_Init('ctl00$Masthead1$LocaleManagement$ctl00',0,0,1,4,60,'LocaleManagementFlyoutStaticHover','',100,400,'','','','');TFly_Init('ctl00$Masthead1$QuickLinks$ctrlFlyout',0,0,1,4,60,'QuickLinksFlyoutStaticHover_msdn','',100,400,'','','','');Sys.Application.add_init(function() {    $create(AjaxControlToolkit.AutoCompleteBehavior, {"completionInterval":500,"delimiterCharacters":"","enableCaching":false,"id":"ctl00_Masthead1_ctl00_SearchAutoComplete","minimumPrefixLength":4,"serviceMethod":"GetTerms","servicePath":"../../Platform/Controls/Search/TermService.asmx"}, null, null, $get("ctl00_Masthead1_ctl00_SearchTextBox"));});TFly_Init('ctl00$ib1$Flyout',5,2,1,4,60,'','',100,400,'','','','');Sys.Application.add_init(function() {    $create(Microsoft.Mtps.Web.UI.MtpsRatingBehavior, {"AutoPostBack":false,"CallbackID":"ctl00$ib1$Flyout$Rating1","ClientStateFieldID":"ctl00_ib1_Flyout_Rating1_RatingExtender_ClientState","EmptyStarCssClass":"emptyRatingStar","FilledStarCssClass":"filledRatingStar","Rating":4,"StarCssClass":"ratingStar","Tag":"contentRatingaa719871VS.71en-us","WaitingStarCssClass":"savedRatingStar","id":"ctl00_ib1_Flyout_Rating1_RatingExtender"}, null, null, $get("ctl00_ib1_Flyout_Rating1"));});//]]&gt;&lt;/script&gt;  &lt;script type="text/javascript"&gt;//&lt;![CDATA[*/ var tocVectorObject;var hostbase;var closedImg;var openImg;var emptyImg;var loadingImg;var tocVector;var tocIndex = 0;var holder;var tocLoaded = false;var tocCollapsed = 'False';tocVectorObject = {"nodes": [{"id": "ms310241" ,"url": "/ms310241(n)"}]};hostbase ="http://msdn.microsoft.com/en-us/library";tocVector = eval(tocVectorObject);closedImg = "http://i.msdn.microsoft.com/Platform/Controls/Toc/resources/c.gif";openImg = "http://i.msdn.microsoft.com/Platform/Controls/Toc/resources/o.gif";emptyImg = "http://i.msdn.microsoft.com/Platform/Controls/Toc/resources/e.gif";loadingImg = "http://i.msdn.microsoft.com/Platform/Controls/Toc/resources/s.gif";Sys.Application.add_load(LoadToc);/*]]&gt;*/&lt;/script&gt;  &lt;script type="text/javascript"&gt;//&lt;![CDATA[TFly_Init('ctl00$rs1$eb1$ctl00',0,-1,-1,10,5,'statHover','',0,0,'EyeBrowMenuBarSetHeight','ExpEye','','');TFly_Init('ctl00$rs1$eb1$ctl01',0,-1,-1,10,5,'statHover','',0,0,'EyeBrowMenuBarSetHeight','ExpEye','','');CheckDropDownClientCookie(false);SetFilterText(false);//]]&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-6022687522840829962?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/6022687522840829962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=6022687522840829962' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6022687522840829962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6022687522840829962'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/07/microsoft-custom-numeric-format-strings.html' title='Microsoft Custom Numeric Format Strings'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-6946761379740890203</id><published>2008-07-16T07:00:00.000-07:00</published><updated>2008-07-16T07:00:01.007-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML and JavaScript'/><title type='text'>Javascript format numbers with custom string</title><content type='html'>&lt;script src="http://huy2nhan.googlepages.com/number-functions.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;function doit(form) {    form.elements["dest"].value = new Number(form.elements["src"].value).numberFormat(form.elements["format"].value);    form.elements["text"].value = Number.prototype[Number.formatFunctions[form.elements["format"].value]];}&lt;/script&gt;&lt;br /&gt;When playing with Google for how to format numbers to custom string in JavaScript (like Microsoft numeric custom format string ), I found an &lt;a href="http://www.xaprb.com/blog/2006/01/05/javascript-number-formatting/"&gt;excellent article&lt;/a&gt; by &lt;a href="http://www.xaprb.com/blog/"&gt;Xaprb.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;for example :&amp;nbsp; 111111 with format ###,###.00 will result as 111,111.00.&lt;br /&gt;&lt;br /&gt;Current script support format of us ( use "," for thousand separating ), it's simple to replace "," by "." for "eu" format.&lt;br /&gt;&lt;br /&gt;Try demo and visit above link if you're interested in this ;)&lt;br /&gt;&lt;form action="" method="get"&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;label for="src"&gt;value&lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;input id="src" name="src" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;label for="format"&gt;format&lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;input id="format" name="format" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;label for="dest"&gt;result&lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;input id="dest" name="dest" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;input onclick="doit(this.form)" type="button" value="do it!" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/form&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-6946761379740890203?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.xaprb.com/blog/2006/01/05/javascript-number-formatting/' title='Javascript format numbers with custom string'/><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/6946761379740890203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=6946761379740890203' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6946761379740890203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6946761379740890203'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/07/javascript-format-numbers-with-custom.html' title='Javascript format numbers with custom string'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-5456712819956153994</id><published>2008-07-15T19:27:00.000-07:00</published><updated>2008-07-15T19:29:36.998-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML and JavaScript'/><title type='text'>Javascript Trim string</title><content type='html'>&lt;pre&gt;var trimmed = str.replace(/^\s+|\s+$/g, '') ;&lt;br /&gt;&lt;br /&gt;that's all.&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-5456712819956153994?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/5456712819956153994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=5456712819956153994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5456712819956153994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5456712819956153994'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/07/javascript-trim-string.html' title='Javascript Trim string'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-601340813854868661</id><published>2008-06-05T02:57:00.000-07:00</published><updated>2008-06-05T03:06:39.375-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Understand ASP.NET Response.Redirect &amp; Server.Transfer</title><content type='html'>&lt;span style="color: rgb(0, 102, 0);"&gt;Today, i just found an excellent articles by &lt;/span&gt;&lt;a style="color: rgb(0, 102, 0);" href="http://www.devx.com/"&gt;Joydip Kanjilal&lt;/a&gt;&lt;span style="color: rgb(0, 102, 0);"&gt; while learning ASP.Net technique related to my current project. Try this, a worthy reading :)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;                                                                                                                                                                                  &lt;/span&gt;&lt;a style="color: rgb(0, 102, 0);" href="http://expsharing.blogspot.com"&gt;  moongy&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;By default, an ASP.NET web form posts back to itself whenever a postback operation occurs. That behavior wasn't terribly common in web pages before&lt;i&gt; &lt;/i&gt;ASP.NET appeared, and isn't always what you want to have happen: What if you &lt;i&gt;want&lt;/i&gt; to post a web form to another web page in the application? ASP.NET made that fairly difficult in ASP.NET 1.0, but ASP.NET 2.0 makes developers lives easier in this regard by adding a new feature called "cross-page postbacks" that allows a web page to post its data back to a different web page. In cross-page postbacks, the page that initiates the postback is called the &lt;i&gt;source&lt;/i&gt; page and the page to which the client posts is called the &lt;i&gt;target &lt;/i&gt;page.&lt;br /&gt;&lt;br /&gt;Conveniently, the target page can still retrieve any control values posted by the source web page in a cross-page postback operation. In other words, from a development point of view, you can process the posted data in much the same way you would process any normal ASP.NET postback.&lt;br /&gt;&lt;br /&gt;The new feature means ASP.NET 2.0 developers now have three techniques for transferring processing from one web page to another in an application: &lt;span class="pf"&gt;Response.Redirect&lt;/span&gt;, &lt;span class="pf"&gt;Server.Transfer&lt;/span&gt;, and the new cross-page postback features. You're probably familiar with the first two, so I'll review them only briefly, and then concentrate on how to use the cross-page postback feature, showing how it works and how it differs from the &lt;span class="pf"&gt;Response.Redirect&lt;/span&gt; and &lt;span class="pf"&gt;Server.Transfer&lt;/span&gt; techniques.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Response.Redirect Method&lt;/b&gt;&lt;br /&gt;The &lt;span class="pf"&gt;Response.Redirect&lt;/span&gt; method is by far the simplest method of redirecting processing from a source page to a different destination or target page in the same or even across different applications. When the web server receives a request for redirection, it sends a response header to the client that causes the client to send a new request back to the server. In other words, a redirect causes two request/response cycles: one for the original and one for the new redirected request.&lt;br /&gt;&lt;br /&gt;ASP.NET makes redirects easy. The following code snippet illustrates how to use the &lt;span class="pf"&gt;Response.Redirect&lt;/span&gt; method:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;   protected void Redirect_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;   Response.Redirect("menu.aspx");&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt; Note that the redirect request is a &lt;span class="PF"&gt;GET&lt;/span&gt; request, meaning that you can't post data from the original page via the &lt;span class="pf"&gt;Response.Redirect&lt;/span&gt; command. You can work around that to pass data from the source to the target by using query strings in the &lt;span class="pf"&gt;Response.Redirect&lt;/span&gt; method call as shown below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;   protected void Redirect_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;   Response.Redirect("menu.aspx?userName=" + UserName.Text));&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt; The preceding example passes a query string as a parameter to the &lt;span class="pf"&gt;Response.Redirect&lt;/span&gt; method along with the target URL. The target can now use code such as the following to retrieve the source's data as shown below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;   protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;   string userName = Request["userName"];&lt;br /&gt;   //Other code&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt; &lt;b&gt;The Server.Transfer Method&lt;/b&gt;&lt;br /&gt;Instead of relying on the client to make a request to a new page, &lt;span class="pf"&gt;Server.Transfer&lt;/span&gt; is a server-side redirection technique that simply changes the code's "focus" on the web server to a new page. &lt;span class="pf"&gt;Server.Transfer&lt;/span&gt; is far more efficient than &lt;span class="pf"&gt;Response.Redirect&lt;/span&gt; when the target page resides on the same web server, because it avoids the extra roundtrip and uses only server resources for the redirection. Note that it has a side effectâ€”the URL shown in the web browser does not change eitherâ€”meaning clients may think they posted their data to one page while actually posting it to a different page. In most cases, that's not a problem, but it can make debugging more difficult.&lt;br /&gt;&lt;br /&gt;&lt;span class="pf"&gt;Server.Transfer&lt;/span&gt; also preserves the HttpContext of the initiating page; therefore the target page can access the control values of the source page. Specifically, you can use the &lt;span class="pf"&gt;FormsCollection&lt;/span&gt; property to retrieve the source control values from the target page when using the &lt;span class="pf"&gt;Server.Transfer&lt;/span&gt; technique. First, make sure you use the overloaded &lt;span class="pf"&gt;Server.Transfer&lt;/span&gt; method, which accepts two parametersâ€”the target URL, and a Boolean &lt;span class="pf"&gt;preserveForm&lt;/span&gt; value which tells the server to preserve the query string and any control values from the source page. Set the &lt;span class="pf"&gt;preserveForm&lt;/span&gt; parameter to &lt;span class="pf"&gt;true&lt;/span&gt; in the source web page as shown below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;   Server.Transfer("Menu.aspx",true);&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt; Then, from the target page, to retrieve the value of a textbox control called &lt;span class="pf"&gt;txtUserName&lt;/span&gt; for example, use the following code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;   object obj = Request.Form["txtUserName"];&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt; &lt;b&gt;Response.Redirect vs. Server.Transfer&lt;/b&gt;&lt;br /&gt;Because &lt;span class="pf"&gt;Response.Redirect&lt;/span&gt; requires an extra round trip, you should avoid it for high-volume web sites due to associated performance and scalability issues. However, this is the only technique that you can use to redirect from one web server to another. In contrast, &lt;span class="pf"&gt;Server.Transfer&lt;/span&gt; is more efficient, but can transfer execution only to a different web page &lt;i&gt;on the same server&lt;/i&gt;. In essence, you'd use &lt;span class="pf"&gt;Server.Transfer&lt;/span&gt; to eliminate unnecessary roundtrips when both the source and the target web page reside on the same server (they can be in different ASP.NET applications on that server), and use &lt;span class="pf"&gt;Response.Redirect&lt;/span&gt; when you need to redirect to a different server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-601340813854868661?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/601340813854868661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=601340813854868661' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/601340813854868661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/601340813854868661'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/06/understand-aspnet-responseredirect.html' title='Understand ASP.NET Response.Redirect &amp; Server.Transfer'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-1827551290240749997</id><published>2008-05-13T18:55:00.000-07:00</published><updated>2008-05-13T18:56:48.667-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='window service'/><category scheme='http://www.blogger.com/atom/ns#' term='window OS'/><title type='text'>Interact window service with command line</title><content type='html'>Window service can be started at system boot, or at any other time, without the&lt;br /&gt;need for any wrapper code to start the service.  The service can be managed&lt;br /&gt;using command-line tools ("net start",&lt;br /&gt;"net stop", or sc.exe) or GUI tools (the Services administrative tool).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Installation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; Most Windows OSes derived from Windows NT (such as Windows XP, Windows 2000,&lt;br /&gt;Windows 2003 Server) provide a command-line tool for installing&lt;br /&gt;services, called SC.EXE for "Service Control". To create a service for&lt;br /&gt;svnserve, use SC.EXE:&lt;br /&gt;&lt;br /&gt;   sc create &lt;name&gt;&lt;br /&gt;      binpath= "c:\myservice.exe --service &lt;service-args&gt;"&lt;br /&gt;      displayname= "My Service Name"&lt;br /&gt;      depend= Tcpip    //* explain this line later&lt;br /&gt;&lt;br /&gt;where &lt;name&gt; is any service name you want, e.g. "My Service Name", and&lt;br /&gt;&lt;svn-args&gt; are the arguments to svnserve, such as --root,&lt;br /&gt;--listen-port, etc.  (All of this should be specified on a single&lt;br /&gt;line, of course.)&lt;br /&gt;&lt;br /&gt;If the path to the service contains spaces or other characters that&lt;br /&gt;must be escaped, then you must enclose the path to it with&lt;br /&gt;double-quotes, which themselves must be quoted using a backslash.&lt;br /&gt;Fortunately the syntax is similar to that on Unix platforms:&lt;br /&gt;&lt;br /&gt;   sc create &lt;name&gt;&lt;br /&gt;      binpath= "\"c:\program files\My Service\bin\myservice.exe\" ..."&lt;br /&gt;&lt;br /&gt;SC has many options; use "sc /?".  The most relevant are:&lt;br /&gt;&lt;br /&gt;   sc create &lt;name&gt;     create a new service&lt;br /&gt;   sc qc &lt;name&gt;         query config for a service&lt;br /&gt;   sc query &lt;name&gt;      query status&lt;br /&gt;   sc delete &lt;name&gt;     delete any service -- BE CAREFUL!&lt;br /&gt;   sc config &lt;name&gt; ... update service config; same args as sc create&lt;br /&gt;   sc start &lt;name&gt;      start a service (does NOT wait for completion!)&lt;br /&gt;   sc stop &lt;name&gt;       stop a service (does NOT wait for it to stop!)&lt;br /&gt;&lt;br /&gt;Note that the command-line syntax for SC is rather odd.  Key/value&lt;br /&gt;pairs are specified as "key= value" (without the double-quotes).  The&lt;br /&gt;"key=" part must not have any spaces, and the "value" part MUST be&lt;br /&gt;separated from the "key=" by a space.&lt;br /&gt;&lt;br /&gt;If you want to be able to see the command shell, add these arguments&lt;br /&gt;to the "sc create" command-line:&lt;br /&gt;&lt;br /&gt;   type= own type= interact&lt;br /&gt;&lt;br /&gt;This sets the "interactive" bit on the service, which allows it to&lt;br /&gt;interact with the local console session.&lt;br /&gt;&lt;br /&gt;You can create as many services as you need; there is no restriction&lt;br /&gt;on the number of services, or their names.  I use a prefix, like&lt;br /&gt;"msv.foo", "msv.bar", etc.  Each service runs in a separate process.&lt;br /&gt;As usual, it is your responsbility as an administrator to make sure&lt;br /&gt;that no two service instances use the same repository root path, or&lt;br /&gt;the same combination of --listen-port and --listen-host.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Uninstalling&lt;/span&gt;&lt;br /&gt;------------&lt;br /&gt;&lt;br /&gt;To uninstall a service, stop the service, then delete it, using "sc&lt;br /&gt;delete &lt;name&gt;".  Be very careful with this command, since you can&lt;br /&gt;delete any system service, including essential Windows services,&lt;br /&gt;accidentally.&lt;br /&gt;&lt;br /&gt;Also, make sure that you stop the service before you delete it.  If&lt;br /&gt;you delete the service before stopping it, the Service Control Manager&lt;br /&gt;will mark the service "deleted", but will intentionally not stop the&lt;br /&gt;service.  The service will be deleted when the system reboots, or when&lt;br /&gt;the service finally exits.  After all, you only asked to delete the&lt;br /&gt;service, not to stop it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Automatically Starting Service on System Boot&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;---------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By default, SC creates the service with the start mode set to "demand"&lt;br /&gt;(manual).  If you want the service to start automatically when the&lt;br /&gt;system boots, add "start= auto" to the command line.  You can change&lt;br /&gt;the start mode for an existing service using "sc config &lt;name&gt; start=&lt;br /&gt;auto", or also by using the Windows GUI interface for managing&lt;br /&gt;services.  (Start, All Programs, Administrative Tools, Services, or&lt;br /&gt;just run "services.msc" from Start/Run or from a command-line.)&lt;br /&gt;&lt;br /&gt;* Note: If the service had dependecies, in order for it to start correctly&lt;br /&gt;on system boot, you must properly declare its startup dependencies. &lt;br /&gt;The Service Control Manager will start services as early as it can,&lt;br /&gt;and if you do not properly declare its startup dependencies ( ex. tcp/ip ),&lt;br /&gt;it can potentially start before the TCP/IP stack has been started. &lt;br /&gt;This is why you must provide specify 'depend= Tcpip' to SC.EXE when&lt;br /&gt;creating the service in above example.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Starting and Stopping the Service&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;---------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You start and stop the service like any other Windows service.  You&lt;br /&gt;can use the command-line "net start &lt;name&gt;", use the GUI Services&lt;br /&gt;interface.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Debugging&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;---------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Debugging a Windows service can be difficult, because the service runs&lt;br /&gt;in a very different context than a user who is logged in.  By default,&lt;br /&gt;services run in a non-desktop environment.  They cannot interact&lt;br /&gt;with the user (desktop) in any way, and vice versa.&lt;br /&gt;&lt;br /&gt;Also, by default, services run as a special user, called LocalSystem.&lt;br /&gt;LocalSystem is not a "user" in the normal sense; it is an NT security&lt;br /&gt;ID (SID) that is sort of like root, but different.  LocalSystem&lt;br /&gt;typically does NOT have access to any network shares, even if you use&lt;br /&gt;"net use" to connect to a remote file server.  Again, this is because&lt;br /&gt;services run in a different login session.&lt;br /&gt;&lt;br /&gt;Depending on which OS you are running, you may have difficulty&lt;br /&gt;attaching a debugger to a running service process.  Also, if you are&lt;br /&gt;having trouble *starting* a service, then you can't attach to the&lt;br /&gt;process early enough to debug it.&lt;br /&gt;&lt;br /&gt;So what's a developer to do?  Well, there are several ways you can&lt;br /&gt;debug services.  First, you'll want to enable "interactive" access for&lt;br /&gt;the service.  This allows the service to interact with the local&lt;br /&gt;desktop -- you'll be able to see the command shell that the service&lt;br /&gt;runs in, see console output, etc.  To do this, you can either use the&lt;br /&gt;standard Windows Services tool (services.msc), or you can do it using&lt;br /&gt;sc.exe.&lt;br /&gt;&lt;br /&gt;   * With the GUI tool, open the properties page for a service, and go&lt;br /&gt;     to the "Log On" page.  Select "Local System account", and make&lt;br /&gt;     sure the "Allow service to interact with desktop" box is checked.&lt;br /&gt;&lt;br /&gt;   * With SC.EXE, configure the service using the command:&lt;br /&gt;&lt;br /&gt;         sc &lt;name&gt; config type= own type= interact&lt;br /&gt;&lt;br /&gt;     Yes, you must specify type= twice, and with exactly the spacing&lt;br /&gt;     shown.&lt;br /&gt;&lt;br /&gt;In both cases, you'll need to restart the service.  When you do, if&lt;br /&gt;the service started successfully, you'll see the console window of the&lt;br /&gt;service.  By default, it doesn't print anything out.&lt;br /&gt;&lt;br /&gt;Next, you'll want to attach a debugger, or configure the service to&lt;br /&gt;start under a debugger.  Attaching a debugger should be&lt;br /&gt;straightforward -- just find the process ID.  But if you need to debug&lt;br /&gt;something in the service startup path, you'll need to have a debugger&lt;br /&gt;attached from the very beginning.  There are two ways to do this.&lt;br /&gt;&lt;br /&gt;In the first method, you alter the command-line of the service (called&lt;br /&gt;the "binary path").  To do this, use SC.EXE to set the binary path to&lt;br /&gt;whatever debugger you are going to use.  I use the most recent version&lt;br /&gt;of WinDbg, which is excellent, and is available at:&lt;br /&gt;&lt;br /&gt;   http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx&lt;br /&gt;&lt;br /&gt;For example, this command would configure the service to start under a&lt;br /&gt;debugger:&lt;br /&gt;&lt;br /&gt;   sc config &lt;name&gt; binpath= "d:\dbg\windbg.exe -g -G d:\bin\myservice.exe&lt;br /&gt;      --root d:\path\root --listen-port 9000"&lt;br /&gt;      depend= Tcpip&lt;br /&gt;&lt;br /&gt;The entire command must be on a single line, of course, and the binary&lt;br /&gt;path must be in double-quotes.  Also, the spacing MUST be: binpath= "..."&lt;br /&gt;&lt;br /&gt;Substitute whatever debugger you want, with whatever command-line you&lt;br /&gt;want, in place of windbg.exe.  Then start the service (sc start&lt;br /&gt;&lt;name&gt;), and the Service Control Manager should execute the&lt;br /&gt;command-line you provided as the binary path.  Then your debugger&lt;br /&gt;should start, and should launch the "myservice" process.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-1827551290240749997?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/1827551290240749997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=1827551290240749997' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1827551290240749997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1827551290240749997'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/05/interact-window-service-with-command.html' title='Interact window service with command line'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-4828226607196222199</id><published>2008-05-13T02:41:00.000-07:00</published><updated>2008-11-24T01:39:59.521-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>User objects and resources</title><content type='html'>In the following you will get an overview, how you can get information about your Oracle user environment. For the samples it is assumed, that you are already connected to the database via SQL*Plus. &lt;br /&gt;&lt;dl&gt;&lt;dt&gt;Which tables do you have? &lt;/dt&gt;&lt;dd&gt;&lt;pre&gt;SQL&amp;gt; select table_name from user_tables;&lt;/pre&gt;&lt;/dd&gt;&lt;dt&gt;How is my table defined, which columns has it? &lt;/dt&gt;&lt;dd&gt;&lt;pre&gt;SQL&amp;gt; describe table_name&lt;/pre&gt;&lt;/dd&gt;&lt;dt&gt;Which database objects do I have currently? &lt;/dt&gt;&lt;dd&gt;&lt;pre&gt;SQL&amp;gt; select object_name, object_type from user_objects;&lt;/pre&gt;&lt;/dd&gt;&lt;dt&gt;Which privileges has your Oracle account? &lt;/dt&gt;&lt;dd&gt;&lt;pre&gt;SQL&amp;gt; select * from session_privs;&lt;/pre&gt;&lt;/dd&gt;&lt;dt&gt;Which quota do you actually have on which tablespace? &lt;/dt&gt;&lt;dd&gt;&lt;pre&gt;SQL&amp;gt; select tablespace_name, bytes, max_bytes from user_ts_quotas;&lt;/pre&gt;&lt;/dd&gt;&lt;dt&gt;How big are your tables/objects for themselves? &lt;/dt&gt;&lt;dd&gt;&lt;pre&gt;SQL&amp;gt; select segment_name, tablespace_name, bytes from user_segments;&lt;/pre&gt;&lt;/dd&gt;&lt;dt&gt;ref:&lt;/dt&gt;&lt;dd&gt;&lt;span style="font-size: 85%;"&gt;&lt;a href="http://www-it.desy.de/systems/services/databases/oracle/at_desy/user_objects.html.en"&gt;http://www-it.desy.de/systems/services/databases/oracle/at_desy/user_objects.html.en&lt;/a&gt;&lt;/span&gt; &lt;/dd&gt;&lt;/dl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-4828226607196222199?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/4828226607196222199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=4828226607196222199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/4828226607196222199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/4828226607196222199'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/05/user-objects-and-resources.html' title='User objects and resources'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-5259171187568148417</id><published>2008-05-13T02:36:00.000-07:00</published><updated>2008-11-24T01:41:33.704-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic Introduction to SQLPLUS</title><content type='html'>The SQL*PLUS (pronounced "sequel plus") program allows you to store and retrieve data in the relational database management system ORACLE. Databases consists of tables which can be manipulated by &lt;b&gt;structured query language (SQL) &lt;/b&gt;commands.&lt;br /&gt;A table is made up of columns (vertical) and rows (horizontal).&lt;br /&gt;A row is made up of fields which contain a data value at the intersection of a row and a column.&lt;br /&gt;Be aware that SQL*PLUS is a program and not a standard query language. &lt;br /&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt;&lt;a href="" name="SECTION00001000000000000000"&gt;Getting Started&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;It is a prerequisite that users are registered for ORACLE, an ORACLE account is needed.&lt;br /&gt;On Unix platforms you must start the script &lt;b&gt;oraenv&lt;/b&gt; to set the ORACLE environment. Enter the command &lt;b&gt;. oraenv&lt;/b&gt; and press &lt;i&gt;&amp;lt;&lt;/i&gt;Return;&lt;i&gt;&amp;gt;&lt;/i&gt;.&lt;br /&gt;Don't forget to type a blanc between the dot and oraenv.&lt;br /&gt;If you are working with a PC using MS Windows, simply use &lt;b&gt; Netinstall&lt;/b&gt; to install the product. You can find the software in the database folder.&lt;br /&gt;Enter &lt;b&gt;sqlplus&lt;/b&gt; on unix systems or run it on Windows from the start menue. Answer the displayed prompts by entering your ORACLE user-name and password.&lt;br /&gt;The SQL*PLUS command prompt   &lt;b&gt;SQL &lt;i&gt;&amp;gt;&lt;/i&gt; &lt;/b&gt; indicates that you are ready to work. &lt;br /&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt;Some elementary Commands&lt;/span&gt;&lt;/h2&gt;&lt;table cols="2"&gt;&lt;col align="left"&gt;&lt;/col&gt;&lt;col align="left"&gt;&lt;/col&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;alter user&lt;/b&gt; &lt;i&gt;user&lt;/i&gt; &lt;b&gt;identified by&lt;/b&gt; &lt;i&gt;newpassword&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;enables &lt;i&gt; user&lt;/i&gt; to change the password&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;help&lt;/b&gt;      &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;accesses the SQL*PLUS help system &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;exit, quit&lt;/b&gt;      &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;terminates SQL*PLUS &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;ho[st]&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;leads to the operating system without leaving SQL*PLUS &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;ho[st]&lt;/b&gt; &lt;i&gt;command&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;executes a host operating system command   &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;ho[st] oerr&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;accesses the ORACLE error help for unix&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt;&lt;a href="" name="SECTION00002000000000000000"&gt;Editing and Executing&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;All entered input is stored as a single SQL*PLUS statement in the command buffer. Pressing the &lt;i&gt;&amp;lt;&lt;/i&gt;Return&lt;i&gt;&amp;gt;&lt;/i&gt; key while editing will either open a new numbered line or, if the previous line ends with a semicolon or consists of a single slash, will execute the SQL*PLUS command. Opening new numbered lines allows you to structure statements and enables you to refer to particular lines by later using edit functions. &lt;br /&gt;&lt;table cols="2"&gt;&lt;col align="left"&gt;&lt;/col&gt;&lt;col align="left"&gt;&lt;/col&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;l[ist]&lt;/b&gt;      &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;lists command buffer (the current line is marked with a star) &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;l&lt;/b&gt;&lt;i&gt;n&lt;/i&gt; or &lt;i&gt;n&lt;/i&gt;  &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;makes line &lt;i&gt;n&lt;/i&gt; the current line and lists it  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;l&lt;/b&gt;&lt;i&gt;n&lt;/i&gt;  &lt;i&gt;m&lt;/i&gt;  &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;lists lines &lt;i&gt;n&lt;/i&gt; through &lt;i&gt;m&lt;/i&gt; &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;a&lt;/b&gt; &lt;i&gt;text&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;appends &lt;i&gt;text&lt;/i&gt; to current line &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;c&lt;/b&gt;/&lt;i&gt;oldstring&lt;/i&gt;/&lt;i&gt;newstring&lt;/i&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;changes &lt;i&gt;oldstring&lt;/i&gt; to &lt;i&gt;newstring&lt;/i&gt; in current line&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;i&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;inserts a line after current line &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;del&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;deletes the current line &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;r[un]&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;runs and lists command buffer &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;/&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;runs command buffer &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;;&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;lists command buffer &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;If you use substitution variables, like &amp;amp;&lt;b&gt;variable&lt;/b&gt;, instead of values or names  in your SQL statement, SQL*PLUS will prompt you and substitute the entered value. A substitution variable is a user variable name preceded by an ampersand. &lt;br /&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt;&lt;a href="" name="SECTION00003000000000000000"&gt;Working with Command Files&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;You can use command files to save complex commands. After creating a command file you can retrieve, edit, and run it.  The default file extension is &lt;b&gt;.sql&lt;/b&gt; . If you use other file extensions you must write the full file name like &lt;i&gt;name.extension&lt;/i&gt;.  &lt;br /&gt;&lt;table cols="2"&gt;&lt;col align="left"&gt;&lt;/col&gt;&lt;col align="left"&gt;&lt;/col&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;ed[it]&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;overwrites a scratch file with the contents of the command buffer&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;edit&lt;/b&gt; enables you to edit this file with the defined host operating system &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;editor. The name of the scratch file is &lt;b&gt;afiedt.buf&lt;/b&gt; . &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;After leaving the editor the buffer is listed and you can execute it. &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;ed[it]&lt;/b&gt; &lt;i&gt;filename&lt;/i&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;enables you to edit an existing or new file &lt;i&gt;filename&lt;/i&gt;.&lt;b&gt;sql&lt;/b&gt;  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;sav[e]&lt;/b&gt; &lt;i&gt;filename&lt;/i&gt;  &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;creates file &lt;i&gt;filename&lt;/i&gt; and stores the command buffer into it &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;sav[e]&lt;/b&gt; &lt;i&gt;filename&lt;/i&gt; [&lt;i&gt;option&lt;/i&gt;] &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;stores command buffer into file &lt;i&gt;filename&lt;/i&gt; &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;Possible &lt;i&gt;options&lt;/i&gt; are &lt;b&gt;cre[ate], app[end], rep[lace]&lt;/b&gt;. &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;get&lt;/b&gt; &lt;i&gt;filename&lt;/i&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;loads the host operating system file &lt;i&gt;filename&lt;/i&gt; into the command buffer &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;sta[rt]&lt;/b&gt; &lt;i&gt;filename&lt;/i&gt; [&lt;i&gt;arg1 arg2 ..&lt;/i&gt;] &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;executes file &lt;i&gt;filename&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;i&gt;arg1 arg2 ..&lt;/i&gt; are arguments you wish to pass to the command file&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;If you run a command file in which a substitution variable like &amp;amp;1     is used, you will be prompted for that value.   You can avoid being prompted by passing an argument to the command file.  &lt;br /&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt;&lt;a href="" name="SECTION00004000000000000000"&gt;Queries and Subqueries&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;Retrieving data from the database is the most common SQL operation. A query is an SQL command (specifically a &lt;b&gt;select&lt;/b&gt;) that retrieves information from one or more tables. A subquery is a &lt;b&gt;select&lt;/b&gt; which is nested in another SQL command.  &lt;br /&gt;&lt;h3&gt;&lt;a href="" name="SECTION00004100000000000000"&gt;The Describe Command&lt;/a&gt;&lt;/h3&gt;&lt;table cols="2"&gt;&lt;col align="left"&gt;&lt;/col&gt;&lt;col align="left"&gt;&lt;/col&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;desc[ribe]&lt;/b&gt; &lt;i&gt;name&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;lists the column definition for table or view &lt;i&gt;name&lt;/i&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;&lt;a href="" name="SECTION00004200000000000000"&gt;Basic Select Commands&lt;/a&gt;&lt;/h3&gt;The basic select command consists of two parts, called &lt;i&gt;clauses&lt;/i&gt;: &lt;b&gt;select&lt;/b&gt; some data &lt;b&gt;from&lt;/b&gt; table.&lt;br /&gt;Examples &lt;br /&gt;&lt;table cols="2"&gt;&lt;col align="left"&gt;&lt;/col&gt;&lt;col align="left"&gt;&lt;/col&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;select * from&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;selects all columns and rows from table &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;select distinct&lt;/b&gt; &lt;i&gt;col&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;selects column &lt;i&gt;col&lt;/i&gt; from table &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;and returns only one copy  of duplicate rows &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;col1, col2 ...&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;selects specified &lt;i&gt;columns&lt;/i&gt; from table &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;col1, col2*3&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;selects &lt;i&gt;col1,col2&lt;/i&gt; from table &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;and lists &lt;i&gt;col1&lt;/i&gt;, &lt;i&gt;col2&lt;/i&gt; multiplied by 3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;2*3&lt;/i&gt; &lt;b&gt;from dual&lt;/b&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;calculates &lt;i&gt;2*3&lt;/i&gt; and will display the result&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;&lt;a href="" name="SECTION00004300000000000000"&gt;Selecting Rows and Ordering&lt;/a&gt;&lt;/h3&gt;To retrieve specific rows from a table you need to add a &lt;b&gt;where&lt;/b&gt; clause. A where clause consists of one or more search conditions which can be connected by logical operators. To display the retrieved data in a specific order you need to add an &lt;b&gt;order by&lt;/b&gt; clause.&lt;br /&gt;Examples&lt;br /&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;col1,col2 &lt;/i&gt;&lt;b&gt;from&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt;&lt;br /&gt;&lt;b&gt;where&lt;/b&gt; &lt;i&gt;col1 &lt;i&gt;&amp;lt;&lt;/i&gt; col2&lt;/i&gt; &lt;b&gt;and&lt;/b&gt; &lt;i&gt;col2 !=0&lt;/i&gt;&lt;br /&gt;&lt;b&gt;order by&lt;/b&gt; &lt;i&gt;col2&lt;/i&gt;&lt;br /&gt;Columns &lt;i&gt;col1, col2&lt;/i&gt; are selected from table &lt;i&gt;tabname&lt;/i&gt; and all rows where &lt;i&gt;col2&lt;/i&gt; is not equal to zero and &lt;i&gt;col1&lt;/i&gt; is less than &lt;i&gt;col2&lt;/i&gt; are  displayed in an ascending order (ordered by &lt;i&gt;col2&lt;/i&gt;).&lt;br /&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;col1,col2&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt;&lt;br /&gt;&lt;b&gt;where&lt;/b&gt; &lt;i&gt;col1&lt;/i&gt; &lt;b&gt;like&lt;/b&gt; '_A%' &lt;b&gt;or&lt;/b&gt; &lt;i&gt;col1 &lt;/i&gt; &lt;b&gt;like&lt;/b&gt; '+++'&lt;br /&gt;&lt;b&gt;order by&lt;/b&gt; &lt;i&gt;col2&lt;/i&gt; &lt;b&gt;desc&lt;/b&gt;&lt;br /&gt;Columns &lt;i&gt;col1,col2&lt;/i&gt; are selected from table &lt;i&gt;tabname&lt;/i&gt; and all rows where &lt;i&gt;col1&lt;/i&gt; is equal to '+++' or where the second letter in &lt;i&gt;col1&lt;/i&gt; is an 'A' are displayed in a descending order.&lt;br /&gt;In this example two different escape characters are used. The underscore matches exactly one character whereas the percent sign can match zero or more characters.&lt;br /&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;col1,col2&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt;&lt;br /&gt;&lt;b&gt;where&lt;/b&gt; &lt;i&gt;col1&lt;/i&gt; &lt;b&gt;in&lt;/b&gt; ( &lt;i&gt;value1,value2&lt;/i&gt; )&lt;br /&gt;Columns &lt;i&gt;col1,col2&lt;/i&gt; are selected from table &lt;i&gt;tabname&lt;/i&gt; and all rows where &lt;i&gt;col1&lt;/i&gt; is equal to &lt;i&gt;value1&lt;/i&gt; or to &lt;i&gt;value2&lt;/i&gt; are displayed.&lt;br /&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;col1,col2&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt;&lt;br /&gt;&lt;b&gt;where&lt;/b&gt; &lt;i&gt;col1&lt;/i&gt; &lt;b&gt;not between&lt;/b&gt; &lt;i&gt;value1&lt;/i&gt; &lt;b&gt;and&lt;/b&gt; &lt;i&gt;value2&lt;/i&gt;&lt;br /&gt;Columns &lt;i&gt;col1,col2&lt;/i&gt; are selected from table &lt;i&gt;tabname&lt;/i&gt; and all rows where &lt;i&gt;col1&lt;/i&gt; is not in the range between &lt;i&gt;value1&lt;/i&gt; and &lt;i&gt;value2&lt;/i&gt; are displayed.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt;&lt;a href="" name="SECTION00005000000000000000"&gt;Using Set Operator&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;Set operators combine the results of two queries into a single result. If a statement contains multiple set operators, they will be evaluated from left to right. &lt;br /&gt;&lt;table cols="2"&gt;&lt;col align="left"&gt;&lt;/col&gt;&lt;col align="left"&gt;&lt;/col&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;i&gt;set operator&lt;/i&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;union&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;returns all distinct rows selected by either query&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;union all&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;returns all rows selected by either query, including all duplicates&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;intersect&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;returns all distinct rows selected by both queries&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;minus&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;returns all distinct rows selected by the first query but not the second&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Example&lt;br /&gt;&lt;b&gt;select * from&lt;/b&gt; &lt;i&gt;table1&lt;/i&gt;&lt;br /&gt;&lt;b&gt;union all&lt;/b&gt;&lt;br /&gt;&lt;b&gt;select * from&lt;/b&gt; &lt;i&gt;table2&lt;/i&gt;&lt;br /&gt;This will combine all rows, columns of &lt;i&gt;table1&lt;/i&gt; and &lt;i&gt;table2&lt;/i&gt;.  &lt;br /&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt;&lt;a href="" name="SECTION00006000000000000000"&gt;Querying Multiple Tables&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;If you want to retrieve information from different tables, you can do this by issuing different queries or a single JOIN query.  In a JOIN query, you list the names of the tables you are querying in the &lt;b&gt;from&lt;/b&gt; clause and the names of the linking columns in the &lt;b&gt;where&lt;/b&gt; clause. The omission of the linking &lt;b&gt;where&lt;/b&gt; clause causes a cartesian product of both tables. A JOIN combines rows from two or more tables where columns which the tables have in common match. If a column name is not unique, you must use a prefix to make clear which column from which table you want to select (e.g. &lt;i&gt;tablename.columnname&lt;/i&gt;). &lt;br /&gt;&lt;h3&gt;&lt;a href="" name="SECTION00006100000000000000"&gt;Simple Join&lt;/a&gt;&lt;/h3&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;col1,tab1.col2,col3&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;tab1,tab2&lt;/i&gt;&lt;br /&gt;&lt;b&gt;where&lt;/b&gt; &lt;i&gt;tab1.col2=tab2.col2&lt;/i&gt;&lt;br /&gt;This is the most common type of join. It returns rows from two tables based on an equality condition, therefore it is also called an &lt;b&gt;equi-join&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;&lt;a href="" name="SECTION00006200000000000000"&gt;Non-Equi Join&lt;/a&gt;&lt;/h3&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;tab1.col1,tab2.col2&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;tab1,tab2&lt;/i&gt;&lt;br /&gt;&lt;b&gt;where&lt;/b&gt; &lt;i&gt;tab1.col1&lt;/i&gt; &lt;b&gt;between&lt;/b&gt; &lt;i&gt;lowval&lt;/i&gt; &lt;b&gt;and&lt;/b&gt; &lt;i&gt;highval&lt;/i&gt;&lt;br /&gt;Since this join doesn't return rows based on a equality condition, it is called a non-equi join.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;&lt;a href="" name="SECTION00006300000000000000"&gt;Self Join&lt;/a&gt;&lt;/h3&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;alias1.col1,alias2.col1 "Header 2"&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;tabname alias1,tabname alias2&lt;/i&gt;&lt;br /&gt;&lt;b&gt;where&lt;/b&gt; &lt;i&gt;alias1.col2=alias2.col3&lt;/i&gt;&lt;br /&gt;In this example the table &lt;i&gt;tabname&lt;/i&gt; is joined with itself. Using of two different alias names for the same table allows you to refer to it twice. Since the names of the resulting columns in this example are the same, the second column gets a new header.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;&lt;a href="" name="SECTION00006400000000000000"&gt;Outer Join&lt;/a&gt;&lt;/h3&gt;&lt;b&gt;select&lt;/b&gt; &lt;i&gt;col1,col2&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;tab1,tab2&lt;/i&gt;&lt;br /&gt;&lt;b&gt;where&lt;/b&gt; &lt;i&gt;tab1.col1=tab2.col2&lt;/i&gt;&lt;b&gt;(+)&lt;/b&gt;&lt;br /&gt;Suppose you want to retrieve information from two tables where not all rows match but the result should contain all values from one or more columns. A simple join will select only matching rows whereas the outer join extends the result. All matching rows will be selected and when you append the outer join operator (+) to a column name, those rows which do not match will also be selected. In the example the number of rows which are selected is the number of rows in table &lt;i&gt;tab2&lt;/i&gt;.  If rows match, the outer join works as a simple join, if not, the values from &lt;i&gt;tab2.col2&lt;/i&gt; and a NULL value for the non existing value of &lt;i&gt;tab1.col1&lt;/i&gt; will be selected. &lt;br /&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt;&lt;a href="" name="SECTION00007000000000000000"&gt;Data Definition Language DDL&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;DDL commands allow you to create, alter and delete objects (e.g tables, views) and also to grant and revoke privileges.&lt;br /&gt;&lt;b&gt;create table&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt; (&lt;i&gt;col1 type1,col2 type2,...&lt;/i&gt;)       creates table &lt;i&gt;tabname&lt;/i&gt;&lt;br /&gt;&lt;i&gt;col1 ... coln&lt;/i&gt; are the column names, &lt;i&gt;type1,type2..&lt;/i&gt; specifies the  datatype of a column which can be  number, date, char, varchar.&lt;br /&gt;&lt;i&gt;number&lt;/i&gt;(&lt;i&gt;p,s&lt;/i&gt;) specifies a fixed point number having precision &lt;i&gt;p &lt;/i&gt; (total number of digits)  and scale &lt;i&gt;s&lt;/i&gt; (number of digits to the right of the decimal point).&lt;br /&gt;&lt;i&gt;number&lt;/i&gt;(&lt;i&gt;p&lt;/i&gt;) specifies a fixed point number.&lt;br /&gt;&lt;i&gt;number&lt;/i&gt; specifies a floating point number.&lt;br /&gt;&lt;i&gt;char&lt;/i&gt;(&lt;i&gt;size&lt;/i&gt;) specifies fixed length (max 255) character data of   length &lt;i&gt;size&lt;/i&gt;.&lt;br /&gt;&lt;i&gt;varchar2&lt;/i&gt;(&lt;i&gt;size&lt;/i&gt;) specifies variable length (max 2000) character  string having a maximum length of &lt;i&gt;size&lt;/i&gt; bytes.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;create table&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt; &lt;b&gt;as&lt;/b&gt; &lt;i&gt;subquery&lt;/i&gt;     creates table  &lt;i&gt;tabname&lt;/i&gt;&lt;br /&gt;&lt;i&gt;subquery&lt;/i&gt; inserts rows into the table upon its creation. A subquery is a  form of the select command which enables   you to select columns from an existing table.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;create view&lt;/b&gt; &lt;i&gt;viewname&lt;/i&gt; &lt;b&gt;as&lt;/b&gt; &lt;i&gt;subquery&lt;/i&gt;     creates view  &lt;i&gt;viewname&lt;/i&gt;&lt;br /&gt;A view is a logical table based on one or more tables.&lt;br /&gt;&lt;br /&gt;&lt;table cols="2"&gt;&lt;col align="left"&gt;&lt;/col&gt;&lt;col align="left"&gt;&lt;/col&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;drop table&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;removes table &lt;i&gt;tabname&lt;/i&gt; from the database&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;alter table&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt; &lt;b&gt;add&lt;/b&gt; (&lt;i&gt;col1 type1,col2 type2,...&lt;/i&gt;)&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;adds columns to table &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;alter table&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt; &lt;b&gt;modify&lt;/b&gt; (&lt;i&gt;col1 type1,col2 type2,...&lt;/i&gt;)&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;modifies column definitions&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;rename&lt;/b&gt; &lt;i&gt;oldname&lt;/i&gt; &lt;b&gt;to&lt;/b&gt; &lt;i&gt;newname&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;renames table &lt;i&gt;oldname&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;alter user&lt;/b&gt; &lt;i&gt;user&lt;/i&gt; &lt;b&gt;identified by &lt;/b&gt; &lt;i&gt;newpassword&lt;/i&gt;;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;enables &lt;i&gt; user&lt;/i&gt; to change the password&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;to &lt;i&gt;newpassword&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;grant&lt;/b&gt; &lt;i&gt;privilege&lt;/i&gt; &lt;b&gt;on&lt;/b&gt; &lt;i&gt;object&lt;/i&gt; &lt;b&gt;to&lt;/b&gt; &lt;i&gt;user&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;grants a  &lt;i&gt;privilege&lt;/i&gt; to &lt;i&gt;user&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;revoke&lt;/b&gt; &lt;i&gt;privilege&lt;/i&gt; &lt;b&gt;on&lt;/b&gt; &lt;i&gt;object&lt;/i&gt; &lt;b&gt;from &lt;/b&gt; &lt;i&gt;user&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;revokes a &lt;i&gt;privilege&lt;/i&gt; from &lt;i&gt;user&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt;&lt;a href="" name="SECTION00008000000000000000"&gt;Data Manipulation Language DML&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;DML commands manipulate and query data in existing tables. These commands do not  commit current actions. &lt;br /&gt;&lt;table cols="2"&gt;&lt;col align="left"&gt;&lt;/col&gt;&lt;col align="left"&gt;&lt;/col&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;insert into&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt; (&lt;i&gt;col1,col2...&lt;/i&gt;) &lt;b&gt;values&lt;/b&gt; (&lt;i&gt;val1,val 2...&lt;/i&gt;)&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;inserts rows into table &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;insert into&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt; &lt;i&gt;subquery&lt;/i&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;inserts rows(selected by a  subquery) into &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&amp;amp;table &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;update&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt; &lt;b&gt;set&lt;/b&gt; &lt;i&gt;col1=expr1,col2=expr2...&lt;/i&gt; &lt;b&gt;where&lt;/b&gt; &lt;i&gt;cond&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;updates rows in table &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;columns are set to values of expressions if &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;condition &lt;i&gt;cond&lt;/i&gt; is true&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;update&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt; &lt;b&gt;set&lt;/b&gt; (&lt;i&gt;col1,col2...&lt;/i&gt;)=(&lt;i&gt;subquery&lt;/i&gt;) &lt;b&gt; where&lt;/b&gt; &lt;i&gt;cond&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;updates rows in table &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;columns are set to selected values if &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;condition &lt;i&gt;cond&lt;/i&gt; is true&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;delete from&lt;/b&gt; &lt;i&gt;tabname&lt;/i&gt; [&lt;b&gt;where&lt;/b&gt; &lt;i&gt;cond&lt;/i&gt;]&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;either deletes all  rows from table &lt;i&gt;tabname&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;or rows where &lt;i&gt;cond&lt;/i&gt; is true&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt; Schema&lt;/span&gt;&lt;/h2&gt;When you select data from a table or you insert data into a table then this object has to be in your own schema. In other words, you must be the owner.&lt;br /&gt;If you are not the owner of the object, but the owner granted some privileges to you, you have to specify &lt;b&gt; schema.tabname&lt;/b&gt;.&lt;br /&gt;Example&lt;br /&gt;&lt;b&gt;select * from scott.emp&lt;/b&gt; &lt;br /&gt;&lt;h2&gt;&lt;span style="font-size: 130%;"&gt;&lt;a href="" name="SECTION00009000000000000000"&gt;Transaction Control Commands&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;Transaction Control Commands manage changes made by Data Manipulation Language  commands. A transaction (or logical unit of work) is a sequence of SQL statements  that ORACLE treats as a single unit. A transaction ends with a commit, rollback , exit, or any DDL statement which issues an implicit commit. In most cases  transactions are implicitly controlled. &lt;br /&gt;&lt;table cols="2"&gt;&lt;col align="left"&gt;&lt;/col&gt;&lt;col align="left"&gt;&lt;/col&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;commit&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;makes all changes since the beginning of a transaction permanent  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;rollback&lt;/b&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;rolls back (undoes) all changes since the beginning of a  transaction &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;rollback to savepoint&lt;/b&gt; &lt;i&gt;savep&lt;/i&gt; &lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;rolls back to savepoint &lt;i&gt;savep&lt;/i&gt; &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;&lt;b&gt;savepoint&lt;/b&gt; &lt;i&gt;savep&lt;/i&gt;&lt;/td&gt;&lt;td align="left" nowrap="nowrap" valign="baseline"&gt;defines savepoint &lt;i&gt;savep&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;&lt;a href="http://expsharing.blogspot.com/2008/05/user-objects-and-resources.html"&gt;&lt;span style="font-size: 100%;"&gt;user objects, user resources&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-5259171187568148417?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://expsharing.blogspot.com/2008/05/basic-introduction-to-sqlplus.html' title='Basic Introduction to SQLPLUS'/><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/5259171187568148417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=5259171187568148417' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5259171187568148417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5259171187568148417'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/05/basic-introduction-to-sqlplus.html' title='Basic Introduction to SQLPLUS'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-5852880884199892466</id><published>2008-05-12T03:48:00.000-07:00</published><updated>2008-11-24T01:40:52.483-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>SQL with Oracle</title><content type='html'>A very useful resource when counter with Oracle.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL (Structured Query Language) is the structured query language used to manipulate relational databases. The concept of relational database was first proposed by Codd in 1970, and a language to extract and manipulate the data in it was developed theoretically during the following years. All SQL statements are instructions to the database. SQL is a non-procedural language, which means that commands are not executed step by step according to how they were written, but they are retained in memory, read through and executed in the most effective way. In relational database terminology, SQL provides 'automatic navigation' to the data in the database.&lt;br /&gt;In these notes, you see an indication of two possible interfaces to SQL, namely sqlplus and activeSQL. Sqlplus is the standard Oracle interface while activeSQL is an experimental interface which Napier students have access to. For our tutorials we will all be using activeSQL. &lt;br /&gt;&lt;h2&gt;Command Endings&lt;/h2&gt;Note that all SQL commands typed into sqlplus MUST end in a ; (semicolon) character. It will not work without it. The activeSQL interface is more forgiving, but even then if you enter more than 1 command into the interface at a time you MUST separate the commands with a semicolon.&lt;br /&gt;When entering SQL, you can have as many space characters and return characters as you like. They are completely ignored by Oracle. Sqlplus will, when you hit return, tell you what line you are currently on. These numbers are not part of the command so do not let them confuse you. In sqlplus, if you hit return twice (return on a blank line) the current command is cancelled.&lt;br /&gt;In activeSQL, no command is executed until you hit the submit button.&lt;br /&gt;&lt;h2&gt;SELECT&lt;/h2&gt;SQL command SELECT is used to retrieve information from a table. SELECT informs Oracle which table(s) to use and which column(s) and row(s) to retrieve.&lt;br /&gt;The asterisk can be used to denote all fields.&lt;br /&gt;To list all fields and all records from the table &lt;b&gt;employee&lt;/b&gt;.&lt;br /&gt;&lt;pre&gt;SELECT *&lt;br /&gt;FROM employee&lt;br /&gt;;&lt;br /&gt;&lt;/pre&gt;To display only the fields empno and depno but all records&lt;br /&gt;&lt;pre&gt;SELECT empno,depno&lt;br /&gt;FROM employee;&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a href="" id="_myauto2" name="_myauto2"&gt;SPECIAL TABLE&lt;/a&gt;&lt;/h2&gt;There is a special table called CAT, which contains the name and type of all tables in your namespace. Running&lt;br /&gt;&lt;pre&gt;SELECT * from CAT:&lt;br /&gt;&lt;/pre&gt;produces the name and type of all local tables. This includes the 5 tables used in these tutorials: employee, empcourse, jobhistory, course, and department.&lt;br /&gt;To find out about a particular table, you can look at the commands which created it, or you can use the DESCRIBE command. This tells you the attributes of the table in question. In sqlplus, this description does not include the Foreign Keys (the links to other tables - more of this in tutorial 2) but in activeSQL Foreign Keys ARE shown. For instance:&lt;br /&gt;&lt;pre&gt;DESCRIBE employee;&lt;br /&gt;&lt;br /&gt;empno               integer        primary key&lt;br /&gt;surname             varchar(15)&lt;br /&gt;forenames           varchar(30)&lt;br /&gt;dob                 date&lt;br /&gt;address             varchar(50)&lt;br /&gt;telno               varchar(20)&lt;br /&gt;depno               integer        references department(depno)&lt;br /&gt;&lt;/pre&gt;varchar(20) indicates a string which can be up to 20 characters long.&lt;br /&gt;Date indicates that field is an Oracle date.&lt;br /&gt;Integer indicates that that attribute is a number.&lt;br /&gt;Depno integer References department(depno) tells us that depno in employee is a link to the department table's depno attribute. In this confusing case there are two attributes called depno, one in employee and one in department. These attributes are different attributes in different tables. &lt;br /&gt;&lt;h2&gt;&lt;a href="" id="_myauto3" name="_myauto3"&gt;Predicates&lt;/a&gt;&lt;/h2&gt;Search conditions are made up of predicates. These are then combined together with ANDs, ORs, and NOTs. &lt;br /&gt;There are seven types of predicate: &lt;br /&gt;&lt;ul&gt;&lt;li&gt; comparison&lt;/li&gt;&lt;li&gt; BETWEEN predicate&lt;/li&gt;&lt;li&gt; IN predicate&lt;/li&gt;&lt;li&gt; LIKE predicate&lt;/li&gt;&lt;li&gt; ANY or ALL predicate&lt;/li&gt;&lt;li&gt; EXISTS predicate&lt;/li&gt;&lt;li&gt; IS NULL&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;a href="" id="_myauto4" name="_myauto4"&gt;Comparisons&lt;/a&gt;&lt;/h2&gt;The comparisons available are &lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;=&lt;/td&gt;&lt;td&gt;equal to&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;!=  &lt;/td&gt;&lt;td&gt;not equal to&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&amp;gt; &lt;/td&gt;&lt;td&gt;greater than&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&amp;gt;=    &lt;/td&gt;&lt;td&gt;greater than or equal to&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&amp;lt;     &lt;/td&gt;&lt;td&gt;less than&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&amp;lt;=    &lt;/td&gt;&lt;td&gt;less than or equal to&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;List the fields empno, surname, telno of all employees who have a surname Wright. Notice the quote marks required for character constants. Note also that anything within the quotes is case sensitive. &lt;br /&gt;&lt;pre&gt;SELECT empno, surname, telno&lt;br /&gt;FROM employee&lt;br /&gt;WHERE surname = 'Wright'&lt;br /&gt;&lt;/pre&gt;List all current salaries in the range £20000 to £30000, listing their empno values. &lt;br /&gt;&lt;pre&gt;SELECT empno, enddate, salary&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE enddate IS NULL&lt;br /&gt;AND salary &amp;gt;= 20000&lt;br /&gt;AND salary &amp;lt;= 30000&lt;br /&gt;&lt;/pre&gt;List all the employees working in the company on January 1st 1980 and their position &lt;br /&gt;&lt;pre&gt;SELECT empno, position, startdate, enddate&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE (startdate &amp;lt; '01-JAN-1980' AND enddate &amp;gt; '01-JAN-1980')&lt;br /&gt;OR (startdate &amp;lt; '01-JAN-1980' AND enddate IS NULL)&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a href="" id="_myauto5" name="_myauto5"&gt;BETWEEN   (Inclusive)&lt;/a&gt;&lt;/h2&gt;List all the courses which occurred during 1988 &lt;br /&gt;&lt;pre&gt;SELECT *&lt;br /&gt;FROM course&lt;br /&gt;WHERE cdate BETWEEN '01-JAN-1988' AND '31-DEC-1988'&lt;br /&gt;&lt;/pre&gt;List all the courses which did not occur in 1988 &lt;br /&gt;&lt;pre&gt;SELECT *&lt;br /&gt;FROM course&lt;br /&gt;WHERE cdate NOT BETWEEN '01-JAN-1988' AND '31-DEC -1988'&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a href="" id="_myauto6" name="_myauto6"&gt;LIKE&lt;/a&gt;&lt;/h2&gt;The LIKE predicate provides the only pattern matching capability in SQL for the character data types. It takes the following form &lt;br /&gt;&lt;pre&gt;columnname [NOT] LIKE pattern-to-match&lt;br /&gt;&lt;/pre&gt;The pattern match characters are the percent sign (%) to denote 0 or more arbitrary characters, and the underscore (_) to denote exactly one arbitrary character. &lt;br /&gt;List the employee numbers and surnames of all employees who have a surname beginning with C. &lt;br /&gt;&lt;pre&gt;SELECT empno,surname&lt;br /&gt;FROM employee&lt;br /&gt;WHERE surname LIKE 'C%'&lt;br /&gt;&lt;/pre&gt;List all course numbers and names for any course to do with accounting. &lt;br /&gt;&lt;pre&gt;SELECT courseno,cname&lt;br /&gt;FROM course&lt;br /&gt;WHERE cname LIKE '%ccount%'&lt;br /&gt;&lt;/pre&gt;List all employees who have r as the second letter of their forename. &lt;br /&gt;&lt;pre&gt;SELECT surname, forenames&lt;br /&gt;FROM employee&lt;br /&gt;WHERE forenames LIKE '_r%'&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a href="" id="_myauto7" name="_myauto7"&gt;IS NULL&lt;/a&gt;&lt;/h2&gt;List all employees numbers and their current position &lt;br /&gt;&lt;pre&gt;SELECT empno,position&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE enddate IS NULL&lt;br /&gt;&lt;/pre&gt;The remaining predicates will be dealt with at a later stage. &lt;br /&gt;&lt;h2&gt;&lt;a href="" id="_myauto8" name="_myauto8"&gt;Set Functions&lt;/a&gt;&lt;/h2&gt;A set function is a function that operates on an entire column of values, not just a single value. &lt;br /&gt;List the total wage bill for the company at the moment. &lt;br /&gt;&lt;pre&gt;SELECT SUM(salary)&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE enddate IS NULL&lt;br /&gt;&lt;/pre&gt;This will retrieve the total salary for employees, where the enddate is empty or NULL. &lt;br /&gt;The following are the set functions supported &lt;br /&gt;Table 1: Set Functions &lt;br /&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Name &lt;/td&gt;&lt;td&gt;Description&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;COUNT &lt;/td&gt;&lt;td&gt;Count of occurrences&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;SUM &lt;/td&gt;&lt;td&gt;Summation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;AVG &lt;/td&gt;&lt;td&gt;Average (Sum/Count)  &lt;/td&gt;&lt;td&gt;zero if Count = zero&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MAX &lt;/td&gt;&lt;td&gt;Maximum value&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MIN &lt;/td&gt;&lt;td&gt;Minimum value&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Find the number of employees working currently. &lt;br /&gt;&lt;pre&gt;SELECT COUNT(*)&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE enddate IS NULL&lt;br /&gt;&lt;/pre&gt;The COUNT(*) function is used to count rows in a table, and is the exception to the following rule. &lt;br /&gt;NULL values are ignored by the set functions. &lt;br /&gt;Count how many jobs that employee number 25 has had previously. &lt;br /&gt;&lt;pre&gt;SELECT COUNT(enddate)&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE empno = 25&lt;br /&gt;&lt;/pre&gt;Count how many jobs employee number 25 has had, including current job. &lt;br /&gt;&lt;pre&gt;SELECT COUNT(startdate)&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE empno = 25&lt;br /&gt;&lt;/pre&gt;Calculate the average salary for all employees. &lt;br /&gt;&lt;pre&gt;SELECT AVG(salary)&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE enddate IS NULL&lt;br /&gt;&lt;/pre&gt;Note that a 'column label' might be usefully added. This will be output in uppercase format unless enclosed in double quotes as follows :-- &lt;br /&gt;Find out the greatest salary. &lt;br /&gt;&lt;pre&gt;SELECT MAX(salary)    "Highest Salary"&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE enddate IS NULL&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a href="" id="_myauto9" name="_myauto9"&gt;Ordering rows of a query result&lt;/a&gt;&lt;/h2&gt;The order in which the selected rows are displayed is changed by adding an ORDER BY clause to the end of your SELECT command. The ordering is done numerically or alphabetically and can be ascending or descending. &lt;br /&gt;List all the employee numbers and salaries, ordered by their salary. &lt;br /&gt;&lt;pre&gt;SELECT empno, salary&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE enddate IS NULL&lt;br /&gt;ORDER BY salary&lt;br /&gt;&lt;/pre&gt;To order by descending order you need to add DESC in the ORDER BY command &lt;br /&gt;&lt;pre&gt;SELECT empno, salary&lt;br /&gt;FROM jobhistory&lt;br /&gt;WHERE enddate IS NULL&lt;br /&gt;ORDER BY salary DESC&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a href="" id="_myauto10" name="_myauto10"&gt;Prevention of duplicate rows&lt;/a&gt;&lt;/h2&gt;If you print all the jobs in the jobhistory table you will get duplicate rows. &lt;br /&gt;&lt;pre&gt;SELECT position&lt;br /&gt;FROM jobhistory&lt;br /&gt;&lt;/pre&gt;To print out only one for each different job you need to add DISTINCT in the SELECT clause. &lt;br /&gt;&lt;pre&gt;SELECT DISTINCT position&lt;br /&gt;FROM jobhistory&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a href="" id="_myauto11" name="_myauto11"&gt;Counting unique rows&lt;/a&gt;&lt;/h2&gt;Often you would like to count how many different rows exist in the result of a query. Doing: &lt;br /&gt;&lt;pre&gt;SELECT DISTINCT count(position)&lt;br /&gt;FROM jobhistory&lt;br /&gt;&lt;/pre&gt;result in an answer which is no different from the same query without the DISTINCT. This is caused by the fact that count() is done before DISTINCT, and therefore in this case DISTINCT does nothing. What is actually needed is a way of forcing DISTINCT to be done before the count. This can be achieved by doing: &lt;br /&gt;&lt;pre&gt;SELECT count(DISTINCT position)&lt;br /&gt;FROM jobhistory&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a href="" id="_myauto1" name="_myauto1"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-5852880884199892466?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/5852880884199892466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=5852880884199892466' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5852880884199892466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5852880884199892466'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/05/sql-with-oracle.html' title='SQL with Oracle'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-5222804120270310816</id><published>2008-05-01T23:55:00.000-07:00</published><updated>2008-05-02T00:53:56.509-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='COM interop'/><title type='text'>.NET assembly and COM interoperation</title><content type='html'>&lt;span style="font-size:100%;"&gt;Recently, I just learned how to make .NET assembly visible for COM interoperation. I found that there are several ways to complete this task; on my view, two steps is needed are :&lt;br /&gt;&lt;br /&gt;  - Signing an assembly with a strong name: we must have a key pair (I can also create a new keypair by using &lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;sn.exe&lt;/span&gt;&lt;span style="font-size:100%;"&gt; tool ), after that, sign the assembly by Assembly Linker&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt; al.exe&lt;/span&gt;&lt;span style="font-size:100%;"&gt; provided by .Net SDK or use the  &lt;a id="ctl00_rs1_mainContentContainer_ctl02" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl02',this);" href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblykeyfileattribute%28VS.71%29.aspx"&gt;AssemblyKeyFileAttribute&lt;/a&gt; or the &lt;a id="ctl00_rs1_mainContentContainer_ctl03" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl03',this);" href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblykeynameattribute%28VS.71%29.aspx"&gt;AssemblyKeyNameAttribute&lt;/a&gt; , open the file AssemblyInfo.cs in your project and look at the last, pls read the list of articles below for more info.&lt;br /&gt;&lt;/span&gt;&lt;span class="fullpost"  style="font-size:100%;"&gt;&lt;br /&gt;  - And customize the visible of .Net assembly:&lt;br /&gt;      At first, the .net assembly must match the qualify for COM interop. See this article to reach what's qualify : &lt;a href="http://www.blogger.com/Qualifying%20.NET%20Types%20for%20Interoperation"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Qualifying .NET Types for Interoperation.&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;         The assembly is OK, and ..in Visual Studio, I open my project ( class library ;) ) and I see there's a property named : "Register for COM interop", if check this, VS auto generates interface, implement in your classes and register your assembly; if success, a tlb ( type library ) is created in your project "bin" directory.&lt;br /&gt;     Or I can register manually by using the &lt;span style="font-weight: bold;"&gt;regasm.exe&lt;/span&gt; provided by .Net SDK.&lt;br /&gt;&lt;br /&gt;      The usually path ;)&lt;br /&gt;        sn.exe   C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin&lt;br /&gt;        al.exe    C:\WINDOWS\Microsoft.NET\Framework\&lt;span style="color: rgb(255, 0, 0);"&gt;(&lt;/span&gt;v1.1.4322&lt;span style="color: rgb(255, 0, 0);"&gt;) (choose .net version)&lt;/span&gt;&lt;br /&gt;         regasm.exe C:\WINDOWS\Microsoft.NET\Framework\&lt;span style="color: rgb(255, 0, 0);"&gt;(&lt;/span&gt;v1.1.4322&lt;span style="color: rgb(255, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Resources:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.simple-talk.com/dotnet/visual-studio/build-and-deploy-a-.net-com-assembly/"&gt;Build and Deploy a .NET COM Assembly by &lt;/a&gt;&lt;a id="ctl00_MainContent_lnkAuthor" href="http://www.simple-talk.com/author/phil-wilson/"&gt;Phil Wilson&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/xc31ft41%28vs.71%29.aspx"&gt;Signing an Assembly with a Strong Name .Net 1.1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/xc31ft41%28VS.80%29.aspx"&gt;Sign an Assembly with a Strong Name .Net 2.0&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://dn.codegear.com/article/32754"&gt;Using a .NET Assembly via COM by Jim McKeeth&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://blogs.gotdotnet.com/heaths/archive/2005/03/09/391358.aspx"&gt;Guidelines for COM Interoperability from .NET&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://support.microsoft.com/kb/817248"&gt;How to call a Visual Basic .NET or Visual Basic 2005 assembly from Visual Basic 6.0&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-5222804120270310816?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/5222804120270310816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=5222804120270310816' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5222804120270310816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/5222804120270310816'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/05/net-assembly-and-com-interoperation.html' title='.NET assembly and COM interoperation'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-109796523850681088</id><published>2008-04-11T02:57:00.000-07:00</published><updated>2008-07-15T19:31:13.469-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML and JavaScript'/><title type='text'>Debug javascript</title><content type='html'>To debug JavaScript on the client side, you need to do a few things:&lt;br /&gt;&lt;br /&gt;In case of you're using Internet Explorer, following this help and you also need a javascript develop environment to debugging.&lt;br /&gt;In case of you're using FireFox, there's also has javascript debugging add-in, check the link to download at the end of post.&lt;br /&gt;&lt;br /&gt;1. In Internet Explorer's Advanced Options, uncheck "Disable Script&lt;br /&gt;Debugging"&lt;br /&gt;2. If you want to insert a breakpoint in your JavaScript, add the following&lt;br /&gt;statement:&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;debugger;&lt;br /&gt;&lt;br /&gt;JavaScript errors that occur will always result in a prompt asking you if&lt;br /&gt;you want to open the debugger to debug the script.&lt;br /&gt;&lt;br /&gt;--&lt;br /&gt;Kevin Spencer&lt;br /&gt;Microsoft MVP-Net Developer&lt;br /&gt;--&lt;br /&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;a href="http://expsharing.blogspot.com/2007/09/firebugjavascript-debugger-css.html"&gt;Get Firefox's javascript debugger addin&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-5103459356337734"; /* expsharing - firefox referal in post */ google_ad_slot = "8311087037"; google_ad_width = 125; google_ad_height = 125; google_cpa_choice = ""; // on file //--&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-109796523850681088?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/109796523850681088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=109796523850681088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/109796523850681088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/109796523850681088'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/04/debug-javascript.html' title='Debug javascript'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-6941730883231407728</id><published>2008-04-08T01:24:00.000-07:00</published><updated>2008-04-08T01:33:39.811-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='Web crawling'/><title type='text'>HttpWebRequest : Expect: 100-continue Header Problem</title><content type='html'>I used the HttpWebRequest to POST request using HTTP 1.1, i received the following HTTP header "Expect: 100-Continue". After few time to play with google, i found a treasure article at  &lt;a href="http://haacked.com/articles/AboutHaacked.aspx" title="About Me"&gt;Phil Haack&lt;/a&gt; site.&lt;br /&gt;&lt;br /&gt;Here is solution :&lt;br /&gt;&lt;code&gt;System.Net.ServicePointManager&lt;/code&gt; class has a static property named &lt;code&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.net.servicepoint.expect100continue.aspx"&gt;Expect100Continue&lt;/a&gt;&lt;/code&gt;.  Setting this to false will stop the header "Expect: 100-Continue" from being sent.&lt;br /&gt;&lt;br /&gt;You may see code snippet below about how to implement it.&lt;span class="fullpost"&gt;&lt;pre&gt;// create web request&lt;br /&gt;HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create("http://something");&lt;br /&gt;webRequest.Method = "POST";&lt;br /&gt;webRequest.ServicePoint.Expect100Continue = false;&lt;br /&gt;&lt;br /&gt;// post data&lt;br /&gt;requestStream = webRequest.GetRequestStream();&lt;br /&gt;StreamWriter requestWriter = new StreamWriter(requestStream);&lt;br /&gt;requestWriter.Write(dataToPost);&lt;br /&gt;requestWriter.Close();&lt;br /&gt;&lt;br /&gt;//wait for server response&lt;br /&gt;HttpWebResponse response = (HttpWebResponse) webRequest.GetResponse();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-6941730883231407728?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/6941730883231407728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=6941730883231407728' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6941730883231407728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/6941730883231407728'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/04/httpwebrequest-expect-100-continue.html' title='HttpWebRequest : Expect: 100-continue Header Problem'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-1214772615703823933</id><published>2008-04-07T23:46:00.000-07:00</published><updated>2008-04-08T00:16:52.943-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><title type='text'>Hide/Show Console window in .Net 1.1 Console application</title><content type='html'>In my previous post about &lt;a href="http://expsharing.blogspot.com/2008/03/hideshow-console-window-in-net-black.html"&gt;how to hide console window in .Net 2.0&lt;/a&gt; and higher Console application, some questions was how to do this in .Net 1.1 because in .net 1.1 there's not had the Console.Title property.&lt;br /&gt;The way to do is the same, and we need revise some code with the FindWindow function to get the handle of console window. When we get it's handle, it's mean we can hide/show it.&lt;br /&gt;&lt;br /&gt;please check the revised code below:&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class MyClass&lt;br /&gt;{&lt;br /&gt;[DllImport("user32.dll")]&lt;br /&gt;public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);&lt;br /&gt;[DllImport("user32.dll")]&lt;br /&gt;static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);&lt;br /&gt;&lt;br /&gt;[STAThread]&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{ &lt;br /&gt;  if (args.Length == 0)&lt;br /&gt;  {&lt;br /&gt;// Hide console&lt;br /&gt;HideConsole();&lt;br /&gt;// Display manage UI&lt;br /&gt;Application.Run(new mainForm());&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;static void HideConsole()&lt;br /&gt;{&lt;br /&gt;System.Diagnostics.Process p =     System.Diagnostics.Process.GetCurrentProcess();  &lt;br /&gt;IntPtr hWnd = FindWindow(null, p.MainWindowTitle);&lt;br /&gt;if(hWnd != IntPtr.Zero)&lt;br /&gt;{&lt;br /&gt;ShowWindow(hWnd, 0); // 0 = SW_HIDE&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;static void ShowConsole()&lt;br /&gt;{&lt;br /&gt;System.Diagnostics.Process p = System.Diagnostics.Process.GetCurrentProcess();  &lt;br /&gt;IntPtr hWnd = FindWindow(null, p.MainWindowTitle);&lt;br /&gt;if (hWnd != IntPtr.Zero)&lt;br /&gt;{&lt;br /&gt;ShowWindow(hWnd, 1); //1 = SW_SHOWNORMA&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you have other better ways to hide/show console, i'm very happy and glad to read your comments.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-1214772615703823933?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/1214772615703823933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=1214772615703823933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1214772615703823933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1214772615703823933'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/04/in-my-previous-post-about-how-to-hide.html' title='Hide/Show Console window in .Net 1.1 Console application'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-4660742469135116232</id><published>2008-04-07T19:23:00.000-07:00</published><updated>2008-04-07T19:33:16.452-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows issues'/><category scheme='http://www.blogger.com/atom/ns#' term='window OS'/><title type='text'>NTLDR is Missing</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Issue:&lt;/span&gt;              &lt;p&gt;NTLDR is Missing.&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;Related errors:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;             &lt;p class="tab"&gt;Below are the full error messages that may be seen when the              computer is booting.&lt;/p&gt;    &lt;p class="tab"&gt;NTLDR is Missing&lt;br /&gt;Press any key to restart&lt;/p&gt;    &lt;p class="tab"&gt;Boot: Couldn't find NTLDR&lt;br /&gt;Please insert another disk&lt;/p&gt;    &lt;p class="tab"&gt;NTLDR is missing&lt;br /&gt;Press Ctrl Alt Del to Restart&lt;/p&gt;            &lt;h2&gt;&lt;span style="font-size:100%;"&gt;Cause:&lt;/span&gt;&lt;/h2&gt;&lt;blockquote&gt;     &lt;ol&gt;&lt;li&gt;Computer is booting from a                 non-bootable source.&lt;/li&gt;&lt;li&gt;Computer hard disk drive is not                 properly setup in BIOS.&lt;/li&gt;&lt;li&gt;Corrupt NTLDR and/or                 NTDETECT.COM file.&lt;/li&gt;&lt;li&gt;Misconfiguration with the                 boot.ini file.&lt;/li&gt;&lt;li&gt;Attempting to upgrade from a Windows 95, 98, or ME computer                 that is using &lt;a href="http://www.computerhope.com/fat32.htm"&gt;FAT32&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;New hard disk drive being added.&lt;/li&gt;&lt;li&gt;Corrupt boot sector / master                 boot record.&lt;/li&gt;&lt;li&gt;Seriously corrupted version of                 Windows 2000 or Windows XP.&lt;/li&gt;&lt;li&gt;Loose or Faulty IDE/EIDE hard                 disk drive cable.&lt;/li&gt;&lt;/ol&gt;    &lt;/blockquote&gt;            &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;Solutions:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;           &lt;h3 style="font-weight: bold; color: rgb(255, 102, 102);"&gt;&lt;span style="font-size:100%;"&gt;Computer is booting from a non-bootable             source&lt;/span&gt;&lt;/h3&gt;             &lt;p class="tab"&gt;Many times this error is caused when the computer is attempting               to boot from a non-bootable floppy disk or     &lt;a href="http://www.computerhope.com/jargon/c/cdrom.htm"&gt;CD-ROM&lt;/a&gt;.               First verify that no &lt;a href="http://www.computerhope.com/jargon/f/floppydi.htm"&gt;floppy diskette&lt;/a&gt; is in the computer, unless               you are attempting to boot from a diskette.&lt;/p&gt;    &lt;p class="tab"&gt;If you are attempting to     &lt;a href="http://www.computerhope.com/jargon/b/boot.htm"&gt;boot&lt;/a&gt; from a floppy diskette and are               receiving this error message it is likely that the diskette does               not have all the necessary files and/or is corrupt.&lt;/p&gt;    &lt;p class="tab"&gt;If you are attempting to install Windows XP or Windows 2000 and               are receiving this error message as the computer is booting verify               that your computer &lt;a href="http://www.computerhope.com/jargon/b/bios.htm"&gt;BIOS&lt;/a&gt; has the               proper boot settings. For example, if you are attempting to run               the install from the CD-ROM make sure the CD-ROM is the first boot               device, and not the hard disk drive. &lt;/p&gt;    &lt;p class="tab"&gt;Second, when the computer is               booting you should receive the below prompt. &lt;/p&gt;    &lt;blockquote&gt;     &lt;p class="tab"&gt;Press any key to boot from the CD&lt;/p&gt;    &lt;/blockquote&gt;    &lt;p class="tab"&gt;&lt;b&gt;Important:&lt;/b&gt; When you see this message press                &lt;a href="http://www.computerhope.com/jargon/a/anykey.htm"&gt;any key&lt;/a&gt; such as the Enter key immediately,               otherwise it will try booting from the hard drive and likely get               the NTLDR error again.&lt;/p&gt;    &lt;p class="tab"&gt;&lt;b&gt;Note:&lt;/b&gt; If you are not receiving the above message and               your BIOS boot options are set properly it's also possible that               your CD-ROM drive may not be booting from the CD-ROM properly.               Verify the jumpers are set properly on the CD-ROM drive.               Additional information about checking the CD-ROM drive connections               can be found on &lt;a href="http://www.computerhope.com/issues/ch000213.htm"&gt;document CH000213&lt;/a&gt;. &lt;/p&gt;    &lt;p class="tab"&gt;&lt;b&gt;Additional information:&lt;/b&gt; This error has also been known               to occur when a memory stick is in a card reader and the computer               is attempting to boot from it. If you have any type of card reader               or flash reader make sure that no memory stick is inside the               computer.  &lt;/p&gt;             &lt;h3 style="color: rgb(255, 102, 102); font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;Computer hard disk drive is not properly             setup in BIOS&lt;/span&gt;&lt;/h3&gt;             &lt;p class="tab"&gt;Verify that your computer     &lt;a href="http://www.computerhope.com/jargon/h/harddriv.htm"&gt;hard disk drive&lt;/a&gt; is properly setup in               the &lt;a href="http://www.computerhope.com/jargon/b/bios.htm"&gt;BIOS&lt;/a&gt; /     &lt;a href="http://www.computerhope.com/jargon/c/cmos.htm"&gt;CMOS&lt;/a&gt; setup. Improper               settings can cause this error. Additional information on how to               enter the BIOS / CMOS setup can be found in &lt;a href="http://www.computerhope.com/issues/ch000192.htm"&gt;document CH000192&lt;/a&gt;. &lt;/p&gt;             &lt;h3 style="color: rgb(255, 102, 102);"&gt;&lt;span style="font-size:100%;"&gt;Corrupt NTLDR and/or NTDETECT.COM file&lt;/span&gt;&lt;/h3&gt;             &lt;p class="tab"&gt;&lt;a href="http://www.computerhope.com/issues/ch000465.htm#a"&gt;Windows 2000 users&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.computerhope.com/issues/ch000465.htm#b"&gt;Windows XP users&lt;/a&gt;&lt;/p&gt;    &lt;p class="tab"&gt;&lt;b&gt;&lt;a name="a"&gt;&lt;/a&gt;Windows 2000 users&lt;/b&gt;&lt;/p&gt;    &lt;p class="tab"&gt;If your computer is using Microsoft Windows 2000 and you are               encountering the NTLDR error. Create the below                &lt;a href="http://www.computerhope.com/issues/ch000492.htm"&gt;boot.ini&lt;/a&gt; file on               the floppy diskette drive.&lt;/p&gt;    &lt;p class="tab"&gt;[boot loader]&lt;br /&gt;timeout=30&lt;br /&gt;default=multi(0)disk(0)rdisk(0)partition(1)\WINNT&lt;br /&gt;[operating systems]&lt;br /&gt;multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows               2000 Professional" /fastdetect&lt;/p&gt;    &lt;p class="tab"&gt;Copy the NTLDR and NTDETECT.COM files from another computer               using the same &lt;a href="http://www.computerhope.com/jargon/o/os.htm"&gt;Operating System&lt;/a&gt;.               Both of these files are located in the     &lt;a href="http://www.computerhope.com/jargon/r/root.htm"&gt;root&lt;/a&gt;               directory of the primary hard disk drive. For example, C:\NTLDR and               C:\NTDETECT.COM should be the locations of these files on many               computers.&lt;/p&gt;    &lt;ul&gt;&lt;li&gt;     &lt;p class="tab"&gt;Please keep in mind that these files are hidden system                   files, if you need additional help with viewing hidden files                   in Windows please see &lt;a href="http://www.computerhope.com/issues/ch000516.htm"&gt;document CH000516&lt;/a&gt;.     &lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;    &lt;p class="tab"&gt;Once these files have been copied to a floppy diskette reboot               the computer and copy the NTLDR and NTDETECT.COM files to the root               directory of the primary hard disk drive. Below is an example of               what commonly should be performed from the A:\&gt; drive.&lt;/p&gt;    &lt;blockquote&gt;     &lt;p class="tab"&gt;copy ntldr c:&lt;br /&gt;copy ntdetect.com c:&lt;/p&gt;    &lt;/blockquote&gt;    &lt;p class="tab"&gt;After the above two files have been copied, remove the floppy               diskette and reboot the computer. &lt;/p&gt;             &lt;blockquote&gt;               &lt;p&gt;&lt;b&gt;&lt;a name="b"&gt;&lt;/a&gt;Windows XP users&lt;/b&gt;&lt;/p&gt;               &lt;ol&gt;&lt;li&gt;Insert the Windows XP bootable CD into the computer.&lt;/li&gt;&lt;li&gt;When prompted to press any key to boot from the CD, press                   any key.&lt;/li&gt;&lt;li&gt;Once in the Windows XP setup menu press the "R"                   key to repair Windows.&lt;/li&gt;&lt;li&gt;Log into your Windows installation by pressing the                   "1" key and pressing enter.&lt;/li&gt;&lt;li&gt;You will then be prompted for your administrator password,                   enter that password.&lt;/li&gt;&lt;li&gt;Copy the below two files to the &lt;a href="http://www.computerhope.com/jargon/r/root.htm"&gt;root&lt;/a&gt;                   directory of the primary hard disk. In the below example we                   are copying these files from the CD-ROM drive letter                   "E". This letter may be different on your computer.&lt;br /&gt;             &lt;br /&gt;                copy e:\i386\ntldr c:\&lt;br /&gt;                copy e:\i386\ntdetect.com c:\&lt;br /&gt;             &lt;br /&gt;              &lt;/li&gt;&lt;li&gt;Once both of these files have been successfully copied,                   remove the CD from the computer and reboot.&lt;/li&gt;&lt;/ol&gt;             &lt;/blockquote&gt;             &lt;h3 style="font-weight: bold; color: rgb(255, 102, 102);"&gt;&lt;span style="font-size:100%;"&gt;Misconfiguration with the boot.ini file&lt;/span&gt;&lt;/h3&gt;             &lt;p class="tab"&gt;Edit the boot.ini on the     &lt;a href="http://www.computerhope.com/jargon/r/root.htm"&gt;root&lt;/a&gt; directory of the hard disk drive               and verify that it is pointing to the correct location of your               Windows Operating System and that the partitions are properly               defined. Additional information about the boot.ini can be found on               &lt;a href="http://www.computerhope.com/issues/ch000492.htm"&gt;document CH000492&lt;/a&gt;.&lt;/p&gt;              &lt;h3&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(255, 102, 102);"&gt;Attempting to upgrade from a Windows              95, 98, or ME computer that is using FAT32&lt;/span&gt;&lt;/span&gt; &lt;/h3&gt;             &lt;p class="tab"&gt;If you are getting this error message while you are attempting              to upgrade to Windows 2000 or Windows XP from     &lt;a href="http://www.computerhope.com/win95.htm"&gt;Windows              95&lt;/a&gt;, &lt;a href="http://www.computerhope.com/win98.htm"&gt;Windows 98&lt;/a&gt;, or     &lt;a href="http://www.computerhope.com/winme.htm"&gt;Windows              ME&lt;/a&gt; running &lt;a href="http://www.computerhope.com/fat32.htm"&gt;FAT32&lt;/a&gt; please try the              below recommendations.                &lt;/p&gt;&lt;blockquote&gt;                &lt;ol&gt;&lt;li&gt;Boot the computer with a Windows 95, Windows 98 or Windows                   ME &lt;a href="http://www.computerhope.com/boot.htm"&gt;bootable diskette&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;At the A:\&gt; prompt type:&lt;br /&gt;              &lt;br /&gt;                 sys c: &lt;press&gt;&lt;br /&gt;              &lt;br /&gt;               &lt;/press&gt;&lt;/li&gt;&lt;li&gt;After pressing enter you should receive the "System Transferred"                   message. Once this has been completed remove the floppy                   diskette and reboot the computer.&lt;/li&gt;&lt;/ol&gt;             &lt;/blockquote&gt;             &lt;h3 style="color: rgb(255, 102, 102);"&gt;&lt;span style="font-size:100%;"&gt;New hard disk             drive being added&lt;/span&gt;&lt;/h3&gt;             &lt;p class="tab"&gt;If you are attempting to add a new               hard disk drive to the computer make sure that drive is a blank               drive. Adding a new hard disk drive to a computer that already has               Windows installed on it may cause the NTLDR error to occur.&lt;/p&gt;    &lt;p class="tab"&gt;If you are unsure if the new drive               is blank or not try booting from a &lt;a href="http://www.computerhope.com/boot.htm"&gt;bootable               diskette&lt;/a&gt; and format the new hard disk drive.&lt;/p&gt;             &lt;h3 style="color: rgb(255, 102, 102);"&gt;&lt;span style="font-size:100%;"&gt;Corrupt boot             sector / master boot record&lt;/span&gt;&lt;/h3&gt;             &lt;p class="tab"&gt;It's possible your computer's hard disk drive may have a corrupt               boot sector and/or master boot record. These can be repaired               through the Microsoft Windows Recovery console by running the &lt;b&gt;fixboot&lt;/b&gt;               and &lt;b&gt;fixmbr &lt;/b&gt;commands.&lt;/p&gt;    &lt;p class="tab"&gt;Additional information and help in getting into the Microsoft               Windows Recovery console can be found on &lt;a href="http://www.computerhope.com/issues/ch000627.htm"&gt;document               CH000627&lt;/a&gt;.&lt;/p&gt;             &lt;h3 style="color: rgb(255, 102, 102);"&gt;&lt;span style="font-size:100%;"&gt;Seriously             corrupted version of Windows 2000 or Windows XP&lt;/span&gt;&lt;/h3&gt;             &lt;p class="tab"&gt;If you have tried each of the               above recommendations that apply to your situation and you               continue to experience this issue it is possible you may have a               seriously corrupted version of Microsoft Windows. Therefore we               would recommend you reinstall Microsoft Windows 2000 and Windows               XP.&lt;/p&gt;    &lt;p class="tab"&gt;If you are encountering this issue               during your setup you may wish to completely erase your computer               hard disk drive and all of its existing data and then install               Microsoft Windows 2000 / Windows XP. Additional information               about erasing the computer and starting over can be found on     &lt;a href="http://www.computerhope.com/issues/ch000186.htm"&gt;document               CH000186&lt;/a&gt;.&lt;/p&gt;             &lt;h3 style="color: rgb(255, 102, 102);"&gt;&lt;span style="font-size:100%;"&gt;Loose or Faulty             IDE/EIDE hard disk drive cable&lt;/span&gt;&lt;/h3&gt;             &lt;p class="tab"&gt;This issue has been known to be caused by a loose or fault     &lt;a href="http://www.computerhope.com/jargon/i/ide.htm"&gt;IDE&lt;/a&gt;/EIDE cable. If the above recommendation does not resolve your               issue and your computer hard disk drive is using an     &lt;a href="http://www.computerhope.com/jargon/i/ide.htm"&gt;IDE&lt;/a&gt;               or &lt;a href="http://www.computerhope.com/jargon/e/eide.htm"&gt;EIDE&lt;/a&gt; interface. Verify the               computer hard disk drive cable is firmly connected by disconnected               and reconnecting the cable. &lt;/p&gt;    &lt;p class="tab"&gt;If the issue continues it is also a possibility that the               computer has a faulty cable, try replacing the hard disk drive               cable with another cable and/or a new cable. &lt;/p&gt;&lt;a href="http://www.computerhope.com/"&gt;http://www.computerhope.com&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-4660742469135116232?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/4660742469135116232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=4660742469135116232' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/4660742469135116232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/4660742469135116232'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/04/ntldr-is-missing.html' title='NTLDR is Missing'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-7638778143284241406</id><published>2008-03-30T23:11:00.000-07:00</published><updated>2008-03-30T23:15:48.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Whats I read'/><title type='text'>What Is Web 2.0? page5</title><content type='html'>&lt;div style="text-align: right;"&gt;&lt;span id="intelliTxt"&gt; by &lt;a href="http://www.oreillynet.com/pub/au/27"&gt;Tim O'Reilly&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span id="intelliTxt"&gt;&lt;/span&gt;&lt;span id="intelliTxt"&gt;&lt;h3&gt;7. Rich User Experiences&lt;/h3&gt;  &lt;p&gt;As early as Pei Wei's &lt;a href="http://www.viola.org/"&gt;Viola browser&lt;/a&gt; in 1992, the web was being used to deliver "applets" and other kinds of active content within the web browser. Java's introduction in 1995 was framed around the delivery of such applets. JavaScript and then DHTML were introduced as lightweight ways to provide client side programmability and richer user experiences. Several years ago, Macromedia coined the term "Rich Internet Applications" (which has also been picked up by open source Flash competitor Laszlo Systems) to highlight the capabilities of Flash to deliver not just multimedia content but also GUI-style application experiences.&lt;/p&gt;  &lt;p&gt;However, the potential of the web to deliver full scale applications didn't hit the mainstream till Google introduced Gmail, quickly followed by Google Maps, web based applications with rich user interfaces and PC-equivalent interactivity. The collection of technologies used by Google was &lt;a href="http://www.adaptivepath.com/publications/essays/archives/000385.php"&gt;christened AJAX&lt;/a&gt;, in a seminal essay by Jesse James Garrett of web design firm Adaptive Path. He wrote:&lt;/p&gt;  &lt;blockquote&gt; &lt;p&gt;"Ajax isn't a technology. It's really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.adaptivepath.com/publications/essays/archives/000266.php"&gt;standards-based presentation&lt;/a&gt; using XHTML and CSS;&lt;/li&gt;&lt;li&gt;dynamic display and interaction using the &lt;a href="http://www.scottandrew.com/weblog/articles/dom_1"&gt;Document Object Model&lt;/a&gt;;&lt;/li&gt;&lt;li&gt;data interchange and manipulation using &lt;a href="http://www-106.ibm.com/developerworks/xml/library/x-xslt/?article=xr"&gt;XML and XSLT&lt;/a&gt;;&lt;/li&gt;&lt;li&gt;asynchronous data retrieval using &lt;a href="http://www.xml.com/pub/a/2005/02/09/xml-http-request.html"&gt;XMLHttpRequest&lt;/a&gt;;&lt;/li&gt;&lt;li&gt;and &lt;a href="http://www.crockford.com/javascript/javascript.html"&gt;JavaScript&lt;/a&gt; binding everything together."&lt;/li&gt;&lt;/ul&gt; &lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;span id="intelliTxt"&gt;&lt;p&gt;AJAX is also a key component of Web 2.0 applications such as Flickr, now part of Yahoo!, 37signals' applications basecamp and backpack, as well as other Google applications such as Gmail and Orkut. We're entering an unprecedented period of user interface innovation, as web developers are finally able to build web applications as rich as local PC-based applications.&lt;/p&gt;  &lt;p&gt;Interestingly, many of the capabilities now being explored have been around for many years. In the late '90s, both Microsoft and Netscape had a vision of the kind of capabilities that are now finally being realized, but their battle over the standards to be used made cross-browser applications difficult. It was only when Microsoft definitively won the browser wars, and there was a single de-facto browser standard to write to, that this kind of application became possible. And while &lt;a href="http://www.oreillynet.com/pub/a/network/2005/09/26/what-is-firefox.html"&gt;Firefox&lt;/a&gt; has reintroduced competition to the browser market, at least so far we haven't seen the destructive competition over web standards that held back progress in the '90s.&lt;/p&gt;  &lt;p&gt;We expect to see many new web applications over the next few years, both truly novel applications, and rich web reimplementations of PC applications. Every platform change to date has also created opportunities for a leadership change in the dominant applications of the previous platform.&lt;/p&gt;  &lt;p&gt;Gmail has already provided &lt;a href="http://www.oreillynet.com/pub/wlg/4707"&gt;some interesting innovations in email&lt;/a&gt;, combining the strengths of the web (accessible from anywhere, deep database competencies, searchability) with user interfaces that approach PC interfaces in usability. Meanwhile, other mail clients on the PC platform are nibbling away at the problem from the other end, adding IM and presence capabilities. How far are we from an integrated communications client combining the best of email, IM, and the cell phone, using &lt;a href="http://www.oreillynet.com/pub/a/network/2005/09/02/what-is-voip.html"&gt;VoIP&lt;/a&gt; to add voice capabilities to the rich capabilities of web applications? The race is on.&lt;/p&gt;  &lt;p&gt;It's easy to see how Web 2.0 will also remake the address book. A Web 2.0-style address book would treat the local address book on the PC or phone merely as a cache of the contacts you've explicitly asked the system to remember. Meanwhile, a web-based synchronization agent, Gmail-style, would remember every message sent or received, every email address and every phone number used, and build social networking heuristics to decide which ones to offer up as alternatives when an answer wasn't found in the local cache. Lacking an answer there, the system would query the broader social network.&lt;/p&gt;  &lt;p&gt;A Web 2.0 word processor would support wiki-style collaborative editing, not just standalone documents. But it would also support the rich formatting we've come to expect in PC-based word processors. &lt;a href="http://www.writely.com/"&gt;Writely&lt;/a&gt; is a good example of such an application, although it hasn't yet gained wide traction.&lt;/p&gt;  &lt;p&gt;Nor will the Web 2.0 revolution be limited to PC applications. Salesforce.com demonstrates how the web can be used to deliver software as a service, in enterprise scale applications such as CRM.&lt;/p&gt;  &lt;p&gt;The competitive opportunity for new entrants is to fully embrace the potential of Web 2.0. Companies that succeed will create applications that learn from their users, using an architecture of participation to build a commanding advantage not just in the software interface, but in the richness of the shared data.&lt;/p&gt;  &lt;h3&gt;Core Competencies of Web 2.0 Companies&lt;/h3&gt;  &lt;p&gt;In exploring the seven principles above, we've highlighted some of the principal features of Web 2.0. Each of the examples we've explored demonstrates one or more of those key principles, but may miss others. Let's close, therefore, by summarizing what we believe to be the core competencies of Web 2.0 companies:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;Services, not packaged software, with cost-effective scalability&lt;/li&gt;&lt;li&gt;Control over unique, hard-to-recreate data sources that get richer as more people use them&lt;/li&gt;&lt;li&gt;Trusting users as co-developers&lt;/li&gt;&lt;li&gt;Harnessing collective intelligence&lt;/li&gt;&lt;li&gt;Leveraging the long tail through customer self-service&lt;/li&gt;&lt;li&gt;Software above the level of a single device&lt;/li&gt;&lt;li&gt;Lightweight user interfaces, development models, AND business models&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;The next time a company claims that it's "Web 2.0," test their features against the list above. The more points they score, the more they are worthy of the name. Remember, though, that excellence in one area may be more telling than some small steps in all seven.&lt;/p&gt;  &lt;p&gt;Tim O'Reilly&lt;br /&gt; O’Reilly Media, Inc., tim@oreilly.com&lt;br /&gt; President and CEO&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-7638778143284241406?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/7638778143284241406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=7638778143284241406' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7638778143284241406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7638778143284241406'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/03/what-is-web-20-page5.html' title='What Is Web 2.0? page5'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-2598533129715223994</id><published>2008-03-30T23:03:00.000-07:00</published><updated>2008-03-30T23:09:51.405-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Whats I read'/><title type='text'>What Is Web 2.0? page4</title><content type='html'>&lt;div style="text-align: right;"&gt;&lt;span id="intelliTxt"&gt; by &lt;a href="http://www.oreillynet.com/pub/au/27"&gt;Tim O'Reilly&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;4. End of the Software Release Cycle&lt;/h3&gt;  &lt;p&gt;As noted above in the discussion of Google vs. Netscape, one of the defining characteristics of internet era software is that it is delivered as a service, not as a product. This fact leads to a number of fundamental changes in the business model of such a company:&lt;/p&gt;  &lt;ol&gt;&lt;li&gt;&lt;em&gt;Operations must become a core competency&lt;/em&gt;. Google's or Yahoo!'s expertise in product development must be matched by an expertise in daily operations. So fundamental is the shift from software as artifact to software as service that &lt;em&gt;the software will cease to perform unless it is maintained on a daily basis&lt;/em&gt;. Google must continuously crawl the web and update its indices, continuously filter out link spam and other attempts to influence its results, continuously and dynamically respond to hundreds of millions of asynchronous user queries, simultaneously matching them with context-appropriate advertisements. &lt;p&gt;It's no accident that Google's system administration, networking, and load balancing techniques are perhaps even more closely guarded secrets than their search algorithms. Google's success at automating these processes is a key part of their cost advantage over competitors.&lt;/p&gt;  &lt;p&gt;It's also no accident that &lt;a href="http://tim.oreilly.com/opensource"&gt;scripting languages such as Perl, Python, PHP, and now Ruby, play such a large role&lt;/a&gt; at web 2.0 companies. Perl was famously described by Hassan Schroeder, Sun's first webmaster, as "the duct tape of the internet." Dynamic languages (often called scripting languages and looked down on by the software engineers of the era of software artifacts) are the tool of choice for system and network administrators, as well as application developers building dynamic systems that require constant change.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;ol&gt;&lt;li value="2"&gt;&lt;em&gt;Users must be treated as co-developers&lt;/em&gt;, in a reflection of open source development practices (even if the software in question is unlikely to be released under an open source license.) The open source dictum, "release early and release often" in fact has morphed into an even more radical position, "the perpetual beta," in which the product is developed in the open, with new features slipstreamed in on a monthly, weekly, or even daily basis. It's no accident that services such as Gmail, Google Maps, Flickr, del.icio.us, and the like may be expected to bear a "Beta" logo for years at a time. &lt;p&gt;Real time monitoring of user behavior to see just which new features are used, and how they are used, thus becomes another required core competency. A web developer at a major online service remarked: "We put up two or three new features on some part of the site every day, and if users don't adopt them, we take them down. If they like them, we roll them out to the entire site."&lt;/p&gt;  &lt;p&gt;Cal Henderson, the lead developer of Flickr, recently &lt;a href="http://blogs.warwick.ac.uk/chrismay/tag/flickr/"&gt;revealed that they deploy new builds up to every half hour&lt;/a&gt;. This is clearly a radically different development model! While not all web applications are developed in as extreme a style as Flickr, almost all web applications have a development cycle that is radically unlike anything from the PC or client-server era. It is for this reason that a recent ZDnet editorial &lt;a href="http://blogs.zdnet.com/SAAS/?p=13"&gt;concluded that Microsoft won't be able to beat Google&lt;/a&gt;: "Microsoft's business model depends on everyone upgrading their computing environment every two to three years. Google's depends on everyone exploring what's new in their computing environment every day."&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p&gt;While Microsoft has demonstrated enormous ability to learn from and ultimately best its competition, there's no question that this time, the competition will require Microsoft (and by extension, every other existing software company) to become a deeply different kind of company. Native Web 2.0 companies enjoy a natural advantage, as they don't have old patterns (and corresponding business models and revenue sources) to shed.&lt;/p&gt;  &lt;!-- sidebar begins --&gt; &lt;table align="right" border="0" cellpadding="4" cellspacing="8" width="250"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td bgcolor="#efefef" valign="top" width="250"&gt; &lt;h4&gt;A Web 2.0 Investment Thesis&lt;/h4&gt;  &lt;p&gt;Venture capitalist Paul Kedrosky &lt;a href="http://paul.kedrosky.com/archives/001622.html"&gt;writes&lt;/a&gt;: "The key is to find the actionable investments where you disagree with the consensus". It's interesting to see how each Web 2.0 facet involves disagreeing with the consensus: everyone was emphasizing keeping data private, Flickr/Napster/et al. make it public. It's not just disagreeing to be disagreeable (pet food! online!), it's disagreeing where you can build something out of the differences. Flickr builds communities, Napster built breadth of collection.&lt;/p&gt;  &lt;p&gt;Another way to look at it is that the successful companies all give up something expensive but considered critical to get something valuable for free that was once expensive. For example, Wikipedia gives up central editorial control in return for speed and breadth. Napster gave up on the idea of "the catalog" (all the songs the vendor was selling) and got breadth. Amazon gave up on the idea of having a physical storefront but got to serve the entire world. Google gave up on the big customers (initially) and got the 80% whose needs weren't being met. There's something very aikido (using your opponent's force against them) in saying "you know, you're right--absolutely anyone in the whole world CAN update this article. And guess what, that's bad news for you."&lt;/p&gt;  &lt;p&gt;--&lt;em&gt;Nat Torkington&lt;/em&gt;&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;!-- sidebar ends --&gt;  &lt;h3&gt;5. Lightweight Programming Models&lt;/h3&gt;  &lt;p&gt;Once the idea of web services became &lt;em&gt;au courant&lt;/em&gt;, large companies jumped into the fray with a complex web services stack designed to create highly reliable programming environments for distributed applications.&lt;/p&gt;  &lt;p&gt;But much as the web succeeded precisely because it overthrew much of hypertext theory, substituting a simple pragmatism for ideal design, RSS has become perhaps the single most widely deployed web service because of its simplicity, while the complex corporate web services stacks have yet to achieve wide deployment.&lt;/p&gt;  &lt;p&gt;Similarly, Amazon.com's web services are provided in two forms: one adhering to the formalisms of the SOAP (Simple Object Access Protocol) web services stack, the other simply providing XML data over HTTP, in a lightweight approach sometimes referred to as REST (Representational State Transfer). While high value B2B connections (like those between Amazon and retail partners like ToysRUs) use the SOAP stack, Amazon reports that 95% of the usage is of the lightweight REST service.&lt;/p&gt;  &lt;p&gt;This same quest for simplicity can be seen in other "organic" web services. Google's recent release of Google Maps is a case in point. Google Maps' simple AJAX (Javascript and XML) interface was quickly decrypted by hackers, who then proceeded to remix the data into new services.&lt;/p&gt;  &lt;p&gt;Mapping-related web services had been available for some time from GIS vendors such as ESRI as well as from MapQuest and Microsoft MapPoint. But Google Maps set the world on fire because of its simplicity. While experimenting with any of the formal vendor-supported web services required a formal contract between the parties, the way Google Maps was implemented left the data for the taking, and hackers soon found ways to creatively re-use that data.&lt;/p&gt;  &lt;p&gt;There are several significant lessons here:&lt;/p&gt;  &lt;ol&gt;&lt;li&gt;&lt;em&gt;Support lightweight programming models that allow for loosely coupled systems.&lt;/em&gt; The complexity of the corporate-sponsored web services stack is designed to enable tight coupling. While this is necessary in many cases, many of the most interesting applications can indeed remain loosely coupled, and even fragile. The Web 2.0 mindset is very different from the traditional IT mindset!&lt;/li&gt;&lt;li&gt;&lt;em&gt;Think syndication, not coordination.&lt;/em&gt; Simple web services, like RSS and REST-based web services, are about syndicating data outwards, not controlling what happens when it gets to the other end of the connection. This idea is fundamental to the internet itself, a reflection of what is known as the &lt;a href="http://en.wikipedia.org/wiki/End-to-end_principle"&gt;end-to-end principle&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;em&gt;Design for "hackability" and remixability&lt;/em&gt;. Systems like the original web, RSS, and AJAX all have this in common: the barriers to re-use are extremely low. Much of the useful software is actually open source, but even when it isn't, there is little in the way of intellectual property protection. The web browser's "View Source" option made it possible for any user to copy any other user's web page; RSS was designed to empower the user to view the content he or she wants, when it's wanted, not at the behest of the information provider; the most successful web services are those that have been easiest to take in new directions unimagined by their creators. The phrase "some rights reserved," which was popularized by the Creative Commons to contrast with the more typical "all rights reserved," is a useful guidepost.&lt;/li&gt;&lt;/ol&gt;  &lt;h4&gt;Innovation in Assembly&lt;/h4&gt;  &lt;p&gt;Lightweight business models are a natural concomitant of lightweight programming and lightweight connections. The Web 2.0 mindset is good at re-use. A new service like housingmaps.com was built simply by snapping together two existing services. Housingmaps.com doesn't have a business model (yet)--but for many small-scale services, Google AdSense (or perhaps Amazon associates fees, or both) provides the snap-in equivalent of a revenue model.&lt;/p&gt;  &lt;p&gt;These examples provide an insight into another key web 2.0 principle, which we call "innovation in assembly." When commodity components are abundant, you can create value simply by assembling them in novel or effective ways. Much as the PC revolution provided many opportunities for innovation in assembly of commodity hardware, with companies like Dell making a science out of such assembly, thereby defeating companies whose business model required innovation in product development, we believe that Web 2.0 will provide opportunities for companies to beat the competition by getting better at harnessing and integrating services provided by others.&lt;/p&gt;  &lt;h3&gt;6. Software Above the Level of a Single Device&lt;/h3&gt;  &lt;p&gt;One other feature of Web 2.0 that deserves mention is the fact that it's no longer limited to the PC platform. In his parting advice to Microsoft, long time Microsoft developer Dave Stutz pointed out that "Useful &lt;a href="http://www.synthesist.net/writing/onleavingms.html"&gt;software written above the level of the single device&lt;/a&gt; will command high margins for a long time to come."&lt;/p&gt;  &lt;p&gt;Of course, any web application can be seen as software above the level of a single device. After all, even the simplest web application involves at least two computers: the one hosting the web server and the one hosting the browser. And as we've discussed, the development of the web as platform extends this idea to synthetic applications composed of services provided by multiple computers.&lt;/p&gt;  &lt;p&gt;But as with many areas of Web 2.0, where the "2.0-ness" is not something new, but rather a fuller realization of the true potential of the web platform, this phrase gives us a key insight into how to design applications and services for the new platform.&lt;/p&gt;  &lt;p&gt;To date, iTunes is the best exemplar of this principle. This application seamlessly reaches from the handheld device to a massive web back-end, with the PC acting as a local cache and control station. There have been many previous attempts to bring web content to portable devices, but the iPod/iTunes combination is one of the first such applications designed from the ground up to span multiple devices. TiVo is another good example.&lt;/p&gt;  &lt;p&gt;iTunes and TiVo also demonstrate many of the other core principles of Web 2.0. They are not web applications per se, but they leverage the power of the web platform, making it a seamless, almost invisible part of their infrastructure. Data management is most clearly the heart of their offering. They are services, not packaged applications (although in the case of iTunes, it can be used as a packaged application, managing only the user's local data.) What's more, both TiVo and iTunes show some budding use of collective intelligence, although in each case, their experiments are at war with the IP lobby's. There's only a limited architecture of participation in iTunes, though the recent addition of &lt;a href="http://digitalmedia.oreilly.com/2005/07/20/WhatIsPodcasting.html"&gt;podcasting&lt;/a&gt; changes that equation substantially.&lt;/p&gt;  &lt;p&gt;This is one of the areas of Web 2.0 where we expect to see some of the greatest change, as more and more devices are connected to the new platform. What applications become possible when our phones and our cars are not consuming data but reporting it? Real time traffic monitoring, flash mobs, and citizen journalism are only a few of the early warning signs of the capabilities of the new platform.&lt;/p&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-2598533129715223994?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/2598533129715223994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=2598533129715223994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/2598533129715223994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/2598533129715223994'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/03/what-is-web-20-page4.html' title='What Is Web 2.0? page4'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-8552130071838188890</id><published>2008-03-30T22:54:00.000-07:00</published><updated>2008-03-30T23:01:36.265-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Whats I read'/><title type='text'>What Is Web 2.0? page3</title><content type='html'>&lt;div style="text-align: right;"&gt;&lt;span id="intelliTxt"&gt; by &lt;a href="http://www.oreillynet.com/pub/au/27"&gt;Tim O'Reilly&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span id="intelliTxt"&gt;&lt;h4&gt;Blogging and the Wisdom of Crowds&lt;/h4&gt;  &lt;p&gt;One of the most highly touted features of the Web 2.0 era is the rise of blogging. Personal home pages have been around since the early days of the web, and the personal diary and daily opinion column around much longer than that, so just what is the fuss all about?&lt;/p&gt;  &lt;p&gt;At its most basic, a blog is just a personal home page in diary format. But as Rich Skrenta &lt;a href="http://blog.topix.net/archives/000066.html"&gt;notes&lt;/a&gt;, the chronological organization of a blog "seems like a trivial difference, but it drives an entirely different delivery, advertising and value chain."&lt;/p&gt;  &lt;p&gt;One of the things that has made a difference is a technology called &lt;a href="http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html"&gt;RSS&lt;/a&gt;. RSS is the most significant advance in the fundamental architecture of the web since early hackers realized that CGI could be used to create database-backed websites. RSS allows someone to link not just to a page, but to subscribe to it, with notification every time that page changes. Skrenta calls this "the incremental web." Others call it the "live web".&lt;/p&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;p&gt;Now, of course, "dynamic websites" (i.e., database-backed sites with dynamically generated content) replaced static web pages well over ten years ago. What's dynamic about the live web are not just the pages, but the links. A link to a weblog is expected to point to a perennially changing page, with "permalinks" for any individual entry, and notification for each change. An RSS feed is thus a much stronger link than, say a bookmark or a link to a single page.&lt;/p&gt;  &lt;!-- sidebar begins --&gt; &lt;table align="right" border="0" cellpadding="4" cellspacing="8" width="250"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td bgcolor="#efefef" valign="top" width="250"&gt; &lt;h4&gt;The Architecture of Participation&lt;/h4&gt;  &lt;p&gt;Some systems are designed to encourage participation. In his paper, &lt;a href="http://www.bricklin.com/cornucopia.htm"&gt;The Cornucopia of the Commons&lt;/a&gt;, Dan Bricklin noted that there are three ways to build a large database. The first, demonstrated by Yahoo!, is to pay people to do it. The second, inspired by lessons from the open source community, is to get volunteers to perform the same task. The &lt;a href="http://dmoz.org/about.html"&gt;Open Directory Project&lt;/a&gt;, an open source Yahoo competitor, is the result. But &lt;a href="http://www.napster.com/"&gt;Napster&lt;/a&gt; demonstrated a third way. Because Napster set its defaults to automatically serve any music that was downloaded, every user automatically helped to build the value of the shared database. This same approach has been followed by all other P2P file sharing services.&lt;/p&gt;  &lt;p&gt;One of the key lessons of the Web 2.0 era is this: &lt;em&gt;Users add value&lt;/em&gt;. But only a small percentage of users will go to the trouble of adding value to your application via explicit means. Therefore, Web 2.0 companies &lt;em&gt;set inclusive defaults for aggregating user data and building value as a side-effect of ordinary use of the application&lt;/em&gt;. As noted above, they build systems that get better the more people use them.&lt;/p&gt;  &lt;p&gt;Mitch Kapor once noted that "architecture is politics." Participation is intrinsic to Napster, part of its fundamental architecture.&lt;/p&gt;  &lt;p&gt;This architectural insight may also be more central to the success of open source software than the more frequently cited appeal to volunteerism. The architecture of the internet, and the World Wide Web, as well as of open source software projects like Linux, Apache, and Perl, is such that users pursuing their own "selfish" interests build collective value as an automatic byproduct. Each of these projects has a small core, well-defined extension mechanisms, and an approach that lets any well-behaved component be added by anyone, growing the outer layers of what Larry Wall, the creator of Perl, refers to as "the onion." In other words, these technologies demonstrate network effects, simply through the way that they have been designed.&lt;/p&gt;  &lt;p&gt;These projects can be seen to have a natural architecture of participation. But as Amazon demonstrates, by consistent effort (as well as economic incentives such as the Associates program), it is possible to overlay such an architecture on a system that would not normally seem to possess it.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;!-- sidebar ends --&gt;  &lt;p&gt;RSS also means that the web browser is not the only means of viewing a web page. While some RSS aggregators, such as Bloglines, are web-based, others are desktop clients, and still others allow users of portable devices to subscribe to constantly updated content.&lt;/p&gt;  &lt;p&gt;RSS is now being used to push not just notices of new blog entries, but also all kinds of data updates, including stock quotes, weather data, and photo availability. This use is actually a return to one of its roots: RSS was born in 1997 out of the confluence of Dave Winer's "Really Simple Syndication" technology, used to push out blog updates, and Netscape's "Rich Site Summary", which allowed users to create custom Netscape home pages with regularly updated data flows. Netscape lost interest, and the technology was carried forward by blogging pioneer Userland, Winer's company. In the current crop of applications, we see, though, the heritage of both parents.&lt;/p&gt;  &lt;p&gt;But RSS is only part of what makes a weblog different from an ordinary web page. Tom Coates remarks on &lt;a href="http://www.plasticbag.org/archives/2003/06/on_permalinks_and_paradigms.shtml"&gt;the significance of the permalink&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;It may seem like a trivial piece of functionality now, but it was effectively the device that turned weblogs from an ease-of-publishing phenomenon into a conversational mess of overlapping communities. For the first time it became relatively easy to gesture directly at a highly specific post on someone else's site and talk about it. Discussion emerged. Chat emerged. And - as a result - friendships emerged or became more entrenched. The permalink was the first - and most successful - attempt to build bridges between weblogs.&lt;/blockquote&gt;  &lt;p&gt;In many ways, the combination of RSS and permalinks adds many of the features of NNTP, the Network News Protocol of the Usenet, onto HTTP, the web protocol. The "blogosphere" can be thought of as a new, peer-to-peer equivalent to Usenet and bulletin-boards, the conversational watering holes of the early internet. Not only can people subscribe to each others' sites, and easily link to individual comments on a page, but also, via a mechanism known as trackbacks, they can see when anyone else links to their pages, and can respond, either with reciprocal links, or by adding comments.&lt;/p&gt;  &lt;p&gt;Interestingly, two-way links were the goal of early hypertext systems like Xanadu. Hypertext purists have celebrated trackbacks as a step towards two way links. But note that trackbacks are not properly two-way--rather, they are really (potentially) symmetrical one-way links that create the effect of two way links. The difference may seem subtle, but in practice it is enormous. Social networking systems like Friendster, Orkut, and LinkedIn, which require acknowledgment by the recipient in order to establish a connection, lack the same scalability as the web. As noted by Caterina Fake, co-founder of the Flickr photo sharing service, attention is only coincidentally reciprocal. (Flickr thus allows users to set watch lists--any user can subscribe to any other user's photostream via RSS. The object of attention is notified, but does not have to approve the connection.)&lt;/p&gt;  &lt;p&gt;If an essential part of Web 2.0 is harnessing collective intelligence, turning the web into a kind of global brain, the blogosphere is the equivalent of constant mental chatter in the forebrain, the voice we hear in all of our heads. It may not reflect the deep structure of the brain, which is often unconscious, but is instead the equivalent of conscious thought. And as a reflection of conscious thought and attention, the blogosphere has begun to have a powerful effect.&lt;/p&gt;  &lt;p&gt;First, because search engines use link structure to help predict useful pages, bloggers, as the most prolific and timely linkers, have a disproportionate role in shaping search engine results. Second, because the blogging community is so highly self-referential, bloggers paying attention to other bloggers magnifies their visibility and power. The "echo chamber" that critics decry is also an amplifier.&lt;/p&gt;  &lt;p&gt;If it were merely an amplifier, blogging would be uninteresting. But like Wikipedia, blogging harnesses collective intelligence as a kind of filter. What James Suriowecki calls "&lt;a href="http://www.randomhouse.com/features/wisdomofcrowds/"&gt;the wisdom of crowds&lt;/a&gt;" comes into play, and much as PageRank produces better results than analysis of any individual document, the collective attention of the blogosphere selects for value.&lt;/p&gt;  &lt;p&gt;While mainstream media may see individual blogs as competitors, what is really unnerving is that the competition is with the blogosphere as a whole. This is not just a competition between sites, but a competition between business models. The world of Web 2.0 is also the world of what Dan Gillmor calls "&lt;a href="http://wethemedia.oreilly.com/"&gt;we, the media&lt;/a&gt;," a world in which "the former audience", not a few people in a back room, decides what's important.&lt;/p&gt;  &lt;h3&gt;3. Data is the Next Intel Inside&lt;/h3&gt;  &lt;p&gt;Every significant internet application to date has been backed by a specialized database: Google's web crawl, Yahoo!'s directory (and web crawl), Amazon's database of products, eBay's database of products and sellers, MapQuest's map databases, Napster's distributed song database. As Hal Varian remarked in a personal conversation last year, "SQL is the new HTML." Database management is a core competency of Web 2.0 companies, so much so that we have sometimes referred to these applications as "&lt;a href="http://www.oreilly.com/catalog/opensources/book/tim.html"&gt;infoware&lt;/a&gt;" rather than merely software.&lt;/p&gt;  &lt;p&gt;This fact leads to a key question: Who owns the data?&lt;/p&gt;  &lt;p&gt;In the internet era, one can already see a number of cases where control over the database has led to market control and outsized financial returns. The monopoly on domain name registry initially granted by government fiat to Network Solutions (later purchased by Verisign) was one of the first great moneymakers of the internet. While we've argued that business advantage via controlling software APIs is much more difficult in the age of the internet, control of key data sources is not, especially if those data sources are expensive to create or amenable to increasing returns via network effects.&lt;/p&gt;  &lt;p&gt;Look at the copyright notices at the base of every map served by MapQuest, maps.yahoo.com, maps.msn.com, or maps.google.com, and you'll see the line "Maps copyright NavTeq, TeleAtlas," or with the new satellite imagery services, "Images copyright Digital Globe." These companies made substantial investments in their databases (NavTeq alone reportedly invested $750 million to build their database of street addresses and directions. Digital Globe spent $500 million to launch their own satellite to improve on government-supplied imagery.) NavTeq has gone so far as to imitate Intel's familiar Intel Inside logo: Cars with navigation systems bear the imprint, "NavTeq Onboard." Data is indeed the Intel Inside of these applications, a sole source component in systems whose software infrastructure is largely open source or otherwise commodified.&lt;/p&gt;  &lt;p&gt;The now hotly contested web mapping arena demonstrates how a failure to understand the importance of owning an application's core data will eventually undercut its competitive position. MapQuest pioneered the web mapping category in 1995, yet when Yahoo!, and then Microsoft, and most recently Google, decided to enter the market, they were easily able to offer a competing application simply by licensing the same data.&lt;/p&gt;  &lt;p&gt;Contrast, however, the position of Amazon.com. Like competitors such as Barnesandnoble.com, its original database came from ISBN registry provider R.R. Bowker. But unlike MapQuest, Amazon relentlessly enhanced the data, adding publisher-supplied data such as cover images, table of contents, index, and sample material. Even more importantly, they harnessed their users to annotate the data, such that after ten years, Amazon, not Bowker, is the primary source for bibliographic data on books, a reference source for scholars and librarians as well as consumers. Amazon also introduced their own proprietary identifier, the &lt;a href="http://www.amazon.co.uk/exec/obidos/tg/browse/-/898182/026-2143373-9163652"&gt;ASIN&lt;/a&gt;, which corresponds to the ISBN where one is present, and creates an equivalent namespace for products without one. Effectively, Amazon "embraced and extended" their data suppliers.&lt;/p&gt;  &lt;p&gt;Imagine if MapQuest had done the same thing, harnessing their users to annotate maps and directions, adding layers of value. It would have been much more difficult for competitors to enter the market just by licensing the base data.&lt;/p&gt;  &lt;p&gt;The recent introduction of Google Maps provides a living laboratory for the competition between application vendors and their data suppliers. Google's lightweight programming model has led to the creation of numerous value-added services in the form of mashups that link Google Maps with other internet-accessible data sources. Paul Rademacher's &lt;a href="http://www.housingmaps.com/"&gt;housingmaps.com&lt;/a&gt;, which combines Google Maps with &lt;a href="http://www.craigslist.com/"&gt;Craigslist&lt;/a&gt; apartment rental and home purchase data to create an interactive housing search tool, is the pre-eminent example of such a mashup.&lt;/p&gt;  &lt;p&gt;At present, these mashups are mostly innovative experiments, done by hackers. But entrepreneurial activity follows close behind. And already, one can see that for at least one class of developer, Google has taken the role of data source away from Navteq and inserted themselves as a favored intermediary. We expect to see battles between data suppliers and application vendors in the next few years, as both realize just how important certain classes of data will become as building blocks for Web 2.0 applications.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;The race is on to own certain classes of core data&lt;/em&gt;: location, identity, calendaring of public events, product identifiers and namespaces. In many cases, where there is significant cost to create the data, there may be an opportunity for an Intel Inside style play, with a single source for the data. In others, the winner will be the company that first reaches critical mass via user aggregation, and turns that aggregated data into a system service.&lt;/p&gt;  &lt;p&gt;For example, in the area of identity, PayPal, Amazon's 1-click, and the millions of users of communications systems, may all be legitimate contenders to build a network-wide identity database. (In this regard, Google's recent attempt to use cell phone numbers as an identifier for Gmail accounts may be a step towards embracing and extending the phone system.) Meanwhile, startups like &lt;a href="http://www.sxip.com/"&gt;Sxip&lt;/a&gt; are exploring the potential of federated identity, in quest of a kind of "distributed 1-click" that will provide a seamless Web 2.0 identity subsystem. In the area of calendaring, &lt;a href="http://www.evdb.com/"&gt;EVDB&lt;/a&gt; is an attempt to build the world's largest shared calendar via a wiki-style architecture of participation. While the jury's still out on the success of any particular startup or approach, it's clear that standards and solutions in these areas, effectively turning certain classes of data into reliable subsystems of the "internet operating system", will enable the next generation of applications.&lt;/p&gt;  &lt;p&gt;A further point must be noted with regard to data, and that is user concerns about privacy and their rights to their own data. In many of the early web applications, copyright is only loosely enforced. For example, Amazon lays claim to any reviews submitted to the site, but in the absence of enforcement, people may repost the same review elsewhere. However, as companies begin to realize that control over data may be their chief source of competitive advantage, we may see heightened attempts at control.&lt;/p&gt;  &lt;p&gt;Much as the rise of proprietary software led to the &lt;a href="http://www.onlamp.com/pub/a/onlamp/2005/09/29/what-is-free-software.html"&gt;Free Software&lt;/a&gt; movement, we expect the rise of proprietary databases to result in a Free Data movement within the next decade. One can see early signs of this countervailing trend in open data projects such as Wikipedia, the Creative Commons, and in software projects like &lt;a href="http://www.oreillynet.com/pub/a/network/2005/09/01/what-is-greasemonkey.html"&gt;Greasemonkey&lt;/a&gt;, which allow users to take control of how data is displayed on their computer.&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span id="intelliTxt"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-8552130071838188890?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/8552130071838188890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=8552130071838188890' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/8552130071838188890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/8552130071838188890'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/03/what-is-web-20-page3.html' title='What Is Web 2.0? page3'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-846751274672810172</id><published>2008-03-30T20:46:00.000-07:00</published><updated>2008-03-30T23:02:02.576-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Whats I read'/><title type='text'>What Is Web 2.0? page2</title><content type='html'>&lt;div style="text-align: right;"&gt;&lt;span id="intelliTxt"&gt; by &lt;a href="http://www.oreillynet.com/pub/au/27"&gt;Tim O'Reilly&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span id="intelliTxt"&gt;&lt;h4&gt;DoubleClick vs. Overture and AdSense&lt;/h4&gt;  &lt;p&gt;Like Google, DoubleClick is a true child of the internet era. It harnesses software as a service, has a core competency in data management, and, as noted above, was a pioneer in web services long before web services even had a name. However, DoubleClick was ultimately limited by its business model. It bought into the '90s notion that the web was about publishing, not participation; that advertisers, not consumers, ought to call the shots; that size mattered, and that the internet was increasingly being dominated by the top websites as measured by MediaMetrix and other web ad scoring companies.&lt;/p&gt;  &lt;p&gt;As a result, DoubleClick proudly cites on its website "over 2000 successful implementations" of its software. Yahoo! Search Marketing (formerly Overture) and Google &lt;a href="http://www.oreillynet.com/pub/a/network/2005/07/26/WhatIsAdSense.html"&gt;AdSense&lt;/a&gt;, by contrast, already serve hundreds of thousands of advertisers apiece.&lt;/p&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;p&gt;Overture and Google's success came from an understanding of what Chris Anderson refers to as "the long tail," the collective power of the small sites that make up the bulk of the web's content. DoubleClick's offerings require a formal sales contract, limiting their market to the few thousand largest websites. Overture and Google figured out how to enable ad placement on virtually any web page. What's more, they eschewed publisher/ad-agency friendly advertising formats such as banner ads and popups in favor of minimally intrusive, context-sensitive, consumer-friendly text advertising.&lt;/p&gt;  &lt;p&gt;The Web 2.0 lesson: &lt;em&gt;leverage customer-self service and algorithmic data management to reach out to the entire web, to the edges and not just the center, to the long tail and not just the head.&lt;/em&gt;&lt;/p&gt;  &lt;!-- sidebar begins --&gt; &lt;table align="right" border="0" cellpadding="4" cellspacing="8" width="250"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td bgcolor="#efefef" valign="top" width="250"&gt; &lt;h4&gt;A Platform Beats an Application Every Time&lt;/h4&gt;  &lt;p&gt;In each of its past confrontations with rivals, Microsoft has successfully played the platform card, trumping even the most dominant applications. Windows allowed Microsoft to displace Lotus 1-2-3 with Excel, WordPerfect with Word, and Netscape Navigator with Internet Explorer.&lt;/p&gt;  &lt;p&gt;This time, though, the clash isn't between a platform and an application, but between two platforms, each with a radically different business model: On the one side, a single software provider, whose massive installed base and tightly integrated operating system and APIs give control over the programming paradigm; on the other, a system without an owner, tied together by a set of protocols, open standards and agreements for cooperation.&lt;/p&gt;  &lt;p&gt;Windows represents the pinnacle of proprietary control via software APIs. Netscape tried to wrest control from Microsoft using the same techniques that Microsoft itself had used against other rivals, and failed. But Apache, which held to the open standards of the web, has prospered. The battle is no longer unequal, a platform versus a single application, but platform versus platform, with the question being which platform, and more profoundly, which architecture, and which business model, is better suited to the opportunity ahead.&lt;/p&gt;  &lt;p&gt;Windows was a brilliant solution to the problems of the early PC era. It leveled the playing field for application developers, solving a host of problems that had previously bedeviled the industry. But a single monolithic approach, controlled by a single vendor, is no longer a solution, it's a problem. Communications-oriented systems, as the internet-as-platform most certainly is, require interoperability. Unless a vendor &lt;a href="http://www.salon.com/tech/feature/1999/11/16/microsoft_servers/print.html"&gt;can control both ends of every interaction&lt;/a&gt;, the possibilities of user lock-in via software APIs are limited.&lt;/p&gt;  &lt;p&gt;Any Web 2.0 vendor that seeks to lock in its application gains by controlling the platform will, by definition, no longer be playing to the strengths of the platform.&lt;/p&gt;  &lt;p&gt;This is not to say that there are not opportunities for lock-in and competitive advantage, but we believe they are not to be found via control over software APIs and protocols. There is a new game afoot. The companies that succeed in the Web 2.0 era will be those that understand the rules of that game, rather than trying to go back to the rules of the PC software era.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;!-- sidebar ends --&gt;  &lt;p&gt;Not surprisingly, other web 2.0 success stories demonstrate this same behavior. eBay enables occasional transactions of only a few dollars between single individuals, acting as an automated intermediary. Napster (though shut down for legal reasons) built its network not by building a centralized song database, but by architecting a system in such a way that every downloader also became a server, and thus grew the network.&lt;/p&gt;  &lt;h4&gt;Akamai vs. BitTorrent&lt;/h4&gt;  &lt;p&gt;Like DoubleClick, Akamai is optimized to do business with the head, not the tail, with the center, not the edges. While it serves the benefit of the individuals at the edge of the web by smoothing their access to the high-demand sites at the center, it collects its revenue from those central sites.&lt;/p&gt;  &lt;p&gt;BitTorrent, like other pioneers in the P2P movement, takes a radical approach to internet decentralization. Every client is also a server; files are broken up into fragments that can be served from multiple locations, transparently harnessing the network of downloaders to provide both bandwidth and data to other users. The more popular the file, in fact, the faster it can be served, as there are more users providing bandwidth and fragments of the complete file.&lt;/p&gt;  &lt;p&gt;BitTorrent thus demonstrates a key Web 2.0 principle: &lt;em&gt;the service automatically gets better the more people use it.&lt;/em&gt; While Akamai must add servers to improve service, every BitTorrent consumer brings his own resources to the party. There's an implicit "architecture of participation", a built-in ethic of cooperation, in which the service acts primarily as an intelligent broker, connecting the edges to each other and harnessing the power of the users themselves.&lt;/p&gt;&lt;h3&gt;2. Harnessing Collective Intelligence&lt;/h3&gt;  &lt;p&gt;The central principle behind the success of the giants born in the Web 1.0 era who have survived to lead the Web 2.0 era appears to be this, that they have embraced the power of the web to harness collective intelligence:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;Hyperlinking is the foundation of the web. As users add new content, and new sites, it is bound in to the structure of the web by other users discovering the content and linking to it. Much as synapses form in the brain, with associations becoming stronger through repetition or intensity, the web of connections grows organically as an output of the collective activity of all web users.&lt;/li&gt;&lt;li&gt;Yahoo!, the first great internet success story, was born as a catalog, or directory of links, an aggregation of the best work of thousands, then millions of web users. While Yahoo! has since moved into the business of creating many types of content, its role as a portal to the collective work of the net's users remains the core of its value.&lt;/li&gt;&lt;li&gt;Google's breakthrough in search, which quickly made it the undisputed search market leader, was PageRank, a method of using the link structure of the web rather than just the characteristics of documents to provide better search results.&lt;/li&gt;&lt;li&gt;eBay's product is the collective activity of all its users; like the web itself, eBay grows organically in response to user activity, and the company's role is as an enabler of a context in which that user activity can happen. What's more, eBay's competitive advantage comes almost entirely from the critical mass of buyers and sellers, which makes any new entrant offering similar services significantly less attractive.&lt;/li&gt;&lt;li&gt;Amazon sells the same products as competitors such as Barnesandnoble.com, and they receive the same product descriptions, cover images, and editorial content from their vendors. But Amazon has made a science of user engagement. They have an order of magnitude more user reviews, invitations to participate in varied ways on virtually every page--and even more importantly, they use user activity to produce better search results. While a Barnesandnoble.com search is likely to lead with the company's own products, or sponsored results, Amazon always leads with "most popular", a real-time computation based not only on sales but other factors that Amazon insiders call the "flow" around products. With an order of magnitude more user participation, it's no surprise that Amazon's sales also outpace competitors.&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;Now, innovative companies that pick up on this insight and perhaps extend it even further, are making their mark on the web:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;Wikipedia, an online encyclopedia based on the unlikely notion that an entry can be added by any web user, and edited by any other, is a radical experiment in trust, applying Eric Raymond's dictum (originally coined in the context of &lt;a href="http://www.onlamp.com/pub/a/onlamp/2005/09/15/what-is-opensource.html"&gt;open source software&lt;/a&gt;) that "with enough eyeballs, all bugs are shallow," to content creation. Wikipedia is already in the top 100 websites, and many think it will be in the top ten before long. This is a profound change in the dynamics of content creation!&lt;/li&gt;&lt;li&gt;Sites like del.icio.us and &lt;a href="http://www.macdevcenter.com/pub/a/mac/2005/08/02/flickr.html"&gt;Flickr&lt;/a&gt;, two companies that have received a great deal of attention of late, have pioneered a concept that some people call "&lt;a href="http://en.wikipedia.org/wiki/Folksonomy"&gt;folksonomy&lt;/a&gt;" (in contrast to taxonomy), a style of collaborative categorization of sites using freely chosen keywords, often referred to as tags. Tagging allows for the kind of multiple, overlapping associations that the brain itself uses, rather than rigid categories. In the canonical example, a Flickr photo of a puppy might be tagged both "puppy" and "cute"--allowing for retrieval along natural axes generated user activity.&lt;/li&gt;&lt;li&gt;Collaborative spam filtering products like Cloudmark aggregate the individual decisions of email users about what is and is not spam, outperforming systems that rely on analysis of the messages themselves.&lt;/li&gt;&lt;li&gt;It is a truism that the greatest internet success stories don't advertise their products. Their adoption is driven by "viral marketing"--that is, recommendations propagating directly from one user to another. You can almost make the case that if a site or product relies on advertising to get the word out, it isn't Web 2.0.&lt;/li&gt;&lt;li&gt;Even much of the infrastructure of the web--including the Linux, Apache, MySQL, and Perl, PHP, or Python code involved in most web servers--relies on the &lt;a href="http://www.google.com/url?sa=U&amp;amp;start=2&amp;amp;q=http://www.benkler.org/CoasesPenguin.html&amp;amp;e=10342"&gt;peer-production&lt;/a&gt; methods of open source, in themselves an instance of collective, net-enabled intelligence. There are more than 100,000 open source software projects listed on &lt;a href="http://www.sourceforge.net/"&gt;SourceForge.net&lt;/a&gt;. Anyone can add a project, anyone can download and use the code, and new projects migrate from the edges to the center as a result of users putting them to work, an organic software adoption process relying almost entirely on viral marketing.&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;The lesson: &lt;em&gt;Network effects from user contributions are the key to market dominance in the Web 2.0 era.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-846751274672810172?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/846751274672810172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=846751274672810172' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/846751274672810172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/846751274672810172'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/03/what-is-web-20-page2.html' title='What Is Web 2.0? page2'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-3275422727325755090</id><published>2008-03-30T20:21:00.000-07:00</published><updated>2008-03-30T23:02:25.076-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Whats I read'/><title type='text'>What Is Web 2.0? page1</title><content type='html'>&lt;div style="text-align: right;"&gt;&lt;span id="intelliTxt"&gt; by &lt;a href="http://www.oreillynet.com/pub/au/27"&gt;Tim O'Reilly&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;Design Patterns and Business Models for the Next Generation of Software&lt;br /&gt;&lt;span id="intelliTxt"&gt;&lt;p&gt;The bursting of the dot-com bubble in the fall of 2001 marked a turning point for the web. Many people concluded that the web was overhyped, when in fact &lt;a href="http://www.carlotaperez.org/"&gt;bubbles and consequent shakeouts appear to be a common feature of all technological revolutions&lt;/a&gt;. Shakeouts typically mark the point at which an ascendant technology is ready to take its place at center stage. The pretenders are given the bum's rush, the real success stories show their strength, and there begins to be an understanding of what separates one from the other.&lt;/p&gt;  &lt;p&gt;The concept of "Web 2.0" began with a conference brainstorming session between O'Reilly and MediaLive International. Dale Dougherty, web pioneer and O'Reilly VP, noted that far from having "crashed", the web was more important than ever, with exciting new applications and sites popping up with surprising regularity. What's more, the companies that had survived the collapse seemed to have some things in common. Could it be that the dot-com collapse marked some kind of turning point for the web, such that a call to action such as "Web 2.0" might make sense? We agreed that it did, and so the &lt;a href="http://www.web2con.com/"&gt;Web 2.0 Conference&lt;/a&gt; was born.&lt;/p&gt;&lt;span class="fullpost"&gt;&lt;br /&gt; &lt;p&gt;In the year and a half since, the term "Web 2.0" has clearly taken hold, with more than 9.5 million citations in Google. But there's still &lt;a href="http://radar.oreilly.com/archives/2005/08/not_20.html"&gt;a huge amount of disagreement about just what Web 2.0 means&lt;/a&gt;, with some people decrying it as a meaningless marketing buzzword, and others accepting it as the new conventional wisdom.&lt;/p&gt;  &lt;p&gt;This article is an attempt to clarify just what we mean by Web 2.0.&lt;/p&gt;  &lt;p&gt;In our initial brainstorming, we formulated our sense of Web 2.0 by example:&lt;/p&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="500"&gt;   &lt;tbody&gt;&lt;tr&gt;     &lt;th scope="col" align="right" width="200"&gt;Web 1.0&lt;/th&gt;     &lt;th scope="col" align="center" width="59"&gt;&lt;br /&gt;&lt;/th&gt;     &lt;th scope="col" align="left" width="241"&gt;Web 2.0&lt;/th&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;DoubleClick&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;Google AdSense &lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;Ofoto&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;Flickr&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;Akamai&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;BitTorrent&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;mp3.com&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;Napster&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;Britannica Online&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;Wikipedia&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;personal websites&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;blogging&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;evite&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;upcoming.org and EVDB&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;domain name speculation&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;search engine optimization&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;page views&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;cost per click&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;screen scraping&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;web services&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;publishing&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;participation&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;content management systems&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;wikis&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;directories (taxonomy)&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;tagging ("folksonomy")&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td align="right"&gt;stickiness&lt;/td&gt;     &lt;td align="center"&gt;--&gt;&lt;/td&gt;     &lt;td&gt;syndication&lt;/td&gt;   &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;The list went on and on. But what was it that made us identify one application or approach as "Web 1.0" and another as "Web 2.0"? (The question is particularly urgent because the Web 2.0 meme has become so widespread that companies are now pasting it on as a marketing buzzword, with no real understanding of just what it means. The question is particularly difficult because many of those buzzword-addicted startups are definitely &lt;em&gt;not&lt;/em&gt; Web 2.0, while some of the applications we identified as Web 2.0, like Napster and BitTorrent, are not even properly web applications!) We began trying to tease out the principles that are demonstrated in one way or another by the success stories of web 1.0 and by the most interesting of the new applications.&lt;/p&gt;  &lt;h3&gt;1. The Web As Platform&lt;/h3&gt;  &lt;p&gt;Like many important concepts, Web 2.0 doesn't have a hard boundary, but rather, a gravitational core. You can &lt;a href="http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html#mememap"&gt;visualize Web 2.0&lt;/a&gt; as a set of principles and practices that tie together a veritable solar system of sites that demonstrate some or all of those principles, at a varying distance from that core.&lt;/p&gt;  &lt;a name="mememap" id="mememap"&gt;&lt;/a&gt; &lt;p&gt;&lt;img src="http://www.oreillynet.com/oreilly/tim/news/2005/09/30/graphics/figure1.jpg" alt="Web2MemeMap" height="375" width="500" /&gt;&lt;/p&gt; &lt;p&gt;Figure 1 shows a "meme map" of Web 2.0 that was developed at a brainstorming session during FOO Camp, a conference at O'Reilly Media. It's very much a work in progress, but shows the many ideas that radiate out from the Web 2.0 core.&lt;/p&gt;  &lt;p&gt;For example, at the first Web 2.0 conference, in October 2004, John Battelle and I listed a preliminary set of principles in our opening talk. The first of those principles was "The web as platform." Yet that was also a rallying cry of Web 1.0 darling Netscape, which went down in flames after a heated battle with Microsoft. What's more, two of our initial Web 1.0 exemplars, DoubleClick and Akamai, were both pioneers in treating the web as a platform. People don't often think of it as "web services", but in fact, ad serving was the first widely deployed web service, and the first widely deployed "mashup" (to use another term that has gained currency of late). Every banner ad is served as a seamless cooperation between two websites, delivering an integrated page to a reader on yet another computer. Akamai also treats the network as the platform, and at a deeper level of the stack, building a transparent caching and content delivery network that eases bandwidth congestion.&lt;/p&gt;  &lt;p&gt;Nonetheless, these pioneers provided useful contrasts because later entrants have taken their solution to the same problem even further, understanding something deeper about the nature of the new platform. Both DoubleClick and Akamai were Web 2.0 pioneers, yet we can also see how it's possible to realize more of the possibilities by embracing additional &lt;a href="http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html?page=3#designpatterns"&gt;Web 2.0 design patterns&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Let's drill down for a moment into each of these three cases, teasing out some of the essential elements of difference.&lt;/p&gt;  &lt;h4&gt;Netscape vs. Google&lt;/h4&gt;  &lt;p&gt;If Netscape was the standard bearer for Web 1.0, Google is most certainly the standard bearer for Web 2.0, if only because their respective IPOs were defining events for each era. So let's start with a comparison of these two companies and their positioning.&lt;/p&gt;  &lt;p&gt;Netscape framed "the web as platform" in terms of the old software paradigm: their flagship product was the web browser, a desktop application, and their strategy was to use their dominance in the browser market to establish a market for high-priced server products. Control over standards for displaying content and applications in the browser would, in theory, give Netscape the kind of market power enjoyed by Microsoft in the PC market. Much like the "horseless carriage" framed the automobile as an extension of the familiar, Netscape promoted a "webtop" to replace the desktop, and planned to populate that webtop with information updates and applets pushed to the webtop by information providers who would purchase Netscape servers.&lt;/p&gt;  &lt;p&gt;In the end, both web browsers and web servers turned out to be commodities, and value moved "up the stack" to services delivered over the web platform.&lt;/p&gt;  &lt;p&gt;Google, by contrast, began its life as a native web application, never sold or packaged, but delivered as a service, with customers paying, directly or indirectly, for the use of that service. None of the trappings of the old software industry are present. No scheduled software releases, just continuous improvement. No licensing or sale, just usage. No porting to different platforms so that customers can run the software on their own equipment, just a massively scalable collection of commodity PCs running open source operating systems plus homegrown applications and utilities that no one outside the company ever gets to see.&lt;/p&gt;  &lt;p&gt;At bottom, Google requires a competency that Netscape never needed: database management. Google isn't just a collection of software tools, it's a specialized database. Without the data, the tools are useless; without the software, the data is unmanageable. Software licensing and control over APIs--the lever of power in the previous era--is irrelevant because the software never need be distributed but only performed, and also because without the ability to collect and manage the data, the software is of little use. In fact, &lt;em&gt;the value of the software is proportional to the scale and dynamism of the data it helps to manage.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Google's service is not a server--though it is delivered by a massive collection of internet servers--nor a browser--though it is experienced by the user within the browser. Nor does its flagship search service even host the content that it enables users to find. Much like a phone call, which happens not just on the phones at either end of the call, but on the network in between, Google happens in the space between browser and search engine and destination content server, as an enabler or middleman between the user and his or her online experience.&lt;/p&gt;  &lt;p&gt;While both Netscape and Google could be described as software companies, it's clear that Netscape belonged to the same software world as Lotus, Microsoft, Oracle, SAP, and other companies that got their start in the 1980's software revolution, while Google's fellows are other internet applications like eBay, Amazon, Napster, and yes, DoubleClick and Akamai.&lt;/p&gt;&lt;p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-3275422727325755090?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/3275422727325755090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=3275422727325755090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/3275422727325755090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/3275422727325755090'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/03/what-is-web-20-page1.html' title='What Is Web 2.0? page1'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-385249180739322474</id><published>2008-03-26T20:13:00.000-07:00</published><updated>2008-04-07T23:46:19.503-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><title type='text'>Hide/Show Console window in .NET 2.0 and higher (black window)</title><content type='html'>When working with .Net Console application, one issue may occurred is how to hide the console screen ( the black window ). In my case, my console application call to show an Window Form and the console need to be hide for convenient handling. And when needed, we also unhide the console.&lt;br /&gt;&lt;br /&gt;See runnable example below :&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Windows.Forms;&lt;br /&gt;&lt;br /&gt;namespace MyNamespace&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        [DllImport("user32.dll")]&lt;br /&gt;        public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);&lt;br /&gt;        [DllImport("user32.dll")]&lt;br /&gt;        static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);&lt;br /&gt;&lt;br /&gt;        [STAThread]&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            // My example context is when app run with no parameters&lt;br /&gt;            // application launch an UI to waiting command from it.           &lt;br /&gt;            if (arrArgs.Count == 0)&lt;br /&gt;            {&lt;br /&gt;                // Display manage UI and hide console&lt;br /&gt;                HideConsole();&lt;br /&gt;                Application.EnableVisualStyles();&lt;br /&gt;                Application.SetCompatibleTextRenderingDefault(false);&lt;br /&gt;                Application.Run(new mainForm());&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                // Handle parameters ...&lt;br /&gt;            }&lt;br /&gt;        }  &lt;br /&gt;      &lt;br /&gt;        static void HideConsole()&lt;br /&gt;        {&lt;br /&gt;            IntPtr hWnd = FindWindow(null, Console.Title);&lt;br /&gt;            if(hWnd != IntPtr.Zero)&lt;br /&gt;            {&lt;br /&gt;                ShowWindow(hWnd, 0); // 0 = SW_HIDE&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        static void ShowConsole()&lt;br /&gt;        {&lt;br /&gt;            IntPtr hWnd = FindWindow(null, Console.Title);&lt;br /&gt;            if (hWnd != IntPtr.Zero)&lt;br /&gt;            {&lt;br /&gt;                ShowWindow(hWnd, 1); //1 = SW_SHOWNORMA&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Hope this useful for you.&lt;br /&gt;Happy harvest exp.&lt;br /&gt;Moongy.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-385249180739322474?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/385249180739322474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=385249180739322474' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/385249180739322474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/385249180739322474'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/03/hideshow-console-window-in-net-black.html' title='Hide/Show Console window in .NET 2.0 and higher (black window)'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-8001537120513632555</id><published>2008-03-20T21:14:00.000-07:00</published><updated>2008-03-20T21:32:54.357-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to get the Current windows username?</title><content type='html'>&lt;span id="lblDescription"  style="color:DarkBlue;"&gt;From &lt;a href="http://www.dotnetspider.com/qa/Question54124.aspx"&gt;Dotnetspider&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I am trying to integrate single - sign - on Facility for one application in .NET.&lt;br /&gt;I would like get the cuurent windows user name so that i will compare that name with the name in DB. If succeeds application should allow user further. Please help&lt;/span&gt;&lt;br /&gt;&lt;h1 style="font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;Answers .............&lt;/span&gt;&lt;/h1&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;hr style="height: 1px;" color="silver"&gt;    &lt;table bgcolor="WHITE" cellpadding="5" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a name="79016"&gt;&lt;/a&gt;20 Sep 06 03:28 AM : &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=ValliS"&gt;&lt;b&gt;Padma&lt;/b&gt;&lt;/a&gt;  : MNC&lt;/td&gt;   &lt;td&gt;        &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=ValliS"&gt;&lt;img src="http://www.dotnetspider.com/Images/profiles/Thumbs%5CValliS.jpg" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr bgcolor="WHITE"&gt;   &lt;td class="v11" colspan="2"&gt;Dim strLogonUser as string&lt;br /&gt;strLogonUser = Request.ServerVariables("REMOTE_USER")&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;   &lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a name="79019"&gt;&lt;/a&gt;20 Sep 06 03:34 AM : &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=gowda.chandan"&gt;&lt;b&gt;chandan nagaraj&lt;/b&gt;&lt;/a&gt;  : &lt;/td&gt;   &lt;td&gt;        &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=gowda.chandan"&gt;&lt;img src="http://www.dotnetspider.com/Images/profiles/Thumbs%5Cgowda.chandan.jpg" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr bgcolor="WHITE"&gt;   &lt;td class="v11" colspan="2"&gt;Dim temp As String = System.Web.HttpContext.Current.User.Identity.Name&lt;br /&gt;dim Username as string&lt;br /&gt;Username = Mid(temp, InStr(temp, "\") + 1)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;   &lt;/tr&gt;&lt;tr class="style3"&gt;&lt;td&gt;&lt;a name="79034"&gt;&lt;/a&gt;20 Sep 06 03:54 AM : &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=sharmagaurav"&gt;&lt;b&gt;Gaurav Sharma &lt;/b&gt;&lt;/a&gt;  : MCAD/MCP&lt;br /&gt;&lt;span class="v10"&gt;&lt;a href="http://www.dotnetlearner.blogspot.com/" target="_blank" rel="nofollow"&gt;http://www.dotnetlearner.blogspot.com&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;        &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=sharmagaurav"&gt;&lt;img src="http://www.dotnetspider.com/Images/profiles/Thumbs%5Csharmagaurav.jpg" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr bgcolor="WHITE"&gt;   &lt;td class="v11" colspan="2"&gt;to access Current window User name u need to read it from Registry&lt;br /&gt;thanks&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;   &lt;/tr&gt;&lt;tr class="style3"&gt;&lt;td&gt;&lt;a name="79081"&gt;&lt;/a&gt;20 Sep 06 04:56 AM : &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=kumarsudu"&gt;&lt;b&gt;kumar&lt;/b&gt;&lt;/a&gt;  : WC2&lt;/td&gt;   &lt;td&gt;        &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=kumarsudu"&gt;&lt;img src="http://www.dotnetspider.com/Images/profiles/Thumbs%5Ckumarsudu.JPG" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr bgcolor="WHITE"&gt;   &lt;td class="v11" colspan="2"&gt;Hi,&lt;br /&gt;&lt;br /&gt;you can write like below&lt;br /&gt;&lt;br /&gt;HttpContext.Current.User.Identity.Name&lt;br /&gt;&lt;br /&gt;thanks and regards,&lt;br /&gt;kumar&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;   &lt;/tr&gt;&lt;tr class="style3"&gt;&lt;td&gt;&lt;a name="79087"&gt;&lt;/a&gt;20 Sep 06 05:03 AM : &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=gowda.chandan"&gt;&lt;b&gt;chandan nagaraj&lt;/b&gt;&lt;/a&gt;  : &lt;/td&gt;   &lt;td&gt;        &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=gowda.chandan"&gt;&lt;img src="http://www.dotnetspider.com/Images/profiles/Thumbs%5Cgowda.chandan.jpg" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr bgcolor="WHITE"&gt;   &lt;td class="v11" colspan="2"&gt;using three ways we can get the User Name using C#&lt;br /&gt;&lt;br /&gt;1) System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;&lt;br /&gt;&lt;br /&gt;string strName = p.Identity.Name;&lt;br /&gt;&lt;br /&gt;[ OR ]&lt;br /&gt;&lt;br /&gt;2) string strName = HttpContext.Current.User.Identity.Name.ToString();&lt;br /&gt;&lt;br /&gt;[ OR ]&lt;br /&gt;&lt;br /&gt;3) string strName = Request.ServerVariables["AUTH_USER"]; //Finding with name&lt;br /&gt;&lt;br /&gt;string strName = Request.ServerVariables[5]; //Finding with index&lt;br /&gt;&lt;br /&gt;In Above 3 Cases returnin string contains DomainName\WinNTLoggedUserName&lt;br /&gt;&lt;br /&gt;Using string operations seperate the DomainName and UserName.&lt;br /&gt;&lt;br /&gt;Source:-Code Project&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;   &lt;/tr&gt;&lt;tr class="style3"&gt;&lt;td&gt;&lt;a name="120989"&gt;&lt;/a&gt;25 Apr 07 04:50 AM : &lt;a href="http://www.dotnetspider.com/profiles/ViewProfile.aspx?UserId=dearviveksingh"&gt;&lt;b&gt;vivek singh bhadauriya&lt;/b&gt;&lt;/a&gt;  : ANPL&lt;br /&gt;&lt;span class="v10"&gt;&lt;a href="http://www.agroecommerce.net.in/" target="_blank" rel="nofollow"&gt;http://www.agroecommerce.net.in&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr bgcolor="WHITE"&gt;   &lt;td class="v11" colspan="2"&gt;In window application (VB.Net)use this&lt;br /&gt;on login form...&lt;br /&gt;SaveSetting("AnyName", "Properties", "UserID",txtName.text)&lt;br /&gt;&lt;br /&gt;Now on any form u can get that value by....&lt;br /&gt;Dim UserId As string = GetSetting("AnyName", "Properties", "UserID")&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;&lt;br /&gt;From &lt;a href="http://www.thescripts.com/forum/thread214216.html"&gt;TheScript&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To get the current user, better switch to .NET:&lt;br /&gt;Environment.UserName&lt;br /&gt;or&lt;br /&gt;System.Windows.Forms.SystemInformation.UserName&lt;br /&gt;--&lt;br /&gt;Thomas Scheidegger - MVP .NET - 'NETMaster'&lt;br /&gt;http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/&lt;br /&gt;&lt;br /&gt;-------------------------------------------------&lt;br /&gt;Hi,&lt;br /&gt;You can use :&lt;br /&gt;WindowsIdentity.GetCurrent().Name&lt;br /&gt;It return the user logged on the system.&lt;br /&gt;Hope this help,&lt;br /&gt;--&lt;br /&gt;Ignacio Machin,&lt;br /&gt;ignacio.machin AT dot.state.fl.us&lt;br /&gt;Florida Department Of Transportation&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-8001537120513632555?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/8001537120513632555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=8001537120513632555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/8001537120513632555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/8001537120513632555'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/03/how-to-get-current-windows-username.html' title='How to get the Current windows username?'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-2044212948801581189</id><published>2008-03-16T22:31:00.000-07:00</published><updated>2008-03-20T21:23:07.039-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net articles'/><category scheme='http://www.blogger.com/atom/ns#' term='Regular Expression'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Regular Expression references</title><content type='html'>Regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. Regular expressions (abbreviated as regex or regexp, with plural forms regexes, regexps, or regexen) are written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.&lt;br /&gt;&lt;br /&gt;This article indexed some useful internet resources about Regular Expressions (syntax, explanation and examples).&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;How to match a pattern by using regular expressions and Visual C#&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://support.microsoft.com/kb/308252"&gt;Link&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Regular Expression Syntax&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="ll"&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/ab0766e1-7037-45ed-aa23-706f58358c0e.asp?frame=true"&gt;Link&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b style=""&gt;Introduction to Regular Expressions&lt;/b&gt; (JScript .NET)&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/28hw3sce%28vs.71%29.aspx"&gt;Link &lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b style=""&gt;Introduction to Regular Expressions&lt;/b&gt; (Visual Basic Scripting Edition)&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/6wzad2b2.aspx"&gt;Link&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b style=""&gt;Regular Expressions Language Elements&lt;/b&gt; (Microsoft .NET Framework General Reference)&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="ll"&gt;&lt;a href="http://msdn.microsoft.com/library/en-us/cpgenref/html/cpconregularexpressionslanguageelements.asp?frame=true"&gt;Link&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;b style=""&gt;Regular Expression&lt;/b&gt; (RegExp) &lt;b style=""&gt;Object&lt;/b&gt; (Microsoft .NET Framework Class Library)&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="ll"&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/05f9ee2e-982f-4727-839e-b1b8ed696d0a.asp"&gt;Link&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="ll"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"&gt;&lt;span class="ll"&gt;&lt;b style=""&gt;C# Regular Expressions&lt;/b&gt; &lt;/span&gt;by &lt;a href="http://www.windowsdevcenter.com/pub/au/467"&gt;Brad Merrill&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span class="ll"&gt;Regular expressions have been used in various programming languages and tools for many years. The .NET Base Class Libraries include a namespace and a set of classes for utilizing the power of regular expressions. They are designed to be compatible with Perl 5 regular expressions whenever possible.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span class="ll"&gt;In addition, the regexp classes implement some additional functionality, such as named capture groups, right- to-left pattern matching, and expression compilation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span class="ll"&gt;In this article, I'll provide a quick overview of the classes and methods of the System.Text.RegularExpression assembly, some examples of matching and replacing strings, a more detailed walk-through of a grouping structure, and finally, a set of cookbook expressions for use in your own applications. &lt;a href="http://www.windowsdevcenter.com/pub/a/oreilly/windows/news/csharp_0101.html"&gt;&lt;span style="text-decoration: underline;"&gt;Read more&lt;/span&gt;&lt;/a&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="ll"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="ll"&gt;&lt;b style=""&gt;C# Regular Expressions, Revisited&lt;/b&gt; &lt;/span&gt;by &lt;a href="http://www.ondotnet.com/pub/au/467"&gt;Brad Merrill&lt;/a&gt;, coauthor of &lt;a href="http://www.oreilly.com/catalog/csharpess2/"&gt;C# Essentials, 2nd Edition&lt;/a&gt;.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="ll"&gt;The following is a brief list of the major changes to the RegEx class library since Beta1:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="ll"&gt;&lt;span style=""&gt;    &lt;/span&gt;* The RegularExpression Assembly is now merged with the main Frameworks class library. This means you will no longer need to reference the assembly seperately. You will still need to specify the namespace via the using statement, in order to use the classes by name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="ll"&gt;&lt;span style=""&gt;    &lt;/span&gt;* When matching groups, the Group method was used to retrieve appropriately indexed group. Now we can retrieve the Groups property, which is a GroupCollection, which can be indexed directly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="ll"&gt;&lt;span style=""&gt;    &lt;/span&gt;* In Beta1, the RegEx modifiers were specified as character code. Now, there is an Enum called RegexOptions which provides access to the modifier functionality.    &lt;a href="http://www.ondotnet.com/pub/a/dotnet/2002/03/11/regex2.html"&gt;Read more&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="ll"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Beginning Regular Expressions in C#, Java, and Perl&lt;/b&gt; by &lt;a href="http://www.devhood.com/public.aspx?user_id=0003BFFD80F54116"&gt;Larry Mak&lt;/a&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;A regular expression is a pattern of text in regular language. It describes what to match in a regular string. It serves as a filter to find what you're looking for.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Regular expressions are somewhat standardized - they're consistent with the different languages, despite the different syntax to call them.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;The two main function of using regular expression is to match and to replace. The former determines if the pattern is in the string, and if so, find it. Replace changes the string according to the pattern to another pattern.  &lt;a href="http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=523"&gt;Read more&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Regular Expressions and C#, .NET ( Syntax and explanation )&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.exforsys.com/tutorials/csharp/regular-expressions-and-csharp-.net.html"&gt;Link&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;        An articles contains syntax table and explanation quite cool. Just have a visit.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Learn Regular Expression (Regex) syntax with C# and .NET &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.radsoftware.com.au/articles/regexlearnsyntax.aspx"&gt;Link&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;C# Regular Expression (Regex) Examples in .NET&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.radsoftware.com.au/articles/regexsyntaxadvanced.aspx"&gt;Link&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;C# Demo Application Illustrating the Use of Regular Expressions with The .NET Framework&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.regular-expressions.info/dotnetexample.html"&gt;Link&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Regular Expressions Usage in C#&lt;/b&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="articledate"&gt;By  &lt;/span&gt;&lt;span class="authorname"&gt;&lt;a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$ArticleHeader1$LinkButtonAuthorName','')"&gt;Prasad &lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.c-sharpcorner.com/UploadFile/prasad_1/RegExpPSD12062005021717AM/RegExpPSD.aspx"&gt;Link&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;The source code shows how to use Regular Expressions in C#. The code Functions written for Validation Alphabet, AlphaNumeric, Integer, Postive Integer, Floating point numbers. You just cut copy these functions and use in any program.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Take a preview of C# Essentials, 2nd Edition at&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://safari.oreilly.com/0596003153"&gt;Link&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-2044212948801581189?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/2044212948801581189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=2044212948801581189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/2044212948801581189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/2044212948801581189'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/03/regular-expression-references.html' title='Regular Expression references'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-8381466737818230588</id><published>2008-03-06T19:38:00.000-08:00</published><updated>2008-03-06T20:08:31.463-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C and VC articles'/><title type='text'>Get computer name, get IP Address, translate among them technique articles</title><content type='html'>This is the list articles about how to get IP address from computer name, how to get ip address from network computer name, how to get MAC address, and vice versa, how to get name info by socket address. Almost are technique specification using C++, VC++ and one by PHP.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SystemInformation, ComputerName Property&lt;/li&gt;&lt;/ul&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.systeminformation.computername.aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.windows.forms.systeminformation.computername.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;How to get IP address of computer given its name&lt;/li&gt;&lt;/ul&gt;&lt;a href="http://www.thescripts.com/forum/thread280096.html"&gt;http://www.thescripts.com/forum/thread280096.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Get MAC address tool&lt;/li&gt;&lt;/ul&gt;&lt;a href="http://www.youngzsoft.net/cc-get-mac-address/"&gt;http://www.youngzsoft.net/cc-get-mac-address/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Get the local computer name using C++&lt;/li&gt;&lt;/ul&gt;&lt;a href="http://www.techbytes.ca/techbyte97.html"&gt;http://www.techbytes.ca/techbyte97.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Listing all the IP addresses of an URL or Computer Name (using XAPI)&lt;/li&gt;&lt;/ul&gt;&lt;a href="http://www.codeproject.com/KB/IP/ipaddresslist.aspx"&gt;http://www.codeproject.com/KB/IP/ipaddresslist.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;PHP code get host by address, Get the Internet host name corresponding to a given IP address&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;a href="http://de3.php.net/manual/en/function.gethostbyaddr.php"&gt;http://de3.php.net/manual/en/function.gethostbyaddr.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;C++ Get address by computer name&lt;/li&gt;&lt;/ul&gt;&lt;a href="http://www.opengroup.org/onlinepubs/009695399/functions/getaddrinfo.html"&gt;http://www.opengroup.org/onlinepubs/009695399/functions/getaddrinfo.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;C++ Get computer name by socket address&lt;/li&gt;&lt;/ul&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/system_information.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/system_information.asp&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.opengroup.org/onlinepubs/009695399/functions/getnameinfo.html"&gt;http://www.opengroup.org/onlinepubs/009695399/functions/getnameinfo.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;C++ Translate computer address to computer name&lt;/li&gt;&lt;/ul&gt; &lt;a href="http://msdn2.microsoft.com/en-us/library/ms738532%28VS.85%29.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms738532(VS.85).aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://homepages.cwi.nl/%7Eaeb/linux/man2html/man3/getnameinfo.3.html"&gt;http://homepages.cwi.nl/~aeb/linux/man2html/man3/getnameinfo.3.html&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-8381466737818230588?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/8381466737818230588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=8381466737818230588' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/8381466737818230588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/8381466737818230588'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/03/get-computer-name-get-ip-address.html' title='Get computer name, get IP Address, translate among them technique articles'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-7499045201788941356</id><published>2008-03-04T19:09:00.000-08:00</published><updated>2008-07-15T19:33:11.938-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML and JavaScript'/><title type='text'>HTML transparent image, PNG transparent issue</title><content type='html'>Recently, i just designed &lt;a href="http://iphonecool.blogspot.com/"&gt;my new blogspot blog&lt;/a&gt; and my problem was how to add a transparent image to my blog. As we known, transparent can be applied as background image. I fount a lot of ways to do background transparent via CSS. But i need work to be done with a png transparent image inside the tag  &amp;lt;img&amp;gt;.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Everything is ok with Mozilla Firefox, but with IE the problem occured. In IE, the image also transpanent as the bare it is but it's background didn't match your outter background.&lt;br /&gt;&lt;br /&gt;The answer is IE does not support transparent for PNG images. It's ok with the original GIF transparent images. You can also convert your images to GIF format or just match your background with it. If you need to digg more, hope list of articles below useful for you.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://blogs.msdn.com/ie/archive/2005/04/26/412263.aspx"&gt;IE7 Transparent PNG Implementation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.quackit.com/html/codes/html_background_image_codes.cfm"&gt;HTML Background Image Code&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3schools.com/html/html_backgrounds.asp"&gt;HTML Backgrounds W3schools guide&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3schools.com/css/css_image_transparency.asp"&gt;CSS Image Opacity / Transparency&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.frankmanno.com/ideas/css-imagemap-redux/"&gt;CSS Image Maps, Redux&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.mandarindesign.com/opacity.html"&gt;CSS Opacity in Mozilla,IE, and Opera&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Try how cool it is when design your web with transparent images. &lt;a href="http://iphonecool.blogspot.com/"&gt;&gt;&gt;click here&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-7499045201788941356?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/7499045201788941356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=7499045201788941356' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7499045201788941356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/7499045201788941356'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/03/html-transparent-image-png-transparent.html' title='HTML transparent image, PNG transparent issue'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-1201564103937834269</id><published>2008-02-26T00:27:00.000-08:00</published><updated>2008-04-07T23:36:00.062-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Multithreading'/><title type='text'>Start, stop thread, how implement multithread C#</title><content type='html'>You're writing a application do something hard, your app UI was not responding when it's running... and you try multithreading...&lt;br /&gt;&lt;br /&gt;So, how to implement it? and how to stop it? and... ;) how do i know it's stopped? the snippet below may help you to get the answer.&lt;br /&gt;&lt;br /&gt;Below is a small help to implement multithread in C# - does not lock UI and synchronize to avoid recall thread that not complete yet ( ex.. when button clicked, thread run, the button disabled, till the thread complete then resume the button.)&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;      using System.Threading;          &lt;br /&gt;&lt;br /&gt;      class MyClass{&lt;br /&gt;      bool _isStop=false;     &lt;br /&gt;      bool _isStopSuccess = false;&lt;br /&gt;      private void Button1_Click(){&lt;br /&gt;          try&lt;br /&gt;          {&lt;br /&gt;              if (_isStop == true)&lt;br /&gt;              {          &lt;br /&gt;                  Button1.Text = "Stop";       &lt;br /&gt;                  ThreadPool.QueueUserWorkItem(new WaitCallback(DoWork));             &lt;br /&gt;              }&lt;br /&gt;              else&lt;br /&gt;              {&lt;br /&gt;                  _isStop = true;&lt;br /&gt;                  while (!_isStopSuccess)&lt;br /&gt;                      Thread.Sleep(1000);   &lt;br /&gt;                  Button1.Text = "Start";          &lt;br /&gt;              }&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;          catch (Exception ex)&lt;br /&gt;          {             &lt;br /&gt;              _isStop = true;&lt;br /&gt;              Button1.Text = "Start";&lt;br /&gt;          } &lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      private void DoWork(object state)&lt;br /&gt;      {&lt;br /&gt;           // In this sample, our function must has a loop&lt;br /&gt;           // cuz we need to check the _isStop status every time the loop loops&lt;br /&gt;           // otherwise, we had to Abort the thread if we want to stop it.&lt;br /&gt;           for(int i=0;i&lt;1000;i++)&lt;br /&gt;           {&lt;br /&gt;               if (_isStop)&lt;br /&gt;               {&lt;br /&gt;                   _isStopSuccess = true;&lt;br /&gt;                   return;&lt;br /&gt;               }&lt;br /&gt;&lt;br /&gt;               // your work here&lt;br /&gt;               // ..............&lt;br /&gt;           }&lt;br /&gt;      }&lt;br /&gt;      }// end class&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You should do check variable "_isStop" often, so that the thread could return as soon as possible.&lt;br /&gt;The idea "_isStopSuccess" to show our whether thread is stopped successful and we can do something to get a better app ;) ( may be change label of a button between "Do work" and "Working...", set enable some control ... )&lt;br /&gt;&lt;br /&gt;In the case your thread function does not in a loop, so how to stop it? With .Net 2.0 and higher, we should use BackGroundWorker class to implement multithreading. It's also provided ways to stop thread easily. In this case, with .Net 1.1, we must call Abort from our Thread instance to abort it. And also remember to try catch it, cuz the ThreadAbortException will occurred when thread was aborted.&lt;br /&gt;&lt;br /&gt;Hope this useful for you.&lt;br /&gt;Happy harvest exp.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-1201564103937834269?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/1201564103937834269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=1201564103937834269' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1201564103937834269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1201564103937834269'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/02/youre-writing-application-do-something.html' title='Start, stop thread, how implement multithread C#'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-4722254959951464774</id><published>2008-02-26T00:03:00.001-08:00</published><updated>2008-02-26T00:13:56.396-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Free Online Services'/><title type='text'>make cool photo with Graphita</title><content type='html'>Why dont you stop coding and try some funny thing ;)&lt;br /&gt;Fortuitous, i found this site, just up load a pic and try many cool stuff there...&lt;br /&gt;Take a stopping on ...why not? :D&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;a href="http://www.graphita.com/"&gt;http://www.graphita.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and before save your complete cool pic, push the print screen to cache it and paste to any picture editor; save process quite slow and your pic may be crashed. ;).&lt;br /&gt;Happy harvest exp.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R8PH88Y5mUI/AAAAAAAAASM/pm5lUlYWB3M/s1600-h/graphita.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R8PH88Y5mUI/AAAAAAAAASM/pm5lUlYWB3M/s400/graphita.jpg" alt="" id="BLOGGER_PHOTO_ID_5171196646968105282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-4722254959951464774?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/4722254959951464774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=4722254959951464774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/4722254959951464774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/4722254959951464774'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/02/make-cool-photo-with-graphita.html' title='make cool photo with Graphita'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_Mtmv2gkQdGA/R8PH88Y5mUI/AAAAAAAAASM/pm5lUlYWB3M/s72-c/graphita.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-1849349298620679206</id><published>2008-02-25T23:50:00.000-08:00</published><updated>2008-02-25T23:53:09.433-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DOM Javascript HTML trick'/><title type='text'>Remind Javascript operators</title><content type='html'>&lt;p class="intro"&gt;The operator = is used to assign values.&lt;/p&gt; &lt;p class="intro"&gt;The operator + is used to add values.&lt;/p&gt; &lt;hr /&gt; &lt;p&gt;The assignment operator &lt;b&gt;=&lt;/b&gt; is used to assign values to JavaScript  variables.&lt;/p&gt; &lt;p&gt;The arithmetic operator + is used to add values together.&lt;/p&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;table class="ex" id="table4" border="1" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;pre&gt;y=5;&lt;br /&gt;z=2;&lt;br /&gt;x=y+z;&lt;/pre&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;The value of x, after the execution of the statements above is 7.&lt;/p&gt; &lt;hr /&gt; &lt;h2&gt;JavaScript Arithmetic Operators&lt;/h2&gt; &lt;p&gt;Arithmetic operators are used to perform arithmetic between variables and/or  values.&lt;/p&gt; &lt;p&gt;Given that &lt;b&gt;y=5&lt;/b&gt;, the table below explains the arithmetic operators: &lt;/p&gt; &lt;table class="ex" border="1" cellspacing="0" width="100%"&gt;  &lt;tbody&gt;&lt;tr&gt; &lt;th align="left" width="15%"&gt;Operator&lt;/th&gt; &lt;th align="left" width="40%"&gt;Description&lt;/th&gt; &lt;th align="left" width="25%"&gt;Example&lt;/th&gt; &lt;th align="left" width="20%"&gt;Result&lt;/th&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;+&lt;/td&gt; &lt;td valign="top"&gt;Addition &lt;/td&gt; &lt;td valign="top"&gt;x=y+2 &lt;/td&gt; &lt;td valign="top"&gt;x=7 &lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;-&lt;/td&gt; &lt;td valign="top"&gt;Subtraction &lt;/td&gt; &lt;td valign="top"&gt;x=y-2&lt;/td&gt; &lt;td valign="top"&gt;x=3&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;*&lt;/td&gt; &lt;td valign="top"&gt;Multiplication &lt;/td&gt; &lt;td valign="top"&gt;x=y*2&lt;/td&gt; &lt;td valign="top"&gt;x=10&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;/&lt;/td&gt; &lt;td valign="top"&gt;Division &lt;/td&gt; &lt;td valign="top"&gt;x=y/2&lt;/td&gt; &lt;td valign="top"&gt;x=2.5&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;%&lt;/td&gt; &lt;td valign="top"&gt;Modulus (division remainder)   &lt;/td&gt; &lt;td valign="top"&gt;x=y%2&lt;/td&gt; &lt;td valign="top"&gt;x=1&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;++&lt;/td&gt; &lt;td valign="top"&gt;Increment&lt;/td&gt; &lt;td valign="top"&gt;x=++y&lt;/td&gt; &lt;td valign="top"&gt;x=6 &lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;--&lt;/td&gt; &lt;td valign="top"&gt;Decrement&lt;/td&gt; &lt;td valign="top"&gt;x=--y&lt;/td&gt; &lt;td valign="top"&gt;x=4 &lt;/td&gt; &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;hr /&gt;  &lt;h2&gt;JavaScript Assignment Operators&lt;/h2&gt; &lt;p&gt;Assignment operators are used to assign values to JavaScript  variables.&lt;/p&gt; &lt;p&gt;Given that &lt;b&gt;x=10&lt;/b&gt; and &lt;b&gt;y=5&lt;/b&gt;, the table below explains the assignment operators:&lt;/p&gt;  &lt;table class="ex" border="1" cellspacing="0" width="100%"&gt;  &lt;tbody&gt;&lt;tr&gt; &lt;th align="left" width="15%"&gt;Operator&lt;/th&gt; &lt;th align="left" width="40%"&gt;Example&lt;/th&gt; &lt;th align="left" width="25%"&gt;Same As&lt;/th&gt; &lt;th align="left" width="20%"&gt;Result&lt;/th&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;=&lt;/td&gt; &lt;td valign="top"&gt;x=y&lt;/td&gt; &lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td valign="top"&gt;x=5&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;+=&lt;/td&gt; &lt;td valign="top"&gt;x+=y&lt;/td&gt; &lt;td valign="top"&gt;x=x+y&lt;/td&gt; &lt;td valign="top"&gt;x=15&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;-=&lt;/td&gt; &lt;td valign="top"&gt;x-=y&lt;/td&gt; &lt;td valign="top"&gt;x=x-y&lt;/td&gt; &lt;td valign="top"&gt;x=5&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;*=&lt;/td&gt; &lt;td valign="top"&gt;x*=y&lt;/td&gt; &lt;td valign="top"&gt;x=x*y&lt;/td&gt; &lt;td valign="top"&gt;x=50&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;/=&lt;/td&gt; &lt;td valign="top"&gt;x/=y&lt;/td&gt; &lt;td valign="top"&gt;x=x/y&lt;/td&gt; &lt;td valign="top"&gt;x=2&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;%=&lt;/td&gt; &lt;td valign="top"&gt;x%=y&lt;/td&gt; &lt;td valign="top"&gt;x=x%y&lt;/td&gt; &lt;td valign="top"&gt;x=0&lt;/td&gt; &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;hr /&gt;  &lt;h2&gt;The + Operator Used on Strings&lt;/h2&gt;  &lt;p&gt;The + operator can also be used to add string variables or text values  together.&lt;/p&gt; &lt;p&gt;To add two or more string variables together, use the + operator.&lt;/p&gt;  &lt;table class="ex" border="1" cellspacing="0" width="100%"&gt;   &lt;tbody&gt;     &lt;tr&gt;       &lt;td&gt;         &lt;pre&gt;txt1="What a very";&lt;br /&gt;txt2="nice day";&lt;br /&gt;txt3=txt1+txt2;&lt;/pre&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;After the execution of the statements above, the variable txt3 contains "What a verynice day".&lt;/p&gt;  &lt;p&gt;To add a space between the two strings, insert a space into one of the  strings:&lt;/p&gt;  &lt;table class="ex" border="1" cellspacing="0" width="100%"&gt;   &lt;tbody&gt;     &lt;tr&gt;       &lt;td&gt;         &lt;pre&gt;txt1="What a very ";&lt;br /&gt;txt2="nice day";&lt;br /&gt;txt3=txt1+txt2;&lt;/pre&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;or insert a space into the expression:&lt;/p&gt;  &lt;table class="ex" id="table3" border="1" cellspacing="0" width="100%"&gt;   &lt;tbody&gt;     &lt;tr&gt;       &lt;td&gt;         &lt;pre&gt;txt1="What a very";&lt;br /&gt;txt2="nice day";&lt;br /&gt;txt3=txt1+" "+txt2;&lt;/pre&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;After the execution of the statements above, the variable txt3 contains:&lt;/p&gt; &lt;p&gt;"What a very nice day"&lt;/p&gt;   &lt;hr /&gt;  &lt;h2&gt;Adding Strings and Numbers&lt;/h2&gt;  &lt;p&gt;Look at these examples:&lt;/p&gt;  &lt;table class="ex" id="table5" border="1" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;x=5+5;&lt;br /&gt;document.write(x);&lt;br /&gt;&lt;br /&gt;x="5"+"5";&lt;br /&gt;document.write(x);&lt;br /&gt;&lt;br /&gt;x=5+"5";&lt;br /&gt;document.write(x);&lt;br /&gt;&lt;br /&gt;x="5"+5;&lt;br /&gt;document.write(x);&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;a href="http://www.w3schools.com"&gt;http://www.w3schools.com&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/364606613135475254-1849349298620679206?l=expsharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expsharing.blogspot.com/feeds/1849349298620679206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=364606613135475254&amp;postID=1849349298620679206' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1849349298620679206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/364606613135475254/posts/default/1849349298620679206'/><link rel='alternate' type='text/html' href='http://expsharing.blogspot.com/2008/02/remind-javascript-operators.html' title='Remind Javascript operators'/><author><name>moongy</name><uri>http://www.blogger.com/profile/14151219846841972079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-364606613135475254.post-1951602452517141843</id><published>2008-02-21T19:53:00.000-08:00</published><updated>2008-02-21T22:02:54.429-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQLServer 2005 – SQLExpress Merge Replication Step by Step (Screenshot guide)</title><content type='html'>SQLServer 2005 – SQLExpress  Merge Replication Step by Step&lt;br /&gt;&lt;br /&gt;Here is the result when i did merge replication SQLServer 2005 – SQLExpress. I'm not consider this as a SQL2005 Merge Replication guide, but i hope it useful for someone need it.&lt;br /&gt;You can also refer to SQL 2005 command list at : &lt;a href="http://expsharing.blogspot.com/2007/10/a-z-index-of-sql-server-2005-database.html"&gt;click here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy harvest exp ;).&lt;br /&gt;&lt;span class = "fullpost"&gt;&lt;br /&gt;-------------------------------&lt;br /&gt;&lt;br /&gt;Initials : You need 2 SQL engines to walk throught this exp, SQL 2005 engine and a SQL express engine.&lt;br /&gt;Open SQLServer 2005 Management Studio and create following database:&lt;br /&gt; A SQL2005 database. Example : MyServer.&lt;br /&gt; A SQLExpress database. Example : MyClient.&lt;br /&gt;&lt;br /&gt;Step 1: Configure Distributor&lt;br /&gt;&lt;br /&gt;Expand SQLServer 2005 (in this example is ‘PHU’) and right click on Replication, choose Distributor Configuration.&lt;br /&gt;    &lt;br /&gt;Figure 1.1&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R75JsMY5ljI/AAAAAAAAAL4/Q8OE2gpLB2o/s1600-h/image001.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R75JsMY5ljI/AAAAAAAAAL4/Q8OE2gpLB2o/s400/image001.png" alt="" id="BLOGGER_PHOTO_ID_5169650445856642610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.2&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Mtmv2gkQdGA/R75KwcY5lkI/AAAAAAAAAMA/pcvLMqxB74s/s1600-h/image004.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Mtmv2gkQdGA/R75KwcY5lkI/AAAAAAAAAMA/pcvLMqxB74s/s400/image004.jpg" alt="" id="BLOGGER_PHOTO_ID_5169651618382714434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.3&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Mtmv2gkQdGA/R75K7cY5llI/AAAAAAAAAMI/T1hKcuIKy_Y/s1600-h/image006.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Mtmv2gkQdGA/R75K7cY5llI/AAAAAAAAAMI/T1hKcuIKy_Y/s400/image006.jpg" alt="" id="BLOGGER_PHOTO_ID_5169651807361275474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.4   &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Mtmv2gkQdGA/R75LRcY5lmI/AAAAAAAAAMQ/Eypp1BgXdOQ/s1600-h/image008.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Mtmv2gkQdGA/R75LRcY5lmI/AAAAAAAAAMQ/Eypp1BgXdOQ/s400/image008.jpg" alt="" id="BLOGGER_PHOTO_ID_5169652185318397538" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.5&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Mtmv2gkQdGA/R75LdcY5lnI/AAAAAAAAAMY/AkvN_i3xK4k/s1600-h/image010.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Mtmv2gkQdGA/R75LdcY5lnI/AAAAAAAAAMY/AkvN_i3xK4k/s400/image010.jpg" alt="" id="BLOGGER_PHOTO_ID_5169652391476827762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.6&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R75LnMY5loI/AAAAAAAAAMg/6OKWs5cuJG4/s1600-h/image012.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R75LnMY5loI/AAAAAAAAAMg/6OKWs5cuJG4/s400/image012.jpg" alt="" id="BLOGGER_PHOTO_ID_5169652558980552322" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.7&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_Mtmv2gkQdGA/R75L08Y5lpI/AAAAAAAAAMo/waUbzkYxsC0/s1600-h/image014.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_Mtmv2gkQdGA/R75L08Y5lpI/AAAAAAAAAMo/waUbzkYxsC0/s400/image014.jpg" alt="" id="BLOGGER_PHOTO_ID_5169652795203753618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.8&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Mtmv2gkQdGA/R75MDsY5lqI/AAAAAAAAAMw/Hbcpw3gH8TM/s1600-h/image016.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_Mtmv2gkQdGA/R75MDsY5lqI/AAAAAAAAAMw/Hbcpw3gH8TM/s400/image016.jpg" alt="" id="BLOGGER_PHOTO_ID_5169653048606824098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 2 : Create Publication&lt;br /&gt;&lt;br /&gt;          Figure 2.1&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_Mtmv2gkQdGA/R75MO8Y5lrI/AAAAAAAAAM4/kwcVAvCLs2Y/s1600-h/image019.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_Mtmv2gkQdGA/R75MO8Y5lrI/AAAAAAAAAM4/kwcVAvCLs2Y/s400/image019.gif" alt="" id="BLOGGER_PHOTO_ID_5169653241880352434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.2&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Mtmv2gkQdGA/R75MwcY5lsI/AAAAAAAAANA/WgX3HrmJzm0/s1600-h/image021.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Mtmv2gkQdGA/R75MwcY5lsI/AAAAAAAAANA/WgX3HrmJzm0/s400/image021.jpg" alt="" id="BLOGGER_PHOTO_ID_5169653817405970114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.3&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R75M_MY5ltI/AAAAAAAAANI/ELbpsnFvMfo/s1600-h/image023.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R75M_MY5ltI/AAAAAAAAANI/ELbpsnFvMfo/s400/image023.jpg" alt="" id="BLOGGER_PHOTO_ID_5169654070809040594" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.4&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Mtmv2gkQdGA/R75NKsY5luI/AAAAAAAAANQ/-Rj5blPlVDE/s1600-h/image025.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_Mtmv2gkQdGA/R75NKsY5luI/AAAAAAAAANQ/-Rj5blPlVDE/s400/image025.jpg" alt="" id="BLOGGER_PHOTO_ID_5169654268377536226" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.5&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Mtmv2gkQdGA/R75NZsY5lvI/AAAAAAAAANY/YtyoAvL_TCc/s1600-h/image027.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_Mtmv2gkQdGA/R75NZsY5lvI/AAAAAAAAANY/YtyoAvL_TCc/s400/image027.jpg" alt="" id="BLOGGER_PHOTO_ID_5169654526075574002" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.6&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R75NkMY5lwI/AAAAAAAAANg/5GO03h_79pM/s1600-h/image029.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R75NkMY5lwI/AAAAAAAAANg/5GO03h_79pM/s400/image029.jpg" alt="" id="BLOGGER_PHOTO_ID_5169654706464200450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.7&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R75NuMY5lxI/AAAAAAAAANo/Vq-42FVyzAU/s1600-h/image031.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R75NuMY5lxI/AAAAAAAAANo/Vq-42FVyzAU/s400/image031.jpg" alt="" id="BLOGGER_PHOTO_ID_5169654878262892306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.8&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R75OEMY5lyI/AAAAAAAAANw/8FyizxD8kJ8/s1600-h/image033.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R75OEMY5lyI/AAAAAAAAANw/8FyizxD8kJ8/s400/image033.jpg" alt="" id="BLOGGER_PHOTO_ID_5169655256220014370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.9&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Mtmv2gkQdGA/R75OTcY5lzI/AAAAAAAAAN4/TN-JNSsveUk/s1600-h/image035.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Mtmv2gkQdGA/R75OTcY5lzI/AAAAAAAAAN4/TN-JNSsveUk/s400/image035.jpg" alt="" id="BLOGGER_PHOTO_ID_5169655518213019442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.10&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R75OhMY5l0I/AAAAAAAAAOA/TtfS7xK1Cl0/s1600-h/image037.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R75OhMY5l0I/AAAAAAAAAOA/TtfS7xK1Cl0/s400/image037.jpg" alt="" id="BLOGGER_PHOTO_ID_5169655754436220738" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.11&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Mtmv2gkQdGA/R75OocY5l1I/AAAAAAAAAOI/wvkB7bmAi6g/s1600-h/image039.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Mtmv2gkQdGA/R75OocY5l1I/AAAAAAAAAOI/wvkB7bmAi6g/s400/image039.jpg" alt="" id="BLOGGER_PHOTO_ID_5169655878990272338" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.12&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R75OyMY5l2I/AAAAAAAAAOQ/BfmZP8kMlrU/s1600-h/image041.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R75OyMY5l2I/AAAAAAAAAOQ/BfmZP8kMlrU/s400/image041.jpg" alt="" id="BLOGGER_PHOTO_ID_5169656046493996898" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.13&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R75O6MY5l3I/AAAAAAAAAOY/tXczLHdyqkQ/s1600-h/image043.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R75O6MY5l3I/AAAAAAAAAOY/tXczLHdyqkQ/s400/image043.jpg" alt="" id="BLOGGER_PHOTO_ID_5169656183932950386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.14&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Mtmv2gkQdGA/R75PDcY5l4I/AAAAAAAAAOg/4GRrLPMJRw4/s1600-h/image045.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Mtmv2gkQdGA/R75PDcY5l4I/AAAAAAAAAOg/4GRrLPMJRw4/s400/image045.jpg" alt="" id="BLOGGER_PHOTO_ID_5169656342846740354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 3 : Create Subcription&lt;br /&gt;          Figure 3.1&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_Mtmv2gkQdGA/R75PPMY5l5I/AAAAAAAAAOo/cgDMXCJoAYI/s1600-h/image047.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_Mtmv2gkQdGA/R75PPMY5l5I/AAAAAAAAAOo/cgDMXCJoAYI/s400/image047.jpg" alt="" id="BLOGGER_PHOTO_ID_5169656544710203282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.2&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Mtmv2gkQdGA/R75PbcY5l6I/AAAAAAAAAOw/luittZ3Ru5g/s1600-h/image049.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: 
