<?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:blogger='http://schemas.google.com/blogger/2008' 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-924899381377359504</id><updated>2024-09-24T18:58:41.761+05:30</updated><category term="c#"/><category term="asp.net"/><category term=".net"/><category term="C#.net"/><category term="csharp"/><category term="Web"/><category term="web communictions"/><category term="Web Browser"/><category term="Web server"/><category term="Windows"/><category term="Windows Application"/><category term="client"/><category term="client-server"/><category term="dotnet"/><category term="web application"/><category term="DDLtrigger"/><category term="DMLtrigger"/><category term="Design"/><category term="ExecCommand()"/><category term="Grey Out"/><category term="Grey Out Effect"/><category term="Html Content"/><category term="Light Box"/><category term="Light Box Effect"/><category term="Paste()"/><category term="Patterns"/><category term="Popup Window"/><category term="Rich Text Box"/><category term="SQL"/><category term="Thick Box"/><category term="Thick Box Effect"/><category term="Trigger"/><category term="WinForms"/><category term="convert object to xml"/><category term="convert xml to object"/><category term="deserialization"/><category term="directory"/><category term="file"/><category term="folder"/><category term="keyword"/><category term="open files"/><category term="serialization"/><category term="server"/><category term="sqlserver"/><category term="using"/><category term="webapplication"/><category term="xml"/><category term="xml document"/><title type='text'>DotNetCypher</title><subtitle type='html'>...Just apply the thoughts in coding</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-924899381377359504.post-2209194403154290529</id><published>2013-12-28T22:29:00.000+05:30</published><updated>2013-12-28T22:29:10.756+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="C#.net"/><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Design"/><category scheme="http://www.blogger.com/atom/ns#" term="Patterns"/><title type='text'>Design Patterns in CSharp</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; margin-bottom: 12.75pt; mso-margin-top-alt: auto;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;What is design Pattern in c#?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;
Design Patterns are categorized into 3 types and they are:&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Creational
     Design Patterns.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Structural
     Design Patterns.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Behavioral
     Design Patterns.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; margin-bottom: 12.75pt; mso-margin-top-alt: auto;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;What are Creational Design Patterns?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;
These patterns deal with the process of objects creation. The flowing are the
different types of Creational Design patterns.&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Abstract
     Factory Pattern: - Create instances of several classes belonging to
     different families.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Factory
     Pattern: - Create instances of derived classes.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Builder
     Pattern: - Separates an object construction from its representation.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Lazy
     Pattern: - Create a duplicate object or clone of the object.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Prototype
     Pattern: - Specify the kind of objects to create using a prototypical
     instance, and create new objects by copying this prototype.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Singleton
     Pattern: - Ensures that a class can have only one instance.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; margin-bottom: 12.75pt; mso-margin-top-alt: auto;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;What are Structural Design Patterns?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;
These patterns deal with the composition of objects structures. The flowing are
the different types of Structural Design patterns.&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Adapter
     Pattern: - Interfaces of classes vary depending on the requirement.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Bridge
     Pattern: - Class level abstraction is separated from its implementation.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Composite
     Pattern: - Individual objects &amp;amp; a group of objects are treated
     similarly in this approach.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Decorator
     Pattern: - Functionality is assigned to an object.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Facade
     Pattern: - A common interface is created for a group of interfaces sharing
     a similarity.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Flyweight
     Pattern: - The concept of sharing a group of small sized objects.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Proxy
     Pattern: - When an object is complex and needs to be shared, its copies
     are made. These copies are called the proxy objects.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; margin-bottom: 12.75pt; mso-margin-top-alt: auto;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;What are Behavioral Design Patterns?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;
These patterns deal with the process of communication, managing relationships,
and responsibilities between objects. The flowing are the different types of
Behavioral Design patterns.&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Chain
     Or Responsibilities Pattern: - In this pattern, objects communicate with
     each other depending on logical decisions made by a class.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Command
     Pattern: - In this pattern, objects encapsulate methods and the parameters
     passed to them.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Observer
     Pattern: - Define a one-to-many dependency between objects so that when
     one object changes state, all its dependents are notified and updated
     automatically.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Interpreter
     Pattern: - A way to include language elements in a program.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Iterator
     Pattern: - Provide a way to access the elements of an aggregate object
     sequentially without exposing its underlying representation.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Mediator
     Pattern: - Define an object that encapsulates how a set of objects
     interact. In other words, it defines simplified communication between
     classes.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Memento
     Pattern: - Without violating encapsulation, capture and externalize an
     object&#39;s internal state so that the object can be restored to this state
     later.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;State
     Pattern: - Allow an object to alter its behavior when its internal state
     changes. The object will appear to change its class.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Strategy
     Pattern: - Define a family of algorithms, encapsulate each one, and make
     them interchangeable. Strategy lets the algorithm vary independently from
     clients that use it.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Visitor
     Pattern: - Defines a new operation to a class without change.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Template
     Method Pattern: - Defer the exact steps of an algorithm to a subclass.&lt;/span&gt;&lt;span style=&quot;font-size: 11.5pt; mso-ascii-font-family: Calibri; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN; mso-hansi-font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/2209194403154290529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetcypher.blogspot.com/2013/12/design-patterns-in-csharp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/2209194403154290529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/2209194403154290529'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/2013/12/design-patterns-in-csharp.html' title='Design Patterns in CSharp'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-924899381377359504.post-7052957450874254366</id><published>2012-09-09T15:46:00.001+05:30</published><updated>2012-09-09T16:29:55.949+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="DDLtrigger"/><category scheme="http://www.blogger.com/atom/ns#" term="DMLtrigger"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="sqlserver"/><category scheme="http://www.blogger.com/atom/ns#" term="Trigger"/><title type='text'>What is Trigger?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;i&gt;A Trigger is a SQL procedure that initiates an action when an events INSERT, DELETE , UPDATE occurs. &lt;/i&gt;Triggers are stored in and managed by the DBMS.Triggers are used to maintain the referential integrity of data by changing the data in a systematic fashion. A trigger cannot be called or executed; the DBMS automatically fires the trigger as a result of a data modification to the associated table. Triggers can be viewed as similar to stored procedures in that both consist of procedural logic that is stored at the database level. Stored procedures, however, are not event-driven and are not attached to a specific table as triggers. Stored procedures are explicitly executed by invoking the procedure while triggers are implicitly executed. In addition, triggers can also execute stored procedures.&lt;br /&gt;
&lt;br /&gt;
Nested Trigger: A trigger can also contain INSERT, UPDATE and DELETE logic within itself, so when the trigger is fired because of data modification it can also cause another data modification, thereby firing another trigger. &lt;i&gt;A trigger that contains data modification logic within itself is called a nested trigger.&lt;/i&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Two types of Triggers&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;

&lt;b&gt;&lt;i&gt;1)  DML Trigger&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
DML is abbreviation of Data Manipulation Level. DML contains the actual data which is stored in the database schema. UPDATE, INSERT, DELETE, SELECT clause are used to manipulate database.&amp;nbsp;
&lt;br /&gt;
There are two types of DML Triggers&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 1.Instead of Trigger:-&amp;nbsp;Instead of Triggers are fired in place of the triggering action such as an insert, update, delete.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 2.After Trigger:-&amp;nbsp;&amp;nbsp;After triggers execute following the triggering action, such as an insert, update, delete.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;2)    DDL Trigger&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
DDL is abbreviation of Data Definition Level. DDL contains schema of the database object. It was always dream of all DBA, when change in mission critical schema of the database or server is attempted it is prevented immediately informing DBA and users automatically. DDL Trigger can now make this dream true. Definition of DDL Trigger is a special kind of trigger that fire in response to Data Definition Language (DDL) statements. They can be used to perform administrative tasks in the database such as auditing and regulating database operations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/7052957450874254366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetcypher.blogspot.com/2012/09/what-is-trigger.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/7052957450874254366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/7052957450874254366'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/2012/09/what-is-trigger.html' title='What is Trigger?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-924899381377359504.post-5630890376272412508</id><published>2012-02-28T01:33:00.000+05:30</published><updated>2012-03-11T21:00:44.267+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#.net"/><category scheme="http://www.blogger.com/atom/ns#" term="convert object to xml"/><category scheme="http://www.blogger.com/atom/ns#" term="convert xml to object"/><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="deserialization"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="serialization"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><category scheme="http://www.blogger.com/atom/ns#" term="xml document"/><title type='text'>How to convert the object to xml and xml to object.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Convert the object to xml using XML Serializer class. XML Serialization coverts (Serializes) the public fields and properties of an object, or parameters and return values of method, into an XML stream. &lt;br /&gt;
&lt;br /&gt;
The following namespaces are required for this xml serialization.&lt;br /&gt;
&lt;i&gt;&lt;b&gt;using System.IO;&lt;br /&gt;
using System.Xml;&lt;br /&gt;
using System.Xml.Serialization;&lt;br /&gt;
&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
To show this conversion, creating sample class called student. It looks like following &lt;br /&gt;
&lt;b&gt;Student class:-&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
/// class for student properties&lt;br /&gt;
public class Student&lt;br /&gt;
{&lt;br /&gt;
public int StudentId { set; get; }&lt;br /&gt;
public string StudentName { set; get; }&lt;br /&gt;
public DateTime DOB { set; get; }&lt;br /&gt;
public string address { set; get; }&lt;br /&gt;
}&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Object to Xml:-&lt;/b&gt;&lt;br /&gt;
Now create the following class instances for the serialization of the object&lt;br /&gt;
1) XmlDocument object to represents the converted xml&lt;br /&gt;
2) XmlSerializer object to covert (Serialize) the public fields and properties of an object, or parameters and&lt;br /&gt;
return values of method, into an XML stream. &lt;br /&gt;
3) MemoryStream object to hold the serialized stream in memory.&lt;br /&gt;
After creating all the above instances call the serialize method of XmlSerializer object with parameters stream and object, it converts the object to stream and store into passed stream object and set the stream position to begin.&lt;br /&gt;
Now load this stream in to xml document by calling the Load() of XmlDocument object. &lt;br /&gt;
&lt;i&gt;&lt;b&gt;    &lt;br /&gt;
/// Method to convert the object to xml using XmlSerializer.&lt;br /&gt;
public static XmlDocument ConvertToXml(Student student)&lt;br /&gt;
{&lt;br /&gt;
MemoryStream ObjStream = new MemoryStream();&lt;br /&gt;
XmlDocument ObjDocument = new XmlDocument();&lt;br /&gt;
XmlSerializer ObjSerializer = new XmlSerializer(student.GetType());&lt;br /&gt;
ObjSerializer.Serialize(ObjStream, student);&lt;br /&gt;
ObjStream.Seek(0, SeekOrigin.Begin);&lt;br /&gt;
ObjDocument.Load(ObjStream);&lt;br /&gt;
return ObjDocument;&lt;br /&gt;
}&lt;br /&gt;
&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;b&gt;Xml to object:-&lt;/b&gt;&lt;br /&gt;
Deserialize to the object from the xmlDocument object or xml file using the Deserialize method of XmlSerializer class and StringReader object which holds the xml content.&lt;br /&gt;
&lt;i&gt;&lt;b&gt;        &lt;br /&gt;
/// Method to convert the xml to object using XmlSerializer.&lt;br /&gt;
public static Student ConvertToObject(XmlDocument document)&lt;br /&gt;
{&lt;br /&gt;
Student ObjStudent = new Student();&lt;br /&gt;
StringReader ObjReader = new StringReader(document.InnerXml);&lt;br /&gt;
XmlSerializer ObjSerializer = new XmlSerializer(typeof(Student));&lt;br /&gt;
ObjStudent = (Student)ObjSerializer.Deserialize(new XmlTextReader(ObjReader));&lt;br /&gt;
return ObjStudent;&lt;br /&gt;
}  &lt;br /&gt;
&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
Call these methods form any of the class like following&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;
/// Fill the student class object with values&lt;br /&gt;
Student student = new Student();&lt;br /&gt;
student.StudentId = 1;&lt;br /&gt;
student.StudentName = &quot;Tom Smith&quot;;&lt;br /&gt;
student.DOB = DateTime.Now;&lt;br /&gt;
student.address = &quot;Chennai,India&quot;;&lt;br /&gt;
&lt;br /&gt;
/// Call the Convert to xml method&lt;br /&gt;
XmlDocument xmlDocument = new XmlDocument();&lt;br /&gt;
xmlDocument = XmlOperation.ConvertToXml(student);&lt;br /&gt;
&lt;br /&gt;
/// Call the Convert to object method&lt;br /&gt;
Student student1 = new Student();&lt;br /&gt;
student1 = XmlOperation.ConvertToObject(xmlDocument);&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/5630890376272412508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetcypher.blogspot.com/2012/02/how-to-convert-object-to-xml-and-xml-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/5630890376272412508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/5630890376272412508'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/2012/02/how-to-convert-object-to-xml-and-xml-to.html' title='How to convert the object to xml and xml to object.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-924899381377359504.post-8520546559824170918</id><published>2011-10-29T15:51:00.000+05:30</published><updated>2012-02-19T01:41:09.625+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="keyword"/><category scheme="http://www.blogger.com/atom/ns#" term="using"/><title type='text'>&quot;using&quot; keyword in c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;All the c# programmers daily coding life start&#39;s with &quot;using&quot; why i am saying like this,the first word of the every c# code file is &quot;using&quot;. so we have to know what is this first word ? How to use it?.That&#39;s what i am trying to explain in this post here.&lt;br /&gt;
In c#,we can use the using keyword as two possible ways are as a Directive and  as a Statement.&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;1) using as a directive:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
1) As all the programmers know using is used to &lt;b&gt;importing &lt;/b&gt;the namespaces.we can use types available in that namespaces by declaring the namespace with &quot;using&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Example:-&lt;i&gt; using System.Web;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
For example here i am importing the System.Web namespace,now i can use all the types like &lt;i&gt;HtmlString, HttpApplication, HttpApplicationState &lt;/i&gt;etc. of Web namespace in further coding of current file.&lt;br /&gt;
&lt;br /&gt;
2) Also use to define the &lt;b&gt;alias &lt;/b&gt;for the nested namspaces.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Example:- &lt;i&gt;using MyControls=MyComponent.Web.UI.Controls.;&lt;/i&gt;&lt;br /&gt;
In the above example, we can use Mycontrols instead of using&amp;nbsp;MyComponent.Web.UI.Controls to use Controls class like.&lt;br /&gt;
&lt;i&gt;MyComponent.Web.UI.Controls objControl=new&amp;nbsp;MyComponent.Web.UI.Controls();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;MyControls&amp;nbsp;objControl=new MyControls();&lt;/i&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;2) using as a statement:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
When we use &quot;using&quot; as Statement it defines the &lt;b&gt;scope &lt;/b&gt;and allows the programmer to release the resources used by the object in the defined scope.&lt;br /&gt;
&lt;i&gt;&lt;b&gt;with out using keyword:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
A simple and straightforward &amp;nbsp;approach to connect to a database server and read data&lt;br /&gt;
&amp;nbsp;&lt;i&gt; SqlConnection con = new SqlConnection(conString);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; SqlDataReader reader = null;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;SqlCommand cmd = new SqlCommand(&lt;/i&gt;&lt;i&gt;cmdString,&lt;/i&gt;&lt;i&gt;con);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;con .Open();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;reader = cmd.ExecuteReader();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;while (reader.Read())&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Do&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; reader.Close();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;con .Close();&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
However, the above given code may generate error.&lt;br /&gt;
If any exception occurs inside while block it throws exception the connection.close() process will not executed due to the exception.To avoid this situation, we can take the help of the try....catch... finally block &amp;nbsp; by closing the connection inside the finally block or inside the catch block.&lt;br /&gt;
&lt;b&gt;&lt;i&gt;with using&amp;nbsp;keyword:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&quot;Using&quot; keyword takes the parameter of type &lt;i&gt;IDisposable&lt;/i&gt;.Whenever you are using any &lt;i&gt;IDisposable &lt;/i&gt;type object you should use the &quot;using&quot; keyword &amp;nbsp;to handle automatically when it should close or dispose.Internally using keyword calls the &lt;i&gt;Dispose&lt;/i&gt;() method to dispose the IDisposable object.&lt;br /&gt;
So the code will be modified like :&lt;br /&gt;
&lt;i&gt;using(SqlConnection con= new SqlConnection(conString) )&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlCommand cmd = new SqlCommand(cmdString, con);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; con.Open();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;using (SqlDataReader reader = cmd.ExecuteReader())&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (reader.Read())&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//&amp;nbsp;&lt;/i&gt;&lt;i&gt;statements&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;
&amp;nbsp;In the above code &amp;nbsp;if any exception occurs then dispose() will be called and connection will closed automatically.&lt;br /&gt;
&lt;br /&gt;
Multiple objects can be used in with a using statement, but they must&amp;nbsp;be declared inside the using statement.&lt;br /&gt;
In the above example also we used multiple objects are cmd,reader.so we removed the both objects closed methods.&lt;br /&gt;
Example:-&lt;br /&gt;
&lt;i&gt;using (Type t1 = v1, t2 = v2, …, tN = vN)&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;//statements&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
or &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &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;
&lt;i&gt;using (Type r1 = v1)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;using (Type t2 = v2)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; …......&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;using (Type tN = vN)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// statement&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;}&lt;/i&gt;&lt;br /&gt;
Above both code examples are equal.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/8520546559824170918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetcypher.blogspot.com/2011/10/using-keyword-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/8520546559824170918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/8520546559824170918'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/2011/10/using-keyword-in-c.html' title='&quot;using&quot; keyword in c#'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-924899381377359504.post-685798011905032778</id><published>2011-09-23T13:04:00.000+05:30</published><updated>2012-03-11T22:45:29.977+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="C#.net"/><category scheme="http://www.blogger.com/atom/ns#" term="Grey Out"/><category scheme="http://www.blogger.com/atom/ns#" term="Grey Out Effect"/><category scheme="http://www.blogger.com/atom/ns#" term="Light Box"/><category scheme="http://www.blogger.com/atom/ns#" term="Light Box Effect"/><category scheme="http://www.blogger.com/atom/ns#" term="Popup Window"/><category scheme="http://www.blogger.com/atom/ns#" term="Thick Box"/><category scheme="http://www.blogger.com/atom/ns#" term="Thick Box Effect"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Application"/><category scheme="http://www.blogger.com/atom/ns#" term="WinForms"/><title type='text'>Light box Effect in .net  Windows application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Lightbox is an effect that fades the pagein the background to show you new content in the foreground.&lt;br /&gt;
We may call it Lightbox, or Greybox, or Thickbox, but it’s always the same effect&lt;br /&gt;
&lt;br /&gt;
We can add this effect easily in web application using javascript, css or any of third party plugins like Jquery, ajax. Now we can see how to add the Light Box effect in Windows Forms in sinple way with out using any javascript or any third party dll&#39;s.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Create two forms namely Form1 and Form2.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Set following properties for the Form2.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;BackColor=ControlDark&amp;nbsp; (&lt;span style=&quot;color: #cc0000;&quot;&gt;what color we want to show,we can select that color&lt;/span&gt;)&lt;/li&gt;
&lt;li&gt;FormBorderStyle=None&lt;/li&gt;
&lt;li&gt;ShowInTaskbar=False&lt;/li&gt;
&lt;li&gt;SizeGripStyle=Hide&lt;/li&gt;
&lt;li&gt;StartPosition=Manual&lt;/li&gt;
&lt;li&gt;Opacity=50%(&lt;span style=&quot;color: #cc0000;&quot;&gt;opacity value depends on visiblity of background form controls&lt;/span&gt;).&lt;/li&gt;
&lt;/ul&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 3. Place the button in the Form1,write the following code in the button click event &lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;i&gt;&amp;nbsp; private void button1_Click(object sender, EventArgs e)&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; Form2 form2 = new Form2();&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; form2.SuspendLayout();&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; int BorderWidth = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt; //Get the border width values of the form&lt;/span&gt;&lt;i&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; if (this.VerticalScroll.Visible == true)&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; BorderWidth = (this.Width - (this.ClientSize.Width +&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SystemInformation.VerticalScrollBarWidth)) / 2;&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; else&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; BorderWidth = (this.Width - this.ClientSize.Width) / 2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt; //Get the Title bar height of the form&lt;/span&gt;&lt;i&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; int TitlebarHeight = this.Height - this.ClientSize.Height - 2 * BorderWidth;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;//Setting the Current form(Form1) bounds to the Form2 bounds&lt;/span&gt;&lt;i&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; if (this.VerticalScroll.Visible == true)&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; form2.SetBounds(this.Left, this.Top + TitlebarHeight + BorderWidth, this.ClientSize.Width+ SystemInformation.VerticalScrollBarWidth + BorderWidth * 2,this.ClientSize.Height + BorderWidth);&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; else&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; form2.SetBounds(this.Left, this.Top + TitlebarHeight + BorderWidth, this.ClientSize.Width+BorderWidth * 2, this.ClientSize.Height + BorderWidth);&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; form2.PerformLayout();&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; form2.Owner = this;&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; form2.Show();&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&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 style=&quot;color: #cc0000;&quot;&gt; // Here we can show popup window /Dialog box/another form also like Message Box shown in this code.&lt;/span&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; MessageBox.Show(this,&quot;This is the light box effect&quot;,&quot;DotNetCypher&quot;, MessageBoxButtons.OK ,MessageBoxIcon.Information);&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; form2.Close();&lt;span style=&quot;color: #cc0000;&quot;&gt;//disableing the effect&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Here are the output forms looks like.. &lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Before Light Box:-&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrux1eA49tYh2VBPdMxdXWJxiNDUjfgqlSb_BYne8zLAI6alwyUr6cXSQNi-xMzAbLTpsXi2rvhkAPhClerrMGNVoWaRmdFCwXUsv8RdK_kdJA7q1jFXbiFxAwrokp7WuKFV_jsukceww/s1600/LightBoxBefor.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;348&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrux1eA49tYh2VBPdMxdXWJxiNDUjfgqlSb_BYne8zLAI6alwyUr6cXSQNi-xMzAbLTpsXi2rvhkAPhClerrMGNVoWaRmdFCwXUsv8RdK_kdJA7q1jFXbiFxAwrokp7WuKFV_jsukceww/s400/LightBoxBefor.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWJYzaHXHU4Q5LAo_YB7tqFppGoDlW__355hkeSdG5CfLqRqzM1ci4f6hacX0_yWx6aRxdgGxRn3JmcFOoiSD1JTZZtzUuWMgaZRAXFvvQ0Zhhstlq6xhRTwv9suCzdZ4sRcQBSmuclKU/s1600/LightBoxAfterpng.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
After Light Box :-&lt;span id=&quot;goog_1263467436&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1263467437&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWJYzaHXHU4Q5LAo_YB7tqFppGoDlW__355hkeSdG5CfLqRqzM1ci4f6hacX0_yWx6aRxdgGxRn3JmcFOoiSD1JTZZtzUuWMgaZRAXFvvQ0Zhhstlq6xhRTwv9suCzdZ4sRcQBSmuclKU/s1600/LightBoxAfterpng.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;347&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWJYzaHXHU4Q5LAo_YB7tqFppGoDlW__355hkeSdG5CfLqRqzM1ci4f6hacX0_yWx6aRxdgGxRn3JmcFOoiSD1JTZZtzUuWMgaZRAXFvvQ0Zhhstlq6xhRTwv9suCzdZ4sRcQBSmuclKU/s400/LightBoxAfterpng.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/685798011905032778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetcypher.blogspot.com/2011/09/light-box-effect-in-net-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/685798011905032778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/685798011905032778'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/2011/09/light-box-effect-in-net-windows.html' title='Light box Effect in .net  Windows application'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrux1eA49tYh2VBPdMxdXWJxiNDUjfgqlSb_BYne8zLAI6alwyUr6cXSQNi-xMzAbLTpsXi2rvhkAPhClerrMGNVoWaRmdFCwXUsv8RdK_kdJA7q1jFXbiFxAwrokp7WuKFV_jsukceww/s72-c/LightBoxBefor.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-924899381377359504.post-3097272592215898071</id><published>2011-09-22T18:11:00.000+05:30</published><updated>2012-02-19T01:39:59.188+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="C#.net"/><category scheme="http://www.blogger.com/atom/ns#" term="ExecCommand()"/><category scheme="http://www.blogger.com/atom/ns#" term="Html Content"/><category scheme="http://www.blogger.com/atom/ns#" term="Paste()"/><category scheme="http://www.blogger.com/atom/ns#" term="Rich Text Box"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Browser"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Application"/><title type='text'>Displaying the HTML format content into Rich text box using c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;In general way .net programmers use the built-in web browser control to display the HTML format content in the windows applications.it is very simple to do.But the web browser control visual appearance (font wise) is not same as the windows controls (Label,Rich Text Box) appearance.we never get windows font look using web browser control because always there is difference between web and windows visualization.&lt;br /&gt;
To over come this apply the simple trick here.&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&amp;nbsp;Place the rich text box control in the form.&lt;/li&gt;
&lt;li&gt;Create the Web Browser control form the code behind&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Bind the html content to web browser. &lt;/li&gt;
&lt;li&gt;Select and copy the html content Using the HTML document ExecCommand() &lt;/li&gt;
&lt;li&gt;Paste content to rich text box using the paste() method of Rich text box&lt;/li&gt;
&lt;/ol&gt;Here is the code looks like.&lt;br /&gt;
&lt;br /&gt;
var webBrowser = new WebBrowser();&lt;br /&gt;
webBrowser.CreateControl(); // only if needed&lt;br /&gt;
webBrowser.DocumentText = &quot;&lt;code&gt;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;b&amp;gt;DotnetCyphers&lt;/code&gt;&lt;code&gt;&amp;lt;/b&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&quot;;&lt;/code&gt;&lt;br /&gt;
while (webBrowser.DocumentText != &quot;&lt;code&gt;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;b&amp;gt;DotnetCyphers&lt;/code&gt;&lt;code&gt;&amp;lt;/b&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/code&gt;&quot;)&lt;br /&gt;
&lt;br /&gt;
Application.DoEvents();&lt;br /&gt;
webBrowser.Document.ExecCommand(&quot;SelectAll&quot;, false, null);&lt;br /&gt;
webBrowser.Document.ExecCommand(&quot;Copy&quot;, false, null);&lt;br /&gt;
richTextBox1.Paste();&lt;br /&gt;
richTextBox1.ReadOnly = true;&lt;br /&gt;
&lt;br /&gt;
ExecCommand() executes a command on the current document,/current selection/ the given range.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/3097272592215898071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetcypher.blogspot.com/2011/09/displaying-html-content-into-rich-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/3097272592215898071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/3097272592215898071'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/2011/09/displaying-html-content-into-rich-text.html' title='Displaying the HTML format content into Rich text box using c#'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-924899381377359504.post-756159643124341042</id><published>2011-08-10T00:10:00.001+05:30</published><updated>2012-03-11T20:58:19.092+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="client-server"/><category scheme="http://www.blogger.com/atom/ns#" term="Web"/><category scheme="http://www.blogger.com/atom/ns#" term="web application"/><category scheme="http://www.blogger.com/atom/ns#" term="web communictions"/><category scheme="http://www.blogger.com/atom/ns#" term="Web server"/><title type='text'>Web Server’s Role</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Web Server &lt;/b&gt;can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver content that can be accessed through the Internet.&lt;br /&gt;
The primary function of a web server is to deliver web pages on the request to clients. This means delivery of HTML documents and any additional content that may be included by a document, such as images, style sheets and scripts.&lt;br /&gt;
&lt;br /&gt;
The most common use of web servers is to host web sites but there are other uses like data storage or for running enterprise applications.&lt;br /&gt;
&lt;br /&gt;
The web server provides the content and the web browser displays it to the user. At the simplest,a web server sends static files, such as static HTML or image files, through an HTTP connection to a web browser.&lt;br /&gt;
&lt;br /&gt;
Modern web servers do far more, however. When a web server receives a request, some of the actions it takes are to:&lt;br /&gt;
&lt;b&gt;1. Verify that the request is structured legitimately.&lt;/b&gt;&lt;br /&gt;
Sometimes, malicious clients send malformed web requests to compromise web servers. Web servers must be able to detect this and respond appropriately—usually by ignoring the request.&lt;br /&gt;
&lt;b&gt;2. Authenticate itself.&lt;/b&gt;&lt;br /&gt;
If the server has a Secure Sockets Layer (SSL) certificate and the request was made with HTTPS, the web browser uses the certificate to authenticate the server. The web server will also encrypt all content before returning it to the web browser.&lt;br /&gt;
&lt;b&gt;3. Authenticate the user.&lt;/b&gt;&lt;br /&gt;
If the content requires authorization, the web server verifies that the user has submitted credentials. If the user has not been authenticated, the web server redirects the user to an authentication form.&lt;br /&gt;
&lt;b&gt;4. Authorize the user.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt; After the Web server authenticates the user, the web server verifies that the user is allowed to access the requested content.&lt;br /&gt;
&lt;b&gt;5. Determine how to handle a request.&lt;/b&gt;&lt;br /&gt;
If the web browser requested static content or was simply determining whether cached content could still be used, the web server can directly respond. If the web browser requested an ASP.NET page, the web server must forward the request to ASP.NET.&lt;br /&gt;
&lt;b&gt;6. Handle errors.&lt;/b&gt;&lt;br /&gt;
If a server cannot process the user’s request, it provides error information to the web browser.&lt;br /&gt;
&lt;b&gt;7. Cache output.&lt;/b&gt;&lt;br /&gt;
Web servers can cache output to improve the response time of subsequent requests. Web servers also provide caching information to web browsers, so browsers know how long to keep content cached.&lt;br /&gt;
&lt;b&gt;8. Compress output.&lt;/b&gt;&lt;br /&gt;
Before returning a page to a web browser, a web server can compress the content to reduce the bandwidth required.&lt;br /&gt;
&lt;b&gt;9. Log access.&lt;/b&gt;&lt;br /&gt;
Web servers typically record usage information for security and performance-monitoring purposes.&lt;br /&gt;
&lt;br /&gt;
For more information about web server see following links&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_server&quot;&gt;http://en.wikipedia.org/wiki/Web_server&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.webdevelopersnotes.com/basics/what_is_web_server.php&quot;&gt;http://www.webdevelopersnotes.com/basics/what_is_web_server.php&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://create-website.org/concepts/webserver.html&quot;&gt;http://create-website.org/concepts/webserver.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/756159643124341042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetcypher.blogspot.com/2011/08/web-servers-role_09.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/756159643124341042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/756159643124341042'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/2011/08/web-servers-role_09.html' title='Web Server’s Role'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-924899381377359504.post-8635962685420892491</id><published>2011-08-10T00:08:00.001+05:30</published><updated>2012-03-11T20:59:07.198+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="client"/><category scheme="http://www.blogger.com/atom/ns#" term="client-server"/><category scheme="http://www.blogger.com/atom/ns#" term="Web"/><category scheme="http://www.blogger.com/atom/ns#" term="web application"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Browser"/><category scheme="http://www.blogger.com/atom/ns#" term="web communictions"/><title type='text'>Web Browser’s Role</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;client&lt;/b&gt; is an application that runs on a personal computer and relies on a server to perform operations.In our case web browser is the client to access web pages resides on the web server.&lt;br /&gt;
&lt;b&gt;web browser&lt;/b&gt; is a software application for retrieving, presenting, and traversing information resources on the World Wide Web.&lt;br /&gt;
Their role is relatively simple:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. Send requests to the web server.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;If the user enters &lt;a href=&quot;http://dotnetcypher.blogspot.com/&quot;&gt;http://www.dotnetcypher.com&lt;/a&gt;, the web browser resolves the&lt;a href=&quot;http://dotnetcypher.blogspot.com/&quot;&gt; www.dotnetcypher.com&lt;/a&gt; Domain Name System (DNS) address, uses HTTP to connect to the server, and requests a page.&lt;br /&gt;
&lt;b&gt;2. Authenticate the server. &lt;/b&gt;&lt;br /&gt;
If the server has an SSL certificate and the request was made with HTTPS, the web browser uses the certificate to authenticate the server and then decrypt future communications.&lt;br /&gt;
&lt;b&gt;3. Process the response.&lt;/b&gt;&lt;br /&gt;
If the server has provided HTML, the browser retrieves embedded objects, such as images, videos, or animations referenced in the HTML. If the server has provided an error, redirection, or other response, the browser responds appropriately.&lt;br /&gt;
&lt;b&gt;4. Display HTML and embedded objects.&lt;/b&gt;&lt;br /&gt;
Web browsers use HTML standards to determine how to display a webpage to the user. Because HTML can contain embedded objects, a web browser might have to display dozens of objects to render a single webpage.&lt;br /&gt;
&lt;b&gt;5. Run client scripts.&lt;/b&gt;&lt;br /&gt;
Client scripts, such as those written in JavaScript, enable interactive and responsive pages without reloading the page.&lt;br /&gt;
&lt;br /&gt;
Here are the more links.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.allaboutcookies.org/browsers/index.html&quot;&gt;http://www.allaboutcookies.org/browsers/index.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://create-website.org/concepts/webbrowser.html&quot;&gt;http://create-website.org/concepts/webbrowser.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/8635962685420892491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetcypher.blogspot.com/2011/08/web-browsers-role_09.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/8635962685420892491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/8635962685420892491'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/2011/08/web-browsers-role_09.html' title='Web Browser’s Role'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-924899381377359504.post-7056619288183710152</id><published>2011-08-09T16:11:00.000+05:30</published><updated>2011-08-19T18:59:03.892+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="client"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><category scheme="http://www.blogger.com/atom/ns#" term="Web"/><category scheme="http://www.blogger.com/atom/ns#" term="web communictions"/><category scheme="http://www.blogger.com/atom/ns#" term="Web server"/><category scheme="http://www.blogger.com/atom/ns#" term="webapplication"/><title type='text'>Understanding Web Communications</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Like all client-server applications, web applications have two distinct components:&lt;br /&gt;
&lt;b&gt; Client&lt;/b&gt; Also known as the front-end interface, the web browser presents the user interface, accepts user input, and sends data to the server for processing.&lt;br /&gt;
&lt;b&gt; Server &lt;/b&gt;Also known as the back end, the web server responds to requests from clients for specific pages. It responds with an HTML page that includes instructions for how to generate the user interface.&lt;br /&gt;
&lt;br /&gt;
The web browser (the client) and the web server communicate by using Hypertext Transfer Protocol (HTTP), a text-based network protocol assigned to TCP port 80. If the server has a certificate, the client and server can use HTTP Secure (HTTPS) to authenticate the server and encrypt communications. HTTPS is assigned to TCP port 443.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Communications typically follow these steps:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;1.&lt;/b&gt; A user enters an address, such as &lt;a href=&quot;http://www.dotnetcypher.blogspot.com&quot;&gt;http://www.dotnetcypher.com/&lt;/a&gt;, into the web browser.&lt;br /&gt;
&lt;b&gt;2. &lt;/b&gt;The web browser connects by using HTTP and sends a GET request, such as GET / (to retrieve the root page), to the web server.&lt;br /&gt;
&lt;b&gt;3.&lt;/b&gt; The web server processes the requested page. This action might cause the server to return static HTML or image files, or it might execute application code(ASP.NET code) that performs workflow tasks or connects to a database.&lt;br /&gt;
&lt;b&gt;4.&lt;/b&gt; The web server uses HTTP to send a response back to the web browser. If the request was processed successfully, the web server returns the HTTP status code 200, along with an HTML document. If the server cannot find the page, it returns the code 404. If the user requests an outdated or relocated page, the server returns the code 302 and the new URL so that the browser can access the correct page. This is known as &lt;i&gt;&lt;b&gt;redirection&lt;/b&gt;&lt;/i&gt;. Several other responses are possible as well, depending on the particular situation.&lt;br /&gt;
&lt;b&gt;5.&lt;/b&gt; The user’s web browser then processes the response by displaying the HTML page (if the code was 200), showing an error message (if the code was 404), or loading a different page (if the code was 302). Other server responses are similarly handled by the browser, depending upon the response.&lt;br /&gt;
&lt;br /&gt;
This process is repeated each time the user clicks a button or link(any of post back behavior control).&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/7056619288183710152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetcypher.blogspot.com/2011/08/understanding-web-communications.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/7056619288183710152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/7056619288183710152'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/2011/08/understanding-web-communications.html' title='Understanding Web Communications'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-924899381377359504.post-8614419583877137593</id><published>2011-08-08T00:57:00.000+05:30</published><updated>2012-05-18T15:35:03.110+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="directory"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="file"/><category scheme="http://www.blogger.com/atom/ns#" term="folder"/><category scheme="http://www.blogger.com/atom/ns#" term="open files"/><title type='text'>Find out the open files  in the specified directory path using c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Every developer getting following errors frequently. i.e.&quot;The file could not be accessed.&quot;File &quot;can not be deleted&quot;&lt;br /&gt;
Recently i also faced the same problem in one of my project task where i worked with some of open pdf files.Generally we will get these type of errors ,due to the following reasons&lt;br /&gt;
1. File is opened already.&lt;br /&gt;
2. File is using by another process&lt;br /&gt;
Finally find out the following simple and great example in c#..&lt;br /&gt;
This example is using the try-catch blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Check all files from the specified folder:&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Linq;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.IO; //Required for directory and file operations&lt;br /&gt;
&lt;br /&gt;
namespace File_operations&lt;br /&gt;
{&lt;br /&gt;
class Program&lt;br /&gt;
{&lt;br /&gt;
static void Main(string[] args)&lt;br /&gt;
{&lt;br /&gt;
DirectoryInfo Dir = new DirectoryInfo(&quot;C:\\Applictions\\SampleFiles&quot;);\\ Folder Path&lt;br /&gt;
FileInfo[] filePaths = Dir.GetFiles(&quot;*.*&quot;);\\Get all the files&lt;br /&gt;
foreach (FileInfo file in filePaths)&lt;br /&gt;
{&lt;br /&gt;
if (IsFileOpen(file))&lt;br /&gt;
Console.WriteLine(&quot;File is opened&quot;);&lt;br /&gt;
else&lt;br /&gt;
Console.WriteLine(&quot;File is not opened&quot;);&lt;br /&gt;
}&lt;br /&gt;
Console.ReadLine();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public static bool IsFileOpen(FileInfo file)&lt;br /&gt;
{&lt;br /&gt;
FileStream stream = null;&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
stream = file.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.None);&lt;br /&gt;
}&lt;br /&gt;
catch (IOException)&lt;br /&gt;
{&lt;br /&gt;
return true;//file is opened&lt;br /&gt;
}&lt;br /&gt;
finally&lt;br /&gt;
{&lt;br /&gt;
if (stream != null)&lt;br /&gt;
stream.Close();&lt;br /&gt;
}&lt;br /&gt;
return false;//file is not opened&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Find out specified format of files:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Change the following lines of code in the above example to get specific format files from a folder.&lt;br /&gt;
&lt;i&gt;FileInfo[] filePaths = Dir.GetFiles(&quot;*.pdf&quot;);//Get all the pdf files from the folder&lt;br /&gt;
FileInfo[] filePaths = Dir.GetFiles(&quot;*.doc&quot;);//Get all the word document files from the folder&lt;br /&gt;
FileInfo[] filePaths = Dir.GetFiles(&quot;*.jpg&quot;);//Get all the jpg image files from the folder&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
please feel free to leave comments...!&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetcypher.blogspot.com/feeds/8614419583877137593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetcypher.blogspot.com/2011/08/find-out-open-files-in-specified.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/8614419583877137593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/924899381377359504/posts/default/8614419583877137593'/><link rel='alternate' type='text/html' href='http://dotnetcypher.blogspot.com/2011/08/find-out-open-files-in-specified.html' title='Find out the open files  in the specified directory path using c#'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>