<?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-1192303979382219540</id><updated>2024-11-01T03:35:17.638-07:00</updated><category term="MessageBox"/><category term="XmlDocument"/><category term="C#"/><category term="C# .Net"/><category term="CLR"/><category term="DialogResult"/><category term="MessageBox properties"/><category term="Xml"/><category term=".NET Framework"/><category term=".NET Framework Exceptions"/><category term="Abort Retry Ignore"/><category term="AbortRetryIgnore"/><category term="AbortRetryIgnore Button"/><category term="C# Exceptions"/><category term="C# code"/><category term="C# destuctors"/><category term="C# help"/><category term="Constructores"/><category term="Converting String to Int"/><category term="DOM"/><category term="Destructors"/><category term="Destructors sintaxis"/><category term="Destructors sintaxis in C#"/><category term="Desturctors properties"/><category term="DivideByZeroException"/><category term="Exceptions"/><category term="Get sequence primary key"/><category term="GetElementsByTagName"/><category term="MessageBox Buttons"/><category term="MessageBox Tunning"/><category term="MessageBox YesNo"/><category term="Methods in Structures"/><category term="Null Reference"/><category term="NullReferenceException"/><category term="OutOfMemoryException"/><category term="Split function in C#"/><category term="Split in C#"/><category term="Stack Overflow"/><category term="StackOverflowException"/><category term="String to integer"/><category term="Structure varaibles"/><category term="System.Exception class"/><category term="Windows From"/><category term="XML to String"/><category term="Xml creation"/><category term="XmlAttribute"/><category term="XmlDeclaration"/><category term="XmlDocumentFragment"/><category term="YesNo Button"/><category term="integer sequence"/><category term="new line to txt file"/><category term="primary key in C#"/><category term="static method Show"/><category term="struct"/><category term="structures"/><category term="switch"/><category term="text file handling"/><category term="text file reading in C#"/><title type='text'>Practical C# Codes</title><subtitle type='html'>THE SOURCE FOR PRACTICAL C# .NET PROGRAMMING</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-8613014345454514537</id><published>2010-07-24T14:55:00.000-07:00</published><updated>2010-07-24T14:56:38.384-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="XML to String"/><title type='text'>Converting XML to String</title><content type='html'>&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CCONFIG%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:595.3pt 841.9pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:shapedefaults ext=&quot;edit&quot; spidmax=&quot;1026&quot;&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:shapelayout ext=&quot;edit&quot;&gt;   &lt;o:idmap ext=&quot;edit&quot; data=&quot;1&quot;&gt;  &lt;/o:shapelayout&gt;&lt;/xml&gt;&lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;In this short post I will show you how to convert XML to String, o viceversa, in order for example, to send it via Tcp/Ip.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;In this example, a Client is going to genereta a XML Document and convert it to string.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;The Server side must recive the string and generate the XML.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;(Here you will not see how the communication is done, for example the convertion between string and stream)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Client Code:&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlDocument&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; xmlDoc = &lt;span style=&quot;color:blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;XmlDocument&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.Load(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;@&quot;C:\XML\&quot;&lt;/span&gt; + test + &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;.xml&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//Getting the Xml as String&lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;String&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; message = xmlDoc.InnerXml;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;client.Send(message);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Server Code:&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;String&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; innerXml = response;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlDocument&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; xmlServer = &lt;span style=&quot;color:blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;XmlDocument&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//Set the string to the Xml created above&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlServer.InnerXml = innerXml;&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/8613014345454514537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/8613014345454514537' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/8613014345454514537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/8613014345454514537'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2010/07/converting-xml-to-string.html' title='Converting XML to String'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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-1192303979382219540.post-6321763874049928223</id><published>2010-07-20T16:16:00.000-07:00</published><updated>2010-07-20T16:20:36.907-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Xml creation"/><category scheme="http://www.blogger.com/atom/ns#" term="XmlAttribute"/><category scheme="http://www.blogger.com/atom/ns#" term="XmlDeclaration"/><category scheme="http://www.blogger.com/atom/ns#" term="XmlDocument"/><category scheme="http://www.blogger.com/atom/ns#" term="XmlDocumentFragment"/><title type='text'>More XML options in C#</title><content type='html'>&lt;br /&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CCONFIG%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Wingdings; 	panose-1:5 0 0 0 0 0 0 0 0 0; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:1049111800; 	mso-list-type:hybrid; 	mso-list-template-ids:1876200906 1321625214 67764227 67764229 67764225 67764227 67764229 67764225 67764227 67764229;} @list l0:level1 	{mso-level-start-at:0; 	mso-level-number-format:bullet; 	mso-level-text:-; 	mso-level-tab-stop:36.0pt; 	mso-level-number-position:left; 	text-indent:-18.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} ol 	{margin-bottom:0cm;} ul 	{margin-bottom:0cm;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Continuing the xml posts, in this oportunity I will show you more options to create your XmlDocument.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Here we will see:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;-&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Adding comment to the xml document (XmlComment)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;-&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Adding fragment (XmlDocumentFragment)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;-&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Creation of attributes &lt;/span&gt;&lt;span style=&quot;font-family:Calibri;&quot;&gt;(XmlAttribute)&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;-&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Adding information about the document Type (XmlDocumentType)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;-&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;And also, declarations and elements&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Code:&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlDocument&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; xmlDoc = &lt;span style=&quot;color:blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;XmlDocument&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlDeclaration&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; xmlDec = xmlDoc.CreateXmlDeclaration(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;1.0&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;, &lt;span style=&quot;color:blue;&quot;&gt;null&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.AppendChild(xmlDec);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlElement&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; root = xmlDoc.CreateElement(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;root-element&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//Adding info about the document type&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlDocumentType&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; docType = xmlDoc.CreateDocumentType(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;BOOKS&quot;&lt;/span&gt;, &lt;span style=&quot;color:blue;&quot;&gt;null&lt;/span&gt;, &lt;span style=&quot;color:blue;&quot;&gt;null&lt;/span&gt;, &lt;span style=&quot;color:blue;&quot;&gt;null&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.AppendChild(docType);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlAttribute&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; xmlAtt = xmlDoc.CreateAttribute(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;attribute&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlAtt.Value = &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;value_for_xmlAtt&quot;&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;root.SetAttributeNode(xmlAtt);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.AppendChild(root);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//Placing a comment in the Xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlComment&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; xmlComment = xmlDoc.CreateComment(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;First Book information&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;root.AppendChild(xmlComment);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlElement&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; book1 = xmlDoc.CreateElement(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;book-1&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;book1.SetAttribute(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;name&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Harry Potter&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;root.AppendChild(book1);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//Creating a Fragment&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlDocumentFragment&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; xmlDocFragment = xmlDoc.CreateDocumentFragment();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDocFragment.InnerText = &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;---------Inner text-------&quot;&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.DocumentElement.AppendChild(xmlDocFragment);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlElement&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; book2 = xmlDoc.CreateElement(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;book-2&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;book2.SetAttribute(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;name&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Robles&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;root.AppendChild(book2);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.Save(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;@&quot;C:\XML\&quot;&lt;/span&gt; + &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;xmlTest.xml&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Output:&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPCXUXgnNHes7eHt1JRijjF3zPibx9MHzqQDPA3XcA8fVrTbAJ-eKsCHu1hyDCLw8A4mRgZGql8QKN30DT-wWnFHttE_atrCXQIEz0p6Ex-KI-ROiPorGTwy1lLI0NJCcoVN7qMLIBcMhn/s1600/XmlDocument_options.PNG&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 391px; height: 145px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPCXUXgnNHes7eHt1JRijjF3zPibx9MHzqQDPA3XcA8fVrTbAJ-eKsCHu1hyDCLw8A4mRgZGql8QKN30DT-wWnFHttE_atrCXQIEz0p6Ex-KI-ROiPorGTwy1lLI0NJCcoVN7qMLIBcMhn/s400/XmlDocument_options.PNG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5496131731561660354&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/6321763874049928223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/6321763874049928223' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/6321763874049928223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/6321763874049928223'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2010/07/more-xml-options-in-c.html' title='More XML options in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEjPCXUXgnNHes7eHt1JRijjF3zPibx9MHzqQDPA3XcA8fVrTbAJ-eKsCHu1hyDCLw8A4mRgZGql8QKN30DT-wWnFHttE_atrCXQIEz0p6Ex-KI-ROiPorGTwy1lLI0NJCcoVN7qMLIBcMhn/s72-c/XmlDocument_options.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-5021728587471149587</id><published>2010-07-17T11:41:00.000-07:00</published><updated>2010-07-17T12:11:15.204-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GetElementsByTagName"/><category scheme="http://www.blogger.com/atom/ns#" term="Xml"/><category scheme="http://www.blogger.com/atom/ns#" term="XmlDocument"/><title type='text'>Xml document edition</title><content type='html'>&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CCONFIG%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;In the previous post I showed you how to create a &lt;b style=&quot;&quot;&gt;XmlDocument&lt;/b&gt; following some easy steps. The idea now is to read the created xml and find elements by a specific tag. Then we are going to change that value and save the edited xml.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Code:&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;i style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;For the first book element, we are going to add inner text:&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;i style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlDocument&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; xmlDoc = &lt;span style=&quot;color:blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;XmlDocument&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//Load the Xml created previously&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.Load(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;@&quot;C:\XML\&quot;&lt;/span&gt; + &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;xmlTest.xml&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlNodeList&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; books;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;books = xmlDoc.GetElementsByTagName(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;book-1&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//Since there is only one element with this tag, the loop is not necessary.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:blue;&quot;   lang=&quot;EN-GB&quot;&gt;foreach&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; (&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;XmlNode&lt;/span&gt; node &lt;span style=&quot;color:blue;&quot;&gt;in&lt;/span&gt; books)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;node.InnerText = &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Great Book&quot;&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;i style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;For the second element, we are changing the attributes values:&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;i style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;books = xmlDoc.GetElementsByTagName(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;book-2&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:blue;&quot;   lang=&quot;EN-GB&quot;&gt;foreach&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; (&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;XmlNode&lt;/span&gt; node &lt;span style=&quot;color:blue;&quot;&gt;in&lt;/span&gt; books)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;node.Attributes[0].Value = &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Time&quot;&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.Save(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;@&quot;C:\XML\&quot;&lt;/span&gt; + &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;xmlTest.xml&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Output:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO6YLgP5PeY9YtkfTOfk8Wg-Z910n7xl_2hfdpnAs5xyz7qUhGgxVxTGN8BDs1-MrdqGCGJXNP0Q__ga-84XG4BCtgc57mUc0EkPWNRCtCQQsZ9uKPJFTSlVzYwkKagfRzoLyc156mrn9e/s1600/XmlDocument_Edition.PNG&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 101px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO6YLgP5PeY9YtkfTOfk8Wg-Z910n7xl_2hfdpnAs5xyz7qUhGgxVxTGN8BDs1-MrdqGCGJXNP0Q__ga-84XG4BCtgc57mUc0EkPWNRCtCQQsZ9uKPJFTSlVzYwkKagfRzoLyc156mrn9e/s400/XmlDocument_Edition.PNG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5494954321619848354&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/5021728587471149587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/5021728587471149587' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/5021728587471149587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/5021728587471149587'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2010/07/xml-document-edition.html' title='Xml document edition'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEhO6YLgP5PeY9YtkfTOfk8Wg-Z910n7xl_2hfdpnAs5xyz7qUhGgxVxTGN8BDs1-MrdqGCGJXNP0Q__ga-84XG4BCtgc57mUc0EkPWNRCtCQQsZ9uKPJFTSlVzYwkKagfRzoLyc156mrn9e/s72-c/XmlDocument_Edition.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-4737157393717029819</id><published>2010-07-16T08:54:00.000-07:00</published><updated>2010-07-16T09:42:55.039-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DOM"/><category scheme="http://www.blogger.com/atom/ns#" term="Xml"/><category scheme="http://www.blogger.com/atom/ns#" term="XmlDocument"/><title type='text'>Xml Document creation using DOM</title><content type='html'>&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CCONFIG%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Calibri;&quot;&gt;In this article I´ll show you how to create a .xml document using proper tags and definitions. To do this you need to import the System.Xml library.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Calibri;&quot;&gt;The idea is simple and the best way to learn this is by a small example.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Calibri;&quot;&gt;Here I´ll create a XmlDocument with a couple of child elements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;font-weight: bold;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;Code:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-weight: bold;&quot; class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;font-weight: bold;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlDocument&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; xmlDoc = &lt;span style=&quot;color:blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;XmlDocument&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//First, create the declaration&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlDeclaration&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; declaration = xmlDoc.CreateXmlDeclaration(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;1.0&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;, &lt;span style=&quot;color:blue;&quot;&gt;null&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.AppendChild(declaration);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlElement&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; books = xmlDoc.CreateElement(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;BOOK&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.AppendChild(books);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//Child 1 for BOOK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlElement&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; book1 = xmlDoc.CreateElement(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;book-1&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;book1.SetAttribute(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;name&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Harry Potter&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;books.AppendChild(book1);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//Child 2 for BOOK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: rgb(43, 145, 175);font-family:Calibri;&quot;  lang=&quot;EN-GB&quot;&gt;XmlElement&lt;/span&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt; book2 = xmlDoc.CreateElement(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;book-2&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;book2.SetAttribute(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;name&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;People&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;book2.SetAttribute(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;type&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;magazine&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;books.AppendChild(book2);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:Calibri;color:green;&quot;   lang=&quot;EN-GB&quot;&gt;//Save the Xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;xmlDoc.Save(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;@&quot;C:\XML\&quot;&lt;/span&gt; + &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;xmlTest.xml&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Output:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg5XoKGZvH-7Z0fqjfdwAJdCc1QVJgahUf07ymxJgLXqG8-t4CfYevvBxcDSpeBFsqmL9bgwt8_fJIPM9ZAfnh3zSlhiAmHj6lOv6_j5mRkCYX4Jdv1vxxY-mG4fuYJQKFtKMRnCxm3rcb/s1600/XmlDocument.PNG&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 126px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg5XoKGZvH-7Z0fqjfdwAJdCc1QVJgahUf07ymxJgLXqG8-t4CfYevvBxcDSpeBFsqmL9bgwt8_fJIPM9ZAfnh3zSlhiAmHj6lOv6_j5mRkCYX4Jdv1vxxY-mG4fuYJQKFtKMRnCxm3rcb/s400/XmlDocument.PNG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5494544652144052594&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CCONFIG%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} a:link, span.MsoHyperlink 	{color:blue; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{color:purple; 	text-decoration:underline; 	text-underline:single;} span.b1 	{mso-style-name:b1; 	font-family:&quot;Courier New&quot;; 	mso-ascii-font-family:&quot;Courier New&quot;; 	mso-hansi-font-family:&quot;Courier New&quot;; 	mso-bidi-font-family:&quot;Courier New&quot;; 	color:red; 	mso-text-animation:none; 	font-weight:bold; 	text-decoration:none; 	text-underline:none; 	text-decoration:none; 	text-line-through:none;} span.m1 	{mso-style-name:m1; 	color:blue;} span.pi1 	{mso-style-name:pi1; 	color:blue;} span.t1 	{mso-style-name:t1; 	color:#990000;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class=&quot;m1&quot;&gt;&lt;span style=&quot;font-family:Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;  </content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/4737157393717029819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/4737157393717029819' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/4737157393717029819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/4737157393717029819'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2010/07/xml-document-creation-using-dom.html' title='Xml Document creation using DOM'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEjg5XoKGZvH-7Z0fqjfdwAJdCc1QVJgahUf07ymxJgLXqG8-t4CfYevvBxcDSpeBFsqmL9bgwt8_fJIPM9ZAfnh3zSlhiAmHj6lOv6_j5mRkCYX4Jdv1vxxY-mG4fuYJQKFtKMRnCxm3rcb/s72-c/XmlDocument.PNG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-11470889501637145</id><published>2010-05-08T17:06:00.000-07:00</published><updated>2010-05-08T17:10:49.003-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Split function in C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Split in C#"/><title type='text'>Split function in C#</title><content type='html'>&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Here is a small post about using &lt;b&gt;split function in c#.&lt;/b&gt; We are going to split a String by using delimiters. A delimiter will tell when to split the string. So here is a fragment of code to perform splitting.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CCONFIG%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:595.3pt 841.9pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; answer = &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;This$is|a|string&quot;&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;                     &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;[] delimitator1 = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;char&lt;/span&gt;[] { &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&#39;$&#39;&lt;/span&gt; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;[] delimitator2 = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;char&lt;/span&gt;[] { &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&#39;|&#39;&lt;/span&gt; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;[] words = answer.Split(delimitator1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;First word : &quot;&lt;/span&gt; + words[0]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Note that now we split the second part of the string&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; allRest = words[1];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;[] rest1 = allRest.Split(delimitator2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Second word : &quot;&lt;/span&gt; + rest1[0]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Third word : &quot;&lt;/span&gt; + rest1[1]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Fourth word : &quot;&lt;/span&gt; + rest1[2]);&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;br /&gt;Output:&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6I3F2QKNgN-8kNQvDAgeYjqIReQewMu7NmA67aoP3cLTKmxZ7MKUxM4xAHuTqnhWC11DZ4vK4ghvErPpy7UpJ3vvWc0nWS-LrOTIi1XczXw9bAuJhbQku_tFuyryqEOmviPk3DkckP1hh/s1600/Split_C%23.PNG&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 217px; height: 79px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6I3F2QKNgN-8kNQvDAgeYjqIReQewMu7NmA67aoP3cLTKmxZ7MKUxM4xAHuTqnhWC11DZ4vK4ghvErPpy7UpJ3vvWc0nWS-LrOTIi1XczXw9bAuJhbQku_tFuyryqEOmviPk3DkckP1hh/s400/Split_C%23.PNG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5469055888762792930&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/11470889501637145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/11470889501637145' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/11470889501637145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/11470889501637145'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2010/05/split-function-in-c.html' title='Split function in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEh6I3F2QKNgN-8kNQvDAgeYjqIReQewMu7NmA67aoP3cLTKmxZ7MKUxM4xAHuTqnhWC11DZ4vK4ghvErPpy7UpJ3vvWc0nWS-LrOTIi1XczXw9bAuJhbQku_tFuyryqEOmviPk3DkckP1hh/s72-c/Split_C%23.PNG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-703231689926645678</id><published>2009-04-18T12:25:00.000-07:00</published><updated>2009-04-18T12:31:12.751-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Get sequence primary key"/><category scheme="http://www.blogger.com/atom/ns#" term="integer sequence"/><category scheme="http://www.blogger.com/atom/ns#" term="primary key in C#"/><title type='text'>Get integer sequence primary key in C#</title><content type='html'>Here is a nice method of getting the primary key from a table.  Basicly what I do here is obtanning the first available key to insert new rows with this obtained key.&lt;br /&gt;&lt;br /&gt;First we set the instance of the connection with the database and then we create a sql command. After this, we open the connection and execute the command directly to the database.&lt;br /&gt;If everything executes correctly, we will obtain the first available key. If not, an exception is going to be raised.&lt;br /&gt;&lt;br /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal  {mso-style-parent:&quot;&quot;;  margin:0cm;  margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:12.0pt;  font-family:&quot;Times New Roman&quot;;  mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1  {size:595.3pt 841.9pt;  margin:70.85pt 3.0cm 70.85pt 3.0cm;  mso-header-margin:35.4pt;  mso-footer-margin:35.4pt;  mso-paper-source:0;} div.Section1  {page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:&quot;Tabla normal&quot;;  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-parent:&quot;&quot;;  mso-padding-alt:0cm 5.4pt 0cm 5.4pt;  mso-para-margin:0cm;  mso-para-margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:10.0pt;  font-family:&quot;Times New Roman&quot;;  mso-ansi-language:#0400;  mso-fareast-language:#0400;  mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot; lang=&quot;ES-TRAD&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;ES-TRAD&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; GetOid()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;OleDbConnection&lt;/span&gt; conn = &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ConnectionMgr&lt;/span&gt;.GetInstance().GetConnection();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;OleDbCommand&lt;/span&gt; cmd = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;OleDbCommand&lt;/span&gt;(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Select * From Oid&quot;&lt;/span&gt;, conn);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; oidNum = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;conn.Open();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;oidNum = (&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;)cmd.ExecuteScalar();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;oidNum++;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;cmd = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;OleDbCommand&lt;/span&gt;(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;UPDATE Oid SET lastOid=&quot;&lt;/span&gt; + oidNum, conn);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;cmd.ExecuteNonQuery();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt; (&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;OleDbException&lt;/span&gt; ex)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;throw&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;DatabaseException&lt;/span&gt;(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Error updating oid&quot;&lt;/span&gt;, ex);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;finally&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;conn.Close();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; oidNum;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;ES-TRAD&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/703231689926645678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/703231689926645678' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/703231689926645678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/703231689926645678'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2009/04/get-integer-sequence-primary-key-in-c.html' title='Get integer sequence primary key in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-92270778892706811</id><published>2008-11-28T15:10:00.000-08:00</published><updated>2008-11-28T15:24:39.728-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="new line to txt file"/><category scheme="http://www.blogger.com/atom/ns#" term="text file handling"/><category scheme="http://www.blogger.com/atom/ns#" term="text file reading in C#"/><title type='text'>Adding new line to a txt file in C# .Net</title><content type='html'>In this very short article I will show you the easiest way to&lt;span style=&quot;font-weight: bold;&quot;&gt; add a&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;new text line on a txt file using C# .NET&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;I was researching on this matter very hard. First I started to read the entire file to the end and then add the new line. There is a small problem on doing this: it might work at compilation time but when you execute the application, you will see an error that says that two processes cannot run at the same time. Sound fair.&lt;br /&gt;Then I started working with locks. There are a couple of locks, the lock when you read and the lock when you write. This is good stuff to talk later but not right now.&lt;br /&gt;&lt;br /&gt;So what is the easiest solution to this matter, here it is:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);font-family:verdana;&quot; &gt;public void&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt; AddNewLine(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);font-family:verdana;&quot; &gt;String &lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;text)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 102, 0);font-family:verdana;&quot; &gt;File&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;.AppendAllText(&lt;/span&gt;&lt;span style=&quot;color: rgb(153, 0, 0);font-family:verdana;&quot; &gt;&quot;C:\\Logs.txt&quot;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;, text + &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);font-family:verdana;&quot; &gt;Environment&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;.NewLine);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Yes, just like that.&lt;br /&gt;And if you want to read the txt file, you could do something like this:&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);font-family:verdana;&quot; &gt;public&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);font-family:verdana;&quot; &gt;String &lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;ReadAll() {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);font-family:verdana;&quot; &gt;StreamReader &lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;sr = new &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);font-family:verdana;&quot; &gt;StreamReader&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(153, 0, 0);font-family:verdana;&quot; &gt;&quot;C:\\Logs.txt&quot;&lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);font-family:verdana;&quot; &gt;String &lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;allText = sr.ReadToEnd();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);font-family:verdana;&quot; &gt;return &lt;/span&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;allText;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;            &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/92270778892706811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/92270778892706811' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/92270778892706811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/92270778892706811'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/11/adding-new-line-to-txt-file-in-c-net.html' title='Adding new line to a txt file in C# .Net'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-8469594028562463490</id><published>2008-08-30T08:32:00.000-07:00</published><updated>2008-08-30T08:50:13.758-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET Framework Exceptions"/><category scheme="http://www.blogger.com/atom/ns#" term="C# Exceptions"/><category scheme="http://www.blogger.com/atom/ns#" term="DivideByZeroException"/><category scheme="http://www.blogger.com/atom/ns#" term="OutOfMemoryException"/><category scheme="http://www.blogger.com/atom/ns#" term="System.Exception class"/><title type='text'>Understanding Exceptions provided by the .NET Framework - Part 2.</title><content type='html'>You may saw in the previous post, a couple of exceptions we can use that are provided by the .Net Framework derived from the System.Exception class. Those two exceptions were: The StackOverflowException and the NullReferenceException.&lt;br /&gt;Now I will describe to you the OutOfMemoryException and the DivideByZeroException.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;The OutOfMemoryException&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;This exception is thrown by the CLR when your machine runs out of memory. Every time you create an object using new, some memory will be reserved for it. In case there is now enough memory, the exception will be triggered.&lt;br /&gt;Let´s write an example now. Supose you want to create a Hashtable that allocated a large capacity. If there is no memory to do this, the CLR throws the exception.&lt;br /&gt;Take a look at this C# example:&lt;br /&gt;&lt;br /&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:595.3pt 841.9pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:595.3pt 841.9pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:595.3pt 841.9pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:595.3pt 841.9pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:595.3pt 841.9pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Collections.Generic;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Collections;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Linq;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Text;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;namespace&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; ConsoleApplication5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Program&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; &lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Hashtable&lt;/span&gt; hatb = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Hashtable&lt;/span&gt;(91230000);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;&quot;&gt;     &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt; (&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;OutOfMemoryException&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;CLR out of memory&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;/span&gt;&lt;/p&gt; &lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Console:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim92tfekw56yhGpcGWSsZ6voGPeFBXoH2zb6hMsklwXhIjRhz2QRwQTu6QtTES9gYlCgje9EDS6uxku7r0AKefj72ZT9CsUWjqhrg29NnXLGtLRV95gIqKL5rlZuvg1Krd5fQwHzIS43_7/s1600-h/OutOfMemoryException.GIF&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5240335303763318418&quot; style=&quot;margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim92tfekw56yhGpcGWSsZ6voGPeFBXoH2zb6hMsklwXhIjRhz2QRwQTu6QtTES9gYlCgje9EDS6uxku7r0AKefj72ZT9CsUWjqhrg29NnXLGtLRV95gIqKL5rlZuvg1Krd5fQwHzIS43_7/s400/OutOfMemoryException.GIF&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;u&gt;The DivideByZeroException&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;This exception is quite simple: when you are dividing by 0, the CLR throws this exception.&lt;br /&gt;Take a look at this example:&lt;br /&gt;&lt;br /&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Program&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; &lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 35.4pt; text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; a = 5;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; b = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;try&lt;/span&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; res = a / b;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt;(&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;DivideByZeroException&lt;/span&gt;){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;You are dividing by 0&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Console:&lt;/span&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8Y4-QGa_ONrOehpeT1F87sYpbISl1Cp1Z6xikWZbkymbxlIXMcLzbVpBtPi8xqFKllLw1P7JQu49WFAfOX3ZI18SU0c_fLJHUY7yUXOmbevBrtGAoFgJyXMo_vs8CGNOM6v8OM7_AYFSu/s1600-h/DivideByZeroException.GIF&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5240335378131223666&quot; style=&quot;margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8Y4-QGa_ONrOehpeT1F87sYpbISl1Cp1Z6xikWZbkymbxlIXMcLzbVpBtPi8xqFKllLw1P7JQu49WFAfOX3ZI18SU0c_fLJHUY7yUXOmbevBrtGAoFgJyXMo_vs8CGNOM6v8OM7_AYFSu/s400/DivideByZeroException.GIF&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/8469594028562463490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/8469594028562463490' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/8469594028562463490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/8469594028562463490'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/08/understanding-exceptions-provided-by_30.html' title='Understanding Exceptions provided by the .NET Framework - Part 2.'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEim92tfekw56yhGpcGWSsZ6voGPeFBXoH2zb6hMsklwXhIjRhz2QRwQTu6QtTES9gYlCgje9EDS6uxku7r0AKefj72ZT9CsUWjqhrg29NnXLGtLRV95gIqKL5rlZuvg1Krd5fQwHzIS43_7/s72-c/OutOfMemoryException.GIF" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-2235136370942941960</id><published>2008-08-22T13:48:00.000-07:00</published><updated>2008-08-30T17:18:18.911-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET Framework"/><category scheme="http://www.blogger.com/atom/ns#" term="CLR"/><category scheme="http://www.blogger.com/atom/ns#" term="Exceptions"/><category scheme="http://www.blogger.com/atom/ns#" term="Null Reference"/><category scheme="http://www.blogger.com/atom/ns#" term="NullReferenceException"/><category scheme="http://www.blogger.com/atom/ns#" term="Stack Overflow"/><category scheme="http://www.blogger.com/atom/ns#" term="StackOverflowException"/><title type='text'>Understanding Exceptions provided by the .NET Framework - Part 1.</title><content type='html'>&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;The NullReferenceException:&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;o:p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;The easiest way to explain how this works is by writing an example. What we are going to do in the following example is quite simple: we are going to create an Object and initialize it with null value. This object contains string public value type that we can malipulate. But in this particulare case, our Object was set to null, so the CLR will catch this particular exception:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Class Person&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Person&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;String&lt;/span&gt; name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;st1:place style=&quot;font-weight: bold;&quot; st=&quot;on&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Main&lt;/span&gt;&lt;/st1:place&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;:&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; &lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;{&lt;span style=&quot;color: blue;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Person&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; p = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Person&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;p = &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;p.name = &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;CoderG&quot;&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;NullReferenceException&lt;/span&gt;) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;p set tu null, cannot be referenced&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Console:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqmZwnjOmgChDUtyYlsl-_FtHbkaQAc-WFWlR-4TUWX7Y0Z01wVGIjlfGj7CwdCt2njW6SqOpPYuepyvqnwKfF8C5V7nTXVyGqcfnWeFGSXlsRg65gBVtBXRTsyzN3RrYl8SMJLQJSASDW/s1600-h/NullReferenceException.GIF&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqmZwnjOmgChDUtyYlsl-_FtHbkaQAc-WFWlR-4TUWX7Y0Z01wVGIjlfGj7CwdCt2njW6SqOpPYuepyvqnwKfF8C5V7nTXVyGqcfnWeFGSXlsRg65gBVtBXRTsyzN3RrYl8SMJLQJSASDW/s400/NullReferenceException.GIF&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5237447737924606402&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;  &lt;/p&gt;&lt;p style=&quot;font-weight: bold;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span&gt;&lt;u&gt;The StackOverflowException:&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;This exception is catch by the CLR when it runs out of stack memory. Be aware that the CLR has a finite amount of stack space, so if it gets full, the StackOverflowException will catch the exception. An easy way to trigger this is by defining a recursive function that does nothing, just call itself. Eventually, if the stack was infinite, this method will never stop, but because it is finite, the exception catches this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;st1:place style=&quot;font-weight: bold;&quot; st=&quot;on&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/st1:place&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;st1:place style=&quot;font-weight: bold;&quot; st=&quot;on&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Main&lt;/span&gt;&lt;/st1:place&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;o:smarttagtype namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot; name=&quot;place&quot;&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid=&quot;clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D&quot; id=&quot;ieooui&quot;&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; &lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;callMe();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;StackOverflowException&lt;/span&gt;) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Stack run out of memory!!!!&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; callMe(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;callMe();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Console:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh56Q-7M2cVC-lpgaSixevXcBAoVTMLbnxuOA2vZ2zQQUr3KOVsEJs6FFe4RcUoSbWcScHA-4CyILZMsCuHaSkURclxOrhO6jfIObMt0oNV58u6nPhHUMHORd7Ey2R9jNa0Zb5KAi-9ccM5/s1600-h/StackOverflowException.GIF&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh56Q-7M2cVC-lpgaSixevXcBAoVTMLbnxuOA2vZ2zQQUr3KOVsEJs6FFe4RcUoSbWcScHA-4CyILZMsCuHaSkURclxOrhO6jfIObMt0oNV58u6nPhHUMHORd7Ey2R9jNa0Zb5KAi-9ccM5/s400/StackOverflowException.GIF&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5237447816052127506&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/2235136370942941960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/2235136370942941960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/2235136370942941960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/2235136370942941960'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/08/understanding-exceptions-provided-by.html' title='Understanding Exceptions provided by the .NET Framework - Part 1.'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEjqmZwnjOmgChDUtyYlsl-_FtHbkaQAc-WFWlR-4TUWX7Y0Z01wVGIjlfGj7CwdCt2njW6SqOpPYuepyvqnwKfF8C5V7nTXVyGqcfnWeFGSXlsRg65gBVtBXRTsyzN3RrYl8SMJLQJSASDW/s72-c/NullReferenceException.GIF" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-5645892887854916610</id><published>2008-08-06T12:28:00.000-07:00</published><updated>2008-08-06T12:37:04.361-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# destuctors"/><category scheme="http://www.blogger.com/atom/ns#" term="CLR"/><category scheme="http://www.blogger.com/atom/ns#" term="Destructors"/><category scheme="http://www.blogger.com/atom/ns#" term="Destructors sintaxis"/><category scheme="http://www.blogger.com/atom/ns#" term="Destructors sintaxis in C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Desturctors properties"/><title type='text'>Using destructors in C#</title><content type='html'>&lt;pre&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;Destructors are similar to de Constructors, almost the oposite.&lt;br /&gt;The destructor is used by the CLR when objects are destroyed.&lt;br /&gt;All this process happens in the background so the developer does not have to preocupate about deleting&lt;br /&gt;created objects. Writing a destructor is not necessary but if you are going to create one in your class,&lt;br /&gt;you can only add one. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;The Destructors sintaxis are very similar to the constructors.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;They start with the simbole ~ and the name must be the same to the class.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;Also, there are a few particulares things about destructors you should know:&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;-&lt;span style=&quot;&quot;&gt;&lt;/span&gt;No parameters are allowed here.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;-&lt;span style=&quot;&quot;&gt;&lt;/span&gt;As said before, you can only write one.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;-&lt;span style=&quot;&quot;&gt;&lt;/span&gt;You can not call a constructor like you will normally do with a method. They are automatically used by the CLR (by the garbage collection).&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;-&lt;span style=&quot;&quot;&gt;&lt;/span&gt;No overload or inheritances are allowed.&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;So let’s write a small C# class.&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot;&gt;-Class Plane&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;        &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Text;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;            &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Plane&lt;/span&gt;&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;String&lt;/span&gt; type;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;String&lt;/span&gt; company;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; Plane(&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;String&lt;/span&gt; t, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;String&lt;/span&gt; c){&lt;br /&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;type = t;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;company = c;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Constructor in action\n&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;            &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;~Plane() {&lt;br /&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;type = &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;N/A&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;company = &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;N/A&quot;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Destructor in action&quot;&lt;/span&gt;);&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre style=&quot;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;- Main&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; &lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Plane&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; p = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Plane&lt;/span&gt;(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;AirBus&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Tam&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;/span&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;- Console&lt;/span&gt;&lt;/b&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRcW15zgmyVdNbymluFD1806YOdICopZFyQK3YCm5CtGTRiY9AiUdTI9RliftqnR7mGP_o5NmipFwDYk62i0beg6GJL2mB9Ogt7HneP4jC_2tH9hdMbFcV-5OE3fh4k60iF2fPI42SuBbo/s1600-h/Console-Destructor.GIF&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRcW15zgmyVdNbymluFD1806YOdICopZFyQK3YCm5CtGTRiY9AiUdTI9RliftqnR7mGP_o5NmipFwDYk62i0beg6GJL2mB9Ogt7HneP4jC_2tH9hdMbFcV-5OE3fh4k60iF2fPI42SuBbo/s400/Console-Destructor.GIF&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5231488888139788610&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/5645892887854916610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/5645892887854916610' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/5645892887854916610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/5645892887854916610'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/08/using-destructors-in-c.html' title='Using destructors in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEjRcW15zgmyVdNbymluFD1806YOdICopZFyQK3YCm5CtGTRiY9AiUdTI9RliftqnR7mGP_o5NmipFwDYk62i0beg6GJL2mB9Ogt7HneP4jC_2tH9hdMbFcV-5OE3fh4k60iF2fPI42SuBbo/s72-c/Console-Destructor.GIF" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-6502743958736645410</id><published>2008-08-04T09:19:00.000-07:00</published><updated>2008-12-08T18:38:46.898-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Constructores"/><category scheme="http://www.blogger.com/atom/ns#" term="Methods in Structures"/><category scheme="http://www.blogger.com/atom/ns#" term="struct"/><category scheme="http://www.blogger.com/atom/ns#" term="Structure varaibles"/><category scheme="http://www.blogger.com/atom/ns#" term="structures"/><title type='text'>Defining methods in Structures (C#)</title><content type='html'>&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Normally you will see structures with only variables on it, but methods can also be included. This is usefull when you need to write a method that works directly with the content of the stuct.&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;      &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;- The first method that I will create inside the structure is a constructor. Remember that there can be many constructores as long as the parameter list is different of each other.&lt;br /&gt;- The second method you will see next is a simple bool method that return true if both values of the structure varaibles (integers) are 50.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Ok, lets now proceed to write this example.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; System;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Program&lt;/span&gt;&lt;br /&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;struct&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Point&lt;/span&gt; {&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; x;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; y;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; Point(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; x1, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; y1) {&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;x = x1;&lt;br /&gt;y = y1;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;bool&lt;/span&gt; check50() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; ((x == 50) &amp;amp;&amp;amp; (y == 50))&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Main:&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Main(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Point&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; p = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Point&lt;/span&gt;(50 , 50);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Point&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; p2 = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Point&lt;/span&gt;(10, 20);&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (p.check50())&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Point p is at 50s&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Point p not at 50s&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;(p2.check50())&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Point p2 is at 50s&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Point p2 not at 50s&quot;&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Console:&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBSTIhyVaPdUlC1neIC9qp7nsA_zKj3276La1b-JK9le3-f71SqJqQotwkcq9BCPHXI-lTvK3a2fcBMMobhUIggGO41gG51oLDdOtMKhZnVfcCpOibWykPBJWW0cBFmIbgNE_geFYrGKqt/s1600-h/Console-Structure.GIF&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBSTIhyVaPdUlC1neIC9qp7nsA_zKj3276La1b-JK9le3-f71SqJqQotwkcq9BCPHXI-lTvK3a2fcBMMobhUIggGO41gG51oLDdOtMKhZnVfcCpOibWykPBJWW0cBFmIbgNE_geFYrGKqt/s400/Console-Structure.GIF&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5230698083786228338&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/6502743958736645410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/6502743958736645410' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/6502743958736645410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/6502743958736645410'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/08/defining-methods-in-structures-c.html' title='Defining methods in Structures (C#)'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEjBSTIhyVaPdUlC1neIC9qp7nsA_zKj3276La1b-JK9le3-f71SqJqQotwkcq9BCPHXI-lTvK3a2fcBMMobhUIggGO41gG51oLDdOtMKhZnVfcCpOibWykPBJWW0cBFmIbgNE_geFYrGKqt/s72-c/Console-Structure.GIF" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-5735741259868138641</id><published>2008-07-31T09:23:00.001-07:00</published><updated>2008-12-08T18:38:47.052-08:00</updated><title type='text'>Implementing Interfaces in C#</title><content type='html'>&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Interfaces are a set of methods, properties and event that provides functionalities. This interces can be implemented by C# classes or structures. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Interfaces do not provide methods of their own. They only contain methods identifiers, return values and parameters.&lt;br /&gt;This is very useful when you have certain behaviour that need to follow a set of operations, such as manipulating a Data Base.&lt;br /&gt;C# classes are allowed to implement many interfaces.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Implementing an Interfaz in a class says that the class must provide implementation to all of the methods signatures from the interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;Let’s write a small C# example. In this example you will see of to implement interfaces that contain methods signatures and how a class implements this interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Code:&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Interface1&lt;br /&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; Method1();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; Method2();&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Class1&lt;/span&gt; : &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Interface1&lt;/span&gt;&lt;br /&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Method1()&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Implementation of the method&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Method2() { }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Now, you can also use interfaces that the .NET Frameworks has. In this example you will see how to implement the Idisposable interface. The Idisposable interface supports a method called Dispose(). It also supports a constructor and a destructor. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Also you will see in the Main class, the keyword using. It is used to create a new object and can be manipulated only within the braces ({}). After the close brace is reached, the object will be automatically destroyed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;font-family: arial;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Code:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Class2&lt;/span&gt; : &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;IDisposable&lt;/span&gt;&lt;br /&gt;{&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; Class2()&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(163, 21, 21);&quot;&gt;Constructor&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(163, 21, 21);&quot; lang=&quot;EN-GB&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;);&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;~Class2()&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Destuctor&quot;&lt;/span&gt;);&lt;br /&gt;}&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;            &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Dispose()&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Dispose from IDisposable.Dispose&quot;&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Main:&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;span style=&quot;font-size:85%;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Program&lt;/span&gt;&lt;br /&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; &lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; (&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Class2&lt;/span&gt; myC = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Class2&lt;/span&gt;()) { }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Console:&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDfj2-3B828ZZbLcgRY7X-EcXPPJNAgs6o7BzITRkA-0C97ASJovN3GfSMqfYP1JZkWrps-ip2ZcqM32mDHYPV0rw4nT8EhOVNUuTCsd6AO96WMKSACiLUQK5FZNhzd9Gf1_u8VcW-NNdv/s1600-h/Console-Interface.GIF&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDfj2-3B828ZZbLcgRY7X-EcXPPJNAgs6o7BzITRkA-0C97ASJovN3GfSMqfYP1JZkWrps-ip2ZcqM32mDHYPV0rw4nT8EhOVNUuTCsd6AO96WMKSACiLUQK5FZNhzd9Gf1_u8VcW-NNdv/s400/Console-Interface.GIF&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5229214725518679634&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/5735741259868138641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/5735741259868138641' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/5735741259868138641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/5735741259868138641'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/07/implementing-interfaces-in-c.html' title='Implementing Interfaces in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEgDfj2-3B828ZZbLcgRY7X-EcXPPJNAgs6o7BzITRkA-0C97ASJovN3GfSMqfYP1JZkWrps-ip2ZcqM32mDHYPV0rw4nT8EhOVNUuTCsd6AO96WMKSACiLUQK5FZNhzd9Gf1_u8VcW-NNdv/s72-c/Console-Interface.GIF" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-5074527027687987439</id><published>2008-07-17T14:07:00.001-07:00</published><updated>2008-12-08T18:38:48.066-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AbortRetryIgnore"/><category scheme="http://www.blogger.com/atom/ns#" term="AbortRetryIgnore Button"/><category scheme="http://www.blogger.com/atom/ns#" term="C# .Net"/><category scheme="http://www.blogger.com/atom/ns#" term="C# help"/><category scheme="http://www.blogger.com/atom/ns#" term="MessageBox"/><category scheme="http://www.blogger.com/atom/ns#" term="MessageBox properties"/><title type='text'>MessageBox using AbortRetryIgnore Button in C#</title><content type='html'>This example is very similar to the previous one where I showed you how to write an example using the YesNo MessageBox. Here the only difference is that the MessageBox is with the AbortRetryIgnore Button.&lt;br /&gt;&lt;br /&gt;Ok, now I will proceed to write a small example of this. Basicly what I want to do here is to distinguish between the three different types of buttons that this type of MessageBox contains. Here I will use a swith statment because I find it a little more correct.&lt;br /&gt;So the complete C# code is this:&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:595.3pt 841.9pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:595.3pt 841.9pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; System.Collections.Generic;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; System.ComponentModel;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; System.Data;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; System.Drawing;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; System.Linq;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; System.Text;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; System.Windows.Forms;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; button1_Click(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;EventArgs&lt;/span&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-US&quot;&gt;DialogResult&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; result;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;result = &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBox&lt;/span&gt;.Show(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;The Cd drive is not ready. \nReinsert and try again!&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Error on Drive&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBoxButtons&lt;/span&gt;.AbortRetryIgnore, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBoxIcon&lt;/span&gt;.Error);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;switch&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; (result)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;case&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;DialogResult&lt;/span&gt;.Abort:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-US&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;.Show(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Abort Selected&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;case&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;DialogResult&lt;/span&gt;.Retry:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-US&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;.Show(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Retry Selected&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;case&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;DialogResult&lt;/span&gt;.Ignore:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-US&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;.Show(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Ignore Selected&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;default&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-US&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;}&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;  &lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Result when executing:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr_H0u0r1DqZPjuqxysOKe3oEV2xMQSf4GrdGYrRjzVB1m0hXbNPd6iOxzN8pFaxNiJI2zN3OWQETD9zxTUqHDGT0z3knRTZpgUxXjMbhYy86dtvLrKcIztHLVbRdxWy_W1PfwAidN1C8l/s1600-h/MessageBox-AbortRetryIgnore-P.JPG&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr_H0u0r1DqZPjuqxysOKe3oEV2xMQSf4GrdGYrRjzVB1m0hXbNPd6iOxzN8pFaxNiJI2zN3OWQETD9zxTUqHDGT0z3knRTZpgUxXjMbhYy86dtvLrKcIztHLVbRdxWy_W1PfwAidN1C8l/s320/MessageBox-AbortRetryIgnore-P.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5224093057190757266&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/5074527027687987439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/5074527027687987439' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/5074527027687987439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/5074527027687987439'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/07/messagebox-using-abortretryignore.html' title='MessageBox using AbortRetryIgnore Button in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEhr_H0u0r1DqZPjuqxysOKe3oEV2xMQSf4GrdGYrRjzVB1m0hXbNPd6iOxzN8pFaxNiJI2zN3OWQETD9zxTUqHDGT0z3knRTZpgUxXjMbhYy86dtvLrKcIztHLVbRdxWy_W1PfwAidN1C8l/s72-c/MessageBox-AbortRetryIgnore-P.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-9001000576382396524</id><published>2008-06-27T19:52:00.000-07:00</published><updated>2011-04-27T08:40:43.970-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C# code"/><category scheme="http://www.blogger.com/atom/ns#" term="DialogResult"/><category scheme="http://www.blogger.com/atom/ns#" term="MessageBox"/><category scheme="http://www.blogger.com/atom/ns#" term="MessageBox YesNo"/><category scheme="http://www.blogger.com/atom/ns#" term="static method Show"/><category scheme="http://www.blogger.com/atom/ns#" term="switch"/><category scheme="http://www.blogger.com/atom/ns#" term="YesNo Button"/><title type='text'>MessageBox using YesNo Button</title><content type='html'>&lt;div style=&quot;float: left; margin: 2px; padding: 7px 7px 7px 0px;&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;pub-8945305614898998&quot;;
/* 200x200, creado 27/04/11 */
google_ad_slot = &quot;1261124235&quot;;
google_ad_width = 200;
google_ad_height = 200;
//--&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;/div&gt;With the previous post you could see that &lt;b&gt;MessageBox class&lt;/b&gt; is very powerful and contains a lot of options for the static method Show. Now we will see in more detail how to implement the functionalities of a Dialog containing a YesNo Button.&lt;br /&gt;
&lt;br /&gt;
When you give the user that option, it is obvious that the behavior of the Yes Button must be different from the No so you must set this.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s proceed to write an example. This C# code example has basicly 2 functions: when the Dialog popus up, the user must select between the Yes or No options. If the Yes is selected, the application exits. If the No button is clicked, a Dialog will appear. So here is the code:&lt;br /&gt;
&lt;span lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-GB&quot; style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;private&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; button1_Click(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #2b91af;&quot;&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;
{&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-GB&quot; style=&quot;color: #2b91af; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;DialogResult&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; result;&lt;br /&gt;
result = &lt;span style=&quot;color: #2b91af;&quot;&gt;MessageBox&lt;/span&gt;.Show(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Are you sure you want to exit?&quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Application 1&quot;&lt;/span&gt;, &lt;span style=&quot;color: #2b91af;&quot;&gt;MessageBoxButtons&lt;/span&gt;.YesNo);&lt;o:p&gt;&lt;br /&gt;
&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;if&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; (result == &lt;span style=&quot;color: #2b91af;&quot;&gt;DialogResult&lt;/span&gt;.No) {&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-GB&quot; style=&quot;color: #2b91af; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;   MessageBox&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;.Show(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;App won´t close&quot;&lt;/span&gt;);&lt;br /&gt;
}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;if&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; (result == &lt;span style=&quot;color: #2b91af;&quot;&gt;DialogResult&lt;/span&gt;.Yes) {&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-GB&quot; style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;   this&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;.Dispose();&lt;br /&gt;
}&lt;br /&gt;
}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-GB&quot;&gt;If there are more options that the user can choose from, a switch statment could be a better option:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span lang=&quot;EN-GB&quot; style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;witch&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; (result)&lt;br /&gt;
{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;case&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;DialogResult&lt;/span&gt;.No:&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-GB&quot; style=&quot;color: #2b91af; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;  MessageBox&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;.Show(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;App won´t close&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-GB&quot; style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;break&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;case&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;DialogResult&lt;/span&gt;.Yes:&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-GB&quot; style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;  this&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;.Dispose();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;default&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;
Result when executing:&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Scd1Ks-gFSVDgy3IlQNpCZr9wJogujLrEgPigcg7L3MjDFmyQCiojM42dAiOmvb_14TKFAuZc8z5iJfoOdqGyEqXXnWfEcJT7Uw8Z8aJ29WEP-854TXj7hBc9HGha1DAOHYnQu4_7rst/s1600-h/MessageBox-YesNoOption.JPG&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5216761381655593138&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Scd1Ks-gFSVDgy3IlQNpCZr9wJogujLrEgPigcg7L3MjDFmyQCiojM42dAiOmvb_14TKFAuZc8z5iJfoOdqGyEqXXnWfEcJT7Uw8Z8aJ29WEP-854TXj7hBc9HGha1DAOHYnQu4_7rst/s320/MessageBox-YesNoOption.JPG&quot; style=&quot;display: block; margin: 0px auto 10px; text-align: center;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-8945305614898998&quot;;
/* 468x60, creado 27/04/11 */
google_ad_slot = &quot;1893566146&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/9001000576382396524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/9001000576382396524' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/9001000576382396524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/9001000576382396524'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/06/messagebox-using-yesno-button.html' title='MessageBox using YesNo Button'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEh6Scd1Ks-gFSVDgy3IlQNpCZr9wJogujLrEgPigcg7L3MjDFmyQCiojM42dAiOmvb_14TKFAuZc8z5iJfoOdqGyEqXXnWfEcJT7Uw8Z8aJ29WEP-854TXj7hBc9HGha1DAOHYnQu4_7rst/s72-c/MessageBox-YesNoOption.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-3762586465399041409</id><published>2008-06-27T12:23:00.000-07:00</published><updated>2008-12-08T18:38:49.630-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Abort Retry Ignore"/><category scheme="http://www.blogger.com/atom/ns#" term="DialogResult"/><category scheme="http://www.blogger.com/atom/ns#" term="MessageBox"/><category scheme="http://www.blogger.com/atom/ns#" term="MessageBox Buttons"/><category scheme="http://www.blogger.com/atom/ns#" term="MessageBox properties"/><category scheme="http://www.blogger.com/atom/ns#" term="MessageBox Tunning"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows From"/><title type='text'>MessageBox Tuning in C#</title><content type='html'>&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;MessageBox class is used when you want to show some kind of information or when the application needs user intervention.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;This class contains static methods that help to interactuate with users. All you have to do is set the correct parameters of the show method. Some are: title, a proper message, icons, botons, quantities and more.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;The show method returns a DialogResult type value that will need to be evaluated in order to make future actions, for example, open another dialog window.&lt;br /&gt;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: georgia;&quot;&gt;Let’s look at some examples now:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: georgia;&quot;&gt;I´ll start by creating a Windows From. Next, I´ll add 5 Buttons controls to the form and create a click event for all of them. On the click event method I created different messageBoxs for each one. Let’s analize them:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;-For the button0, the code line is: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-US&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;.Show(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Hello&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Title Button0&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;  &lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;Nothing really complicated here. This creates a simple dialog with the text &lt;i style=&quot;&quot;&gt;Hello&lt;/i&gt;, owner &lt;i style=&quot;&quot;&gt;this&lt;/i&gt; and title &lt;i style=&quot;&quot;&gt;Title Button0&lt;/i&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3LXVia-N-Ll9l7gVh7RGwrGXP14u5DD_J3sAo6rQsSm1OkVitcaq9LD4B2ecHeaq7BG21kYwoJG_dtlk99smLy0VByk7c1Vob_9K-k7DlLJCyGf8b7m-4V2H-iB0TNXfV5abGEDVyPtnl/s1600-h/MessageBox-Accept.JPG&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3LXVia-N-Ll9l7gVh7RGwrGXP14u5DD_J3sAo6rQsSm1OkVitcaq9LD4B2ecHeaq7BG21kYwoJG_dtlk99smLy0VByk7c1Vob_9K-k7DlLJCyGf8b7m-4V2H-iB0TNXfV5abGEDVyPtnl/s320/MessageBox-Accept.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5216644494905860578&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;-For the button1, the code line is:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-US&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;.Show(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Abort, Retry, Ignore example&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Title 1&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBoxButtons&lt;/span&gt;.AbortRetryIgnore);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;This is a little more interesting. We indicated here that the title would be &lt;i style=&quot;&quot;&gt;Title 1&lt;/i&gt;, the message &lt;i style=&quot;&quot;&gt;&lt;span style=&quot;&quot;&gt;Abort, Retry, Ignore example&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;&quot;&gt; and the Button for this specific dialog is the &lt;i style=&quot;&quot;&gt;AbortRetryIgnore Button&lt;/i&gt;, the same one you see in most windows applications.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhguGVmiv4ajxtozPZjAkz2ykG5MnTvMWAilseST24GGeuJvlKnJNQxpB8pz6lgl3HaDGhj75_nO3Vc3jUTC_E8eG2q84r040-9Zs2-qf1PMtAzWSKPZikUX15tm2uZqWgA8CwbgdTJZV2P/s1600-h/MessageBox-AbortRetryIgnore.JPG&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhguGVmiv4ajxtozPZjAkz2ykG5MnTvMWAilseST24GGeuJvlKnJNQxpB8pz6lgl3HaDGhj75_nO3Vc3jUTC_E8eG2q84r040-9Zs2-qf1PMtAzWSKPZikUX15tm2uZqWgA8CwbgdTJZV2P/s320/MessageBox-AbortRetryIgnore.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5216645003822024482&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;-For the button2, the code line is:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-US&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;.Show(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Error on button2, Continue?&quot;&lt;/span&gt; , &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Title2&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBoxButtons&lt;/span&gt;.YesNo , &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBoxIcon&lt;/span&gt;.Error);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;This is very similar to the previus one: Owner &lt;i style=&quot;&quot;&gt;this&lt;/i&gt;, title &lt;i style=&quot;&quot;&gt;Title2&lt;/i&gt;, message &lt;i style=&quot;&quot;&gt;&lt;span style=&quot;&quot;&gt;Error on button2, Continue? &lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;&quot;&gt;, Button &lt;i style=&quot;&quot;&gt;YesNo&lt;/i&gt; and Icon &lt;i style=&quot;&quot;&gt;Error&lt;/i&gt;. This will create a dialog that contains both options Yes and No, and also an Error Icon located left of the message will appear.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW0R8AxoeMXh0zJrfHSfFvSs7Lc8SnZqOyHU9T9n8X-aK8WinLNalr8I07jwO4OG5TEGtoNQo0sPAyFzVhstP5uHi5sGRBJbZz2aO8_hzDwVLCTeW3P_gEmAZJSL41s32RSU79Y4VG2wKW/s1600-h/MessageBox-YesNo.JPG&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW0R8AxoeMXh0zJrfHSfFvSs7Lc8SnZqOyHU9T9n8X-aK8WinLNalr8I07jwO4OG5TEGtoNQo0sPAyFzVhstP5uHi5sGRBJbZz2aO8_hzDwVLCTeW3P_gEmAZJSL41s32RSU79Y4VG2wKW/s320/MessageBox-YesNo.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5216645506729235906&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;-For the button3, the code line is: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-US&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;.Show(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Warning&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Button3 Title&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBoxButtons&lt;/span&gt;.OK, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBoxIcon&lt;/span&gt;.Warning); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;Similar to the others but now the Button is the &lt;i style=&quot;&quot;&gt;Ok&lt;/i&gt; button and the Icon &lt;i style=&quot;&quot;&gt;Warning&lt;/i&gt; will apear. So the purpose of this is to indicate an error, warning or a message that the user must see and give the only option of clicking the OK button.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5PgwCAD3R061hCqwZikPp0TQvTzunRE3tDxGU-yMBZuhdr0yMI1pNONRsfyZI7ZGDxlRVJGzM-3TKB0KVCXVZNUSiSqEAGeni67p2TorREjWqCQMT4thxoZ0HBeaL-9sh3JbUxi9mQYzt/s1600-h/MessageBox-Accept-Warning.JPG&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5PgwCAD3R061hCqwZikPp0TQvTzunRE3tDxGU-yMBZuhdr0yMI1pNONRsfyZI7ZGDxlRVJGzM-3TKB0KVCXVZNUSiSqEAGeni67p2TorREjWqCQMT4thxoZ0HBeaL-9sh3JbUxi9mQYzt/s320/MessageBox-Accept-Warning.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5216644718367156162&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;-For the button4, the code line is:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CWindows%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:hyphenationzone&gt;21&lt;/w:HyphenationZone&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 3.0cm 70.85pt 3.0cm; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Tabla normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(43, 145, 175);&quot; lang=&quot;EN-US&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;.Show(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Warning&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Button4 title&quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBoxButtons&lt;/span&gt;.RetryCancel, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBoxIcon&lt;/span&gt;.Asterisk, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;MessageBoxDefaultButton&lt;/span&gt;.Button3);&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;   lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;Here the Button is the usual &lt;i style=&quot;&quot;&gt;RetryCancel&lt;/i&gt;, the Icon &lt;i style=&quot;&quot;&gt;Asterisk&lt;/i&gt; and the DefautlButton indicated to Button3. This defines the constat button.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8th1MtpbUjJ-W9O_3hTjDh3lUnIERWfJlOxnXxTlkCk13-u2bg3xdi0y4kAPCjOi0wRCyCU61nUVBtMoGtFnHNIZ45yQLp7IDUWByCCCj6LiGr5bGIf20maYvUnXsQPDCHYUNtoOwh2s7/s1600-h/MessageBox-RetryCancel.JPG&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8th1MtpbUjJ-W9O_3hTjDh3lUnIERWfJlOxnXxTlkCk13-u2bg3xdi0y4kAPCjOi0wRCyCU61nUVBtMoGtFnHNIZ45yQLp7IDUWByCCCj6LiGr5bGIf20maYvUnXsQPDCHYUNtoOwh2s7/s320/MessageBox-RetryCancel.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5216645243169600482&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;&quot; lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/3762586465399041409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/3762586465399041409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/3762586465399041409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/3762586465399041409'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/06/messagebox-tuning-in-c.html' title='MessageBox Tuning in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEi3LXVia-N-Ll9l7gVh7RGwrGXP14u5DD_J3sAo6rQsSm1OkVitcaq9LD4B2ecHeaq7BG21kYwoJG_dtlk99smLy0VByk7c1Vob_9K-k7DlLJCyGf8b7m-4V2H-iB0TNXfV5abGEDVyPtnl/s72-c/MessageBox-Accept.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-7704512459616800107</id><published>2008-06-19T08:54:00.000-07:00</published><updated>2008-12-08T18:38:49.905-08:00</updated><title type='text'>Writing Registry keys</title><content type='html'>&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;We saw before how to read a registry key. Writing is similar and also accomplished by the &lt;span style=&quot;color:black;&quot;&gt;RegistryKey object. C# .Net provides very easy methods under this object to write keys. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span  lang=&quot;EN-GB&quot; style=&quot;color:black;&quot;&gt;Be aware that the registry is a key part of an Operating System so you should know exactly what you are doing before actually doing it. Check every single line of the code written. On this example I’ll show you below, I will create a couple of keys with its proper folder too. By doing this I can be sure that any other registry key would be overwritten.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Take a look now at this example:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;          &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; System;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Text;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; Microsoft.Win32;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;                &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;namespace&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; WritingRegKeys&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;Program&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; &lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;br /&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;            &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;RegistryKey&lt;/span&gt; RegKeyWrite = &lt;span style=&quot;color: teal;&quot;&gt;Registry&lt;/span&gt;.CurrentUser;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;RegKeyWrite = RegKeyWrite.CreateSubKey&lt;br /&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Software\\MySoftware\\SubKeys&quot;&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;RegKeyWrite.SetValue(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Try&quot;&lt;/span&gt;, &lt;span style=&quot;color: maroon;&quot;&gt;&quot;True&quot;&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;RegKeyWrite.SetValue(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;NumberValue&quot;&lt;/span&gt;, 1);&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;RegKeyWrite.Close();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;                &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;RegistryKey&lt;/span&gt; RegKeyRead = &lt;span style=&quot;color: teal;&quot;&gt;Registry&lt;/span&gt;.CurrentUser;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;RegKeyRead = RegKeyRead.OpenSubKey(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Software\\MySoftware\\SubKeys&quot;&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;Object&lt;/span&gt; regTry = RegKeyRead.GetValue(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Try&quot;&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;Object&lt;/span&gt; regNumber = RegKeyRead.GetValue(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;NumberValue&quot;&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;RegKeyRead.Close();&lt;br /&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Try value: &quot;&lt;/span&gt; + (&lt;span style=&quot;color: teal;&quot;&gt;String&lt;/span&gt;)regTry + &lt;span style=&quot;color: maroon;&quot;&gt;&quot; - - NumberValue: &quot;&lt;/span&gt; +&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;regNumber);&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;br /&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;You can see that after creating the RegistryKey object I also created a subkey with the CreateSubKey method. This will generate another “subfolder” under MySoftware.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;The Complete root is: HKEY_CURRENT_USER\Software\MySoftware\SubKeys.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;With the RegKeyWrite.SetValue you have to specify the name of that key and the actual values you want to be stored. You can see that the fist value to be stored is a String and the second a Numeric value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;You can try this by reading the keys created above. That why the &lt;span style=&quot;&quot;&gt;RegKeyRead Object is also created. Then we just open the SubKey and ask the values for the &lt;b style=&quot;&quot;&gt;Try&lt;/b&gt; key and the &lt;b style=&quot;&quot;&gt;NumberValue&lt;/b&gt; key. Run the code and the Console should look something like this:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm_v8KqQOhtZ8dG87cARCYAnjlpNsjNW9KM_ryKmrrYiisE-GgS4OgdLE1eUvKu5fBbdMDQdtB5vPCPFEQg0JChX_0wCeTj-iY5_m6kEOnfp41xvKTX7WyPCTpTtbrb-LkVtXHd7J4pQgp/s1600-h/Untitled-12.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm_v8KqQOhtZ8dG87cARCYAnjlpNsjNW9KM_ryKmrrYiisE-GgS4OgdLE1eUvKu5fBbdMDQdtB5vPCPFEQg0JChX_0wCeTj-iY5_m6kEOnfp41xvKTX7WyPCTpTtbrb-LkVtXHd7J4pQgp/s400/Untitled-12.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5213622440288238290&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;When you execute the code, a new registry should be created. So let’s take a look at the registry to see if this is true. Open regedit to see the changes. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmnlwb0NCZ-aiq1lSilNq_656CK7i8SrXHwwoW-X6hX1ZqFi6XcNwChPMIkV1BKdWl1e7mrZaVN46xhbDtUDzNguZbiM6cI39pVbB2539pyUIXdX-LNKdnSJ_M5fPa5qdsHFdZrz0mJsst/s1600-h/regView.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmnlwb0NCZ-aiq1lSilNq_656CK7i8SrXHwwoW-X6hX1ZqFi6XcNwChPMIkV1BKdWl1e7mrZaVN46xhbDtUDzNguZbiM6cI39pVbB2539pyUIXdX-LNKdnSJ_M5fPa5qdsHFdZrz0mJsst/s400/regView.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5213622344256414498&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/7704512459616800107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/7704512459616800107' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/7704512459616800107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/7704512459616800107'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/06/writing-registry-keys.html' title='Writing Registry keys'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEhm_v8KqQOhtZ8dG87cARCYAnjlpNsjNW9KM_ryKmrrYiisE-GgS4OgdLE1eUvKu5fBbdMDQdtB5vPCPFEQg0JChX_0wCeTj-iY5_m6kEOnfp41xvKTX7WyPCTpTtbrb-LkVtXHd7J4pQgp/s72-c/Untitled-12.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-8278765692967800299</id><published>2008-06-07T10:45:00.000-07:00</published><updated>2008-12-08T18:38:50.013-08:00</updated><title type='text'>Accessing the Registry for reading keys in C#</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;color: black;&quot; lang=&quot;EN-GB&quot;&gt;C# contains class object that make the job of manipulating the registry very easy.&lt;br /&gt;Also, the registry is indexed that make much faster the reading job.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Ok, let’s now proceed to read from the registry.&lt;br /&gt;First you need to make the import of the Microsoft.Win32 namespace that contains the registry access functions.&lt;br /&gt;The second important thing you need to use &lt;span style=&quot;color: black;&quot;&gt;RegistryKey object to make the actual reading.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: black;&quot; lang=&quot;EN-GB&quot;&gt;Let’s now write a small piece of code to see how this works.&lt;span style=&quot;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Text;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; Microsoft.Win32;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;namespace&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; RegRead&lt;br /&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;Program&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; &lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;br /&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;                &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;//Example 1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;RegistryKey&lt;/span&gt; RegKey = &lt;span style=&quot;color: teal;&quot;&gt;Registry&lt;/span&gt;.LocalMachine;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;RegKey = RegKey.OpenSubKey(&lt;br /&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\1&quot;&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;Object&lt;/span&gt; cpuName = RegKey.GetValue(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;ProcessorNameString&quot;&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Your CPU name is:&quot;&lt;/span&gt; + cpuName);&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;            &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;//Example 2&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;RegistryKey&lt;/span&gt; RegKey2 = &lt;span style=&quot;color: teal;&quot;&gt;Registry&lt;/span&gt;.CurrentUser;&lt;br /&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;RegKey2 = RegKey2.OpenSubKey(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Printers&quot;&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;Object&lt;/span&gt; printerName = RegKey2.GetValue(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;DeviceOld&quot;&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Your Printer name is: &quot;&lt;/span&gt; + printerName);&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;.Read();&lt;br /&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;}&lt;br /&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: black;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:TimesNewRoman;color:black;&quot;   lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot;&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:TimesNewRoman;color:black;&quot;   lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk8NHn9PJOlugGd8IoML-aF_VnsMOxcuwIRf1xJ02Mafi9hEgLBYBjk80m5SnLGQ2EjWzcr5WxO4L314CO5iZjXPwFio6dmBcn8nYpnH86hHNA8Lkrze_p5yWA-XpA-50l6jmebRydVJBF/s1600-h/ConsoleRegRead.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk8NHn9PJOlugGd8IoML-aF_VnsMOxcuwIRf1xJ02Mafi9hEgLBYBjk80m5SnLGQ2EjWzcr5WxO4L314CO5iZjXPwFio6dmBcn8nYpnH86hHNA8Lkrze_p5yWA-XpA-50l6jmebRydVJBF/s400/ConsoleRegRead.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5209197729880896018&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;;font-family:TimesNewRoman;color:black;&quot;   lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;  &lt;/p&gt;        &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: black;&quot; lang=&quot;EN-GB&quot;&gt;The first thing you need to do is to import the &lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Microsoft.Win32 namespace.&lt;br /&gt;Then, if you look at the definition of the instance of the &lt;span style=&quot;color: black;&quot;&gt;RegistryKey object, you will see that it is pointing to Local Machine, which means that the HKEY_LOCAL_MACHINE folder will be enable for reading.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: black;&quot; lang=&quot;EN-GB&quot;&gt;(To open the Registry editor just go to start-&gt;Run: regedit).&lt;br /&gt;After this step, we simple need to find the folders/subfolders where the key is located and read it.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: black;&quot; lang=&quot;EN-GB&quot;&gt;The second example is pretty much the same. The only major difference is that the&lt;br /&gt;HKEY_CURRENT_USER folder will be available.&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/8278765692967800299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/8278765692967800299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/8278765692967800299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/8278765692967800299'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/06/accessing-registry-for-reading-keys-in.html' title='Accessing the Registry for reading keys in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEgk8NHn9PJOlugGd8IoML-aF_VnsMOxcuwIRf1xJ02Mafi9hEgLBYBjk80m5SnLGQ2EjWzcr5WxO4L314CO5iZjXPwFio6dmBcn8nYpnH86hHNA8Lkrze_p5yWA-XpA-50l6jmebRydVJBF/s72-c/ConsoleRegRead.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-7208787801288699348</id><published>2008-05-30T15:27:00.000-07:00</published><updated>2008-12-08T18:38:50.280-08:00</updated><title type='text'>Advance C# programming, overload unary plus.</title><content type='html'>&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;C# let’s you overload the behaviour of some unary operator such as: unary plus, minus, prefix increment, decrement, true keyword, false keyword and more.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Ok, now let’s make a small example on how to overload the unary plus. For this, you need to define a method (in the class that you want to implement the overload) containing a few things: the return type, the operator keywords (in this case +), the parameter that usually is the object or structure where the method is being defined.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Let’s make now a small example:&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;-First we create a small class and define the overload plus:&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;MyClass&lt;/span&gt;&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; value;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;MyClass&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;operator&lt;/span&gt; +(&lt;span style=&quot;color: teal;&quot;&gt;MyClass&lt;/span&gt; Mc)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;              &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;MyClass&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; myC = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;MyClass&lt;/span&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (Mc.value &lt;0)&lt;br /&gt;myC.value = -Mc.value;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;myC.value = Mc.value;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; myC;&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;-&lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; &lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;MyClass&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; MyCs = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;MyClass&lt;/span&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;MyClass&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; MyCsP = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;MyClass&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Both negative and positive values to see effect&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;MyCs.value = -10.80;&lt;br /&gt;MyCsP.value = 300;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Before: &quot;&lt;/span&gt; + MyCs.value);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;\t&quot;&lt;/span&gt; + MyCsP.value);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Using the + operator triggers the method&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;MyCs = +MyCs;&lt;br /&gt;MyCsP = +MyCsP;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;After:&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&quot;&lt;/span&gt; + MyCs.value);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;\t&quot;&lt;/span&gt; + MyCsP.value);&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;.Read();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;-Console:&lt;/span&gt;&lt;/b&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCA5LB8l-JG5a1Lu_-QMswIu2l6wh_V423A8vIHo7vEbRvigN7D9pU3NDs5sDHg1o-k0q7r4T3wDDlTC3ZT9KbQSzdSgT3R7YdIb-rhFT63dqQ6zRhKFhpjhYV-iwkVIKeC7uqP_NGLsmv/s1600-h/Untitled-11.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCA5LB8l-JG5a1Lu_-QMswIu2l6wh_V423A8vIHo7vEbRvigN7D9pU3NDs5sDHg1o-k0q7r4T3wDDlTC3ZT9KbQSzdSgT3R7YdIb-rhFT63dqQ6zRhKFhpjhYV-iwkVIKeC7uqP_NGLsmv/s320/Untitled-11.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5206301556852169154&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/7208787801288699348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/7208787801288699348' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/7208787801288699348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/7208787801288699348'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/05/advance-c-programming-overload-unary.html' title='Advance C# programming, overload unary plus.'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEiCA5LB8l-JG5a1Lu_-QMswIu2l6wh_V423A8vIHo7vEbRvigN7D9pU3NDs5sDHg1o-k0q7r4T3wDDlTC3ZT9KbQSzdSgT3R7YdIb-rhFT63dqQ6zRhKFhpjhYV-iwkVIKeC7uqP_NGLsmv/s72-c/Untitled-11.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-7116952058991623115</id><published>2008-05-19T16:23:00.000-07:00</published><updated>2008-05-26T11:56:18.413-07:00</updated><title type='text'>MouseDown Event in C#.</title><content type='html'>&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;The MouseDown event is the one I personally use every time a control needs both events for left and right click (middle click is also supported).&lt;br /&gt;So lest say we want to add the mouseDown event to a Button control somewhere in a windows form. So you can go ahead and add this event.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;This header shows appear in the form:&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;color:blue;&quot;   lang=&quot;EN-GB&quot; &gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; button2_MouseDown(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: teal;&quot;&gt;MouseEventArgs&lt;/span&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;  lang=&quot;EN-GB&quot; &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;So lets proceed to add some code here.&lt;br /&gt;The way to see which button has been clicked is by using a switch statement:&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;switch&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (e.Button)&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;case&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: teal;&quot;&gt;MouseButtons&lt;/span&gt;.Left:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Place here event for left click&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;case&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: teal;&quot;&gt;MouseButtons&lt;/span&gt;.Right:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Place here event for right click&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;default&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Great, now your application can distinguish between lest and right click.&lt;br /&gt;To make sure this works, you can add a messageBox saying what event should run.&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Complete Code:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; button2_MouseDown(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: teal;&quot;&gt;MouseEventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;switch&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (e.Button)&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;case&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: teal;&quot;&gt;MouseButtons&lt;/span&gt;.Left:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.Show(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: maroon;&quot;&gt;&quot;Left Button Click&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;case&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: teal;&quot;&gt;MouseButtons&lt;/span&gt;.Right:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.Show(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: maroon;&quot;&gt;&quot;Right Button Click&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;default&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;  lang=&quot;EN-GB&quot; &gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/7116952058991623115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/7116952058991623115' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/7116952058991623115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/7116952058991623115'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/05/mousedown-event-in-c.html' title='MouseDown Event in C#.'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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-1192303979382219540.post-1222920604948578802</id><published>2008-05-07T10:19:00.000-07:00</published><updated>2008-12-08T18:38:51.198-08:00</updated><title type='text'>Creating Tooltip to Button Control from scratch</title><content type='html'>&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;First of all, start by creating a new Windows form application in Visual Studio 2005. (You can download the Express Edition clicking the link on My Links section). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;After that, place a Button Control somewhere in the form as you see below:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixQmO4Ul73kol8cvoIWBtuhPN7HkWrQRfN6Wa_-4u3RQNAQke1orXCBFmSe5AqmHHWwNHAsqY0qozrSgpmbrsvw3hdXL2eHRwVVtNSBjkDNar_x3DRoByAL0oRzY6vR9THSNJly9V1ZlqA/s1600-h/ToolTip1.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixQmO4Ul73kol8cvoIWBtuhPN7HkWrQRfN6Wa_-4u3RQNAQke1orXCBFmSe5AqmHHWwNHAsqY0qozrSgpmbrsvw3hdXL2eHRwVVtNSBjkDNar_x3DRoByAL0oRzY6vR9THSNJly9V1ZlqA/s320/ToolTip1.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5197687146419308530&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Ok, now we can proceed to add the tooltip event to the button1. This is actually very easy. I will show you the way I use for doing this.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Navigate through the toolbox until you find the tooltip control. Grab the control and place it somewhere in the form. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;You will see that the Control is placed in a bar below the form. Also the Tooltip Control is created with the name tooltip1. Ok, now let’s add some event and write a few code lines.&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Click the button1 and under properties double click the MouseHover event. This creates the method that we use for the tooltip control. Now in the method body add this line of code:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;  &lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;toolTip1.SetToolTip(button1, &lt;span style=&quot;color: maroon;&quot;&gt;&quot;Information for Button1&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Great, now run the app and see what happens. It should look something like this:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEsr6SZ0kvxO-KuNwHmkRB4LIPksmZkqmYeCgT9VAaJ6uW5SrigyA3L9ijWr1oD8VAGG-ldX5eB923HBwjly0Gwl4WMwZW1Yv3WdndfemIuwxeJXuS4wpsDv-3ZokfXyhVGnuZvz6DB4TH/s1600-h/ToolTip2.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEsr6SZ0kvxO-KuNwHmkRB4LIPksmZkqmYeCgT9VAaJ6uW5SrigyA3L9ijWr1oD8VAGG-ldX5eB923HBwjly0Gwl4WMwZW1Yv3WdndfemIuwxeJXuS4wpsDv-3ZokfXyhVGnuZvz6DB4TH/s320/ToolTip2.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5197687288153229314&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;&quot;&gt;Some other cool features on this C# Control:&lt;br /&gt;&lt;span style=&quot;&quot;&gt;-&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;&quot;&gt;toolTip1.&lt;b style=&quot;&quot;&gt;IsBalloon&lt;/b&gt; = &lt;span style=&quot;color:blue;&quot;&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl_T0x9v_Y6ZgJaEXfhwcivwc1Dfadfr8kpFGGWVcaPvAwsBidnihb3PKMVHGG5bDAjvdd74B5UBsJ-8FQzf_F-H8xDZdvkloZKeQNmVWScz7RN5u77ddq4AtniCkZ5rjetEsjXa6e8UQy/s1600-h/ToolTip3.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl_T0x9v_Y6ZgJaEXfhwcivwc1Dfadfr8kpFGGWVcaPvAwsBidnihb3PKMVHGG5bDAjvdd74B5UBsJ-8FQzf_F-H8xDZdvkloZKeQNmVWScz7RN5u77ddq4AtniCkZ5rjetEsjXa6e8UQy/s320/ToolTip3.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5197689667565111362&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;(Converts to a ballon window)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;&quot;&gt;&lt;span style=&quot;&quot;&gt;-&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;&quot;&gt;toolTip1.ToolTipIcon = &lt;span style=&quot;color:teal;&quot;&gt;ToolTipIcon&lt;/span&gt;.Error;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;(Assign icon to the tooltip)&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;-&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;toolTip1.ToolTipTitle = &lt;span style=&quot;color:maroon;&quot;&gt;&quot;This is the Title&quot;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;(Assigns a title) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt; &lt;/span&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPEJu1Rh1rERd_-BShOMAsjZAAuDwTWJGU6NsPCjQ5tei9DWiZD6Wr_XwLodCJW4xlgQPSx9_kmzP5udm9MtyevD1N53DMCc9JBjH2p58IA0qmI01fKuUxN5UmULQ2O2ZqPZLje6Wx_M2u/s1600-h/ToolTip4.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPEJu1Rh1rERd_-BShOMAsjZAAuDwTWJGU6NsPCjQ5tei9DWiZD6Wr_XwLodCJW4xlgQPSx9_kmzP5udm9MtyevD1N53DMCc9JBjH2p58IA0qmI01fKuUxN5UmULQ2O2ZqPZLje6Wx_M2u/s320/ToolTip4.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5197687481426757666&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Complete Code:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;              &lt;p class=&quot;MsoNormal&quot;&gt;  &lt;/p&gt;              &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; button1_MouseHover(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: teal;&quot;&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;toolTip1.SetToolTip(button1, &lt;span style=&quot;color: maroon;&quot;&gt;&quot;Information for Button1&quot;&lt;/span&gt;);&lt;br /&gt;toolTip1.IsBalloon = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;toolTip1.ToolTipIcon = &lt;span style=&quot;color: teal;&quot;&gt;ToolTipIcon&lt;/span&gt;.Error;&lt;br /&gt;toolTip1.ToolTipTitle = &lt;span style=&quot;color: maroon;&quot;&gt;&quot;This is the Title&quot;&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;  &gt;&lt;/span&gt;&lt;span style=&quot;;font-family:&amp;quot;;font-size:10;&quot;  lang=&quot;EN-GB&quot; &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/1222920604948578802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/1222920604948578802' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/1222920604948578802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/1222920604948578802'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/05/creating-tooltip-to-button-control-from.html' title='Creating Tooltip to Button Control from scratch'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEixQmO4Ul73kol8cvoIWBtuhPN7HkWrQRfN6Wa_-4u3RQNAQke1orXCBFmSe5AqmHHWwNHAsqY0qozrSgpmbrsvw3hdXL2eHRwVVtNSBjkDNar_x3DRoByAL0oRzY6vR9THSNJly9V1ZlqA/s72-c/ToolTip1.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-3291485671712947507</id><published>2008-04-28T08:33:00.000-07:00</published><updated>2008-04-28T08:36:53.714-07:00</updated><title type='text'>Deleting elements from a list while iterating</title><content type='html'>&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;In C# you are not allowed to iterate and delete elements from a list at the same time. So what you need to do is to find a way to delete these elements later, after knowing what you are going to eliminate. In C++ you won’t have this problem but in C# an exception will be triggered. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;This example below demonstrates how to solve this nicely. Basically what it does is that looks for none existing files from your hard drive and saves these on a separate List. Suppose that the object Element contains a string value representing a file path:&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; validateList() {&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//New list that will contain the Objects to be deleted later on.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;List&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;&lt;span style=&quot;color: teal;&quot;&gt;Element&lt;/span&gt;&gt; listToDelete = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;List&lt;/span&gt;&lt;&lt;span style=&quot;color: teal;&quot;&gt;Element&lt;/span&gt;&gt;();&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;              &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//ListAll contains all the Element objects&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (&lt;span style=&quot;color: teal;&quot;&gt;Element&lt;/span&gt; e &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; listAll()) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; location = e.loc;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;(!&lt;span style=&quot;color: teal;&quot;&gt;File&lt;/span&gt;.Exists(location)){&lt;br /&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;listToDelete.Add(e);&lt;br /&gt;}&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;              &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (&lt;span style=&quot;color: teal;&quot;&gt;Element&lt;/span&gt; e &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; listToDelete) {&lt;br /&gt;listAll.Remove&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;(e);&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;}&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/3291485671712947507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/3291485671712947507' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/3291485671712947507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/3291485671712947507'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/04/deleting-elements-from-list-while.html' title='Deleting elements from a list while iterating'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-6382231443168668587</id><published>2008-04-20T11:01:00.000-07:00</published><updated>2008-12-08T18:38:51.319-08:00</updated><title type='text'>Text file Reading and Writing in C#</title><content type='html'>&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;This program below demonstrates the use of StreamWriter and StreamReader (both derive form the &lt;span class=&quot;serif&quot;&gt;abstract type&lt;/span&gt;&lt;/span&gt; TextWriter and TextReader respectively&lt;span class=&quot;serif&quot;&gt;). The .Net Framework has simple solutions to work with files. &lt;span style=&quot;&quot;&gt; &lt;/span&gt;When working with text files there are usually three common steps: &lt;/span&gt;          &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span class=&quot;serif&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[if !supportLists]--&gt;  &lt;/p&gt;&lt;span class=&quot;serif&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;1-&lt;span style=&quot;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;!--[if !supportLists]--&gt;Opening the file&lt;br /&gt;&lt;span class=&quot;serif&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;2-&lt;span style=&quot;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;!--[if !supportLists]--&gt;Reading/Writing&lt;br /&gt;&lt;span class=&quot;serif&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;3-&lt;span style=&quot;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span class=&quot;serif&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Closing it&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;span class=&quot;serif&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;span class=&quot;serif&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;serif&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span class=&quot;serif&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;Now, lets take a look at this example:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Text;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.IO;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot;&gt;namespace&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; ConsoleApplication&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;span style=&quot;color: teal;&quot;&gt;Program&lt;/span&gt;&lt;br /&gt;{&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; &lt;st1:place st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//C# Code for writing into a file we call: File.txt&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;FileInfo&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; f = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;FileInfo&lt;/span&gt;(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;File.txt&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;StreamWriter&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; Text = f.CreateText();&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Insert text in separate lines&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;Text.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;--&gt;Line One content&quot;&lt;/span&gt;);&lt;br /&gt;Text.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;---&gt;Line Two Content&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;              &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Insert text but does not create a new line&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;Text.Write(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;----&gt;Line Three &quot;&lt;/span&gt;);&lt;br /&gt;Text.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Content&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//To create new Line.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;Text.Write(Text.NewLine);&lt;br /&gt;Text.WriteLine(System.&lt;span style=&quot;color: teal;&quot;&gt;DateTime&lt;/span&gt;.Now);&lt;br /&gt;Text.Close();&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Calling the method to read File.txt&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;readFiles();&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;.Read();&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;      &lt;div&gt;              &lt;/div&gt;                  &lt;div style=&quot;text-align: center;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-pCEH69vblGWDPU5tpleNwVHereFXZRIKfKXyfz6nZ2gQbh4QtW4awjgtTWXZj2az5ERJakJHAMqgTLng6n9rmu1mEb4ML2_vbipvdJa7F-YXr5jCWkcx71u1n3K-VB99JrlpPU73pFFy/s1600-h/Untitled-10.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-pCEH69vblGWDPU5tpleNwVHereFXZRIKfKXyfz6nZ2gQbh4QtW4awjgtTWXZj2az5ERJakJHAMqgTLng6n9rmu1mEb4ML2_vbipvdJa7F-YXr5jCWkcx71u1n3K-VB99JrlpPU73pFFy/s320/Untitled-10.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5191390782832924210&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; readFiles()&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;{&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//We open File.txt&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;StreamReader&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; sr = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;StreamReader&lt;/span&gt;(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;File.txt&quot;&lt;/span&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; lines = &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Here we do a while loop in order to look for none empty lines.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;while&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; ((lines = sr.ReadLine()) != &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(lines);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;sr.Close();&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/6382231443168668587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/6382231443168668587' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/6382231443168668587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/6382231443168668587'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/04/text-file-reading-and-writing-in-c.html' title='Text file Reading and Writing in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEj-pCEH69vblGWDPU5tpleNwVHereFXZRIKfKXyfz6nZ2gQbh4QtW4awjgtTWXZj2az5ERJakJHAMqgTLng6n9rmu1mEb4ML2_vbipvdJa7F-YXr5jCWkcx71u1n3K-VB99JrlpPU73pFFy/s72-c/Untitled-10.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1192303979382219540.post-3302074105694655913</id><published>2008-04-10T09:05:00.000-07:00</published><updated>2008-04-10T09:06:59.623-07:00</updated><title type='text'>Connection to a data source in C#</title><content type='html'>&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Here is an easy way to get access for example, to an Access database located in your program folder using &lt;st1:city st=&quot;on&quot;&gt;&lt;st1:place st=&quot;on&quot;&gt;ADO&lt;/st1:place&gt;&lt;/st1:City&gt; .NET .&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;//Add this namespace for database handle&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; System.Data.OleDb;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; &lt;span style=&quot;color: teal;&quot;&gt;OleDbConnection&lt;/span&gt; GetConnection()&lt;br /&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;{&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;OleDbConnection&lt;/span&gt; acc = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;OleDbConnection&lt;/span&gt;();&lt;br /&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;conn.ConnectionString = &lt;span style=&quot;color: maroon;&quot;&gt;&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb&quot;&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; acc;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;/span&gt;}&lt;/span&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;Later, when you want to open the database to load, save or whatever you need to do you can use the sentence, being Instance() a method used by Singleton pattern and ConnectionMgr the class name for managing connections:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;IDbConnection&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; acc = &lt;span style=&quot;color: teal;&quot;&gt;ConnectionMgr&lt;/span&gt;.Instance().GetConnection();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/3302074105694655913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/3302074105694655913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/3302074105694655913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/3302074105694655913'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/04/connection-to-data-source-in-c.html' title='Connection to a data source in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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-1192303979382219540.post-5960657118724475151</id><published>2008-04-10T09:04:00.000-07:00</published><updated>2008-04-10T09:05:04.894-07:00</updated><title type='text'>Convert Icon to Image in C#</title><content type='html'>&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;This is actually very easy since we can use methods provided by the framework.So let’s write an example of how easy this is.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;    &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;Icon&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; a = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;Icon&lt;/span&gt;(location);&lt;span style=&quot;color: green;&quot;&gt;//location can be a string pointing to a file in your hard drive&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot;&gt;Image&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; im = a.ToBitmap();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/5960657118724475151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/5960657118724475151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/5960657118724475151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/5960657118724475151'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/04/convert-icon-to-image-in-c.html' title='Convert Icon to Image in C#'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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-1192303979382219540.post-1746565456457259376</id><published>2008-04-01T10:18:00.000-07:00</published><updated>2008-12-08T18:38:51.641-08:00</updated><title type='text'>The continue and goto statements.</title><content type='html'>&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;The continue&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt; statement basically what is does is that it return controls to the boolean expressing that controls an iteration statement. Example: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;                &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; i = -6; i != 0; i++)&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (i == -3)&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;continue&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;i value: &quot;&lt;/span&gt; + i);&lt;br /&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;So when the continue statement is executed under the if condition, it tells the for iteration to continue to the next iteration, and because of this the value -3 does not appear in the console.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrKNkNLzW2S8y5tR2VBqYyfe6YOOYoMfG_x-GzeXrS7HUC4yfIgZH3QhvXoYOIJcoEoqoHKRJBeLA-irSYbdXPynmtPgx3Ws67W-U93Xmep7hP4pXQG5xwdh8Oi5TkwjVOijeDDDBydscA/s1600-h/Untitled-8.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrKNkNLzW2S8y5tR2VBqYyfe6YOOYoMfG_x-GzeXrS7HUC4yfIgZH3QhvXoYOIJcoEoqoHKRJBeLA-irSYbdXPynmtPgx3Ws67W-U93Xmep7hP4pXQG5xwdh8Oi5TkwjVOijeDDDBydscA/s320/Untitled-8.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5184327778142717986&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;The Continue statement is commonly used in while, do, for, switch and foreach statements.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;The goto&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt; statement is very useful when you need to unconditionally transfer control to a labelled statements. In C# to make a labels statement is very easy, just place a name for the labelled followed by “:” on any statement. Example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;                                  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; j = 0; j != 7; j++)&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: teal;&quot; lang=&quot;EN-GB&quot;&gt;Console&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;j value: &quot;&lt;/span&gt; + j);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; (j == 4)&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;&quot; lang=&quot;EN-GB&quot;&gt;goto&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot; lang=&quot;EN-GB&quot;&gt; Exit;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Exit: &lt;span style=&quot;color: teal;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Exit reached, loop finished&quot;&lt;/span&gt;);&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;/span&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;&quot; lang=&quot;EN-GB&quot;&gt;You can also use it in a switch statement by writing for example, “goto case &lt;st1:metricconverter productid=&quot;2”&quot; st=&quot;on&quot;&gt;2”&lt;/st1:metricconverter&gt;.&lt;/span&gt;&lt;/p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUU2aLc6dXfV8sowYSeiPFrUQKZZ_41EIHrRb_crTM_kegwkTsUNJ-1cJzgbCQKpiF63HtTy3e7Q8QWvpewRG9SiusnSacy1JT-kK_PG5gHe42iupAkwK9TrmstglhpktzI1oHZXwsUkor/s1600-h/Untitled-9.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUU2aLc6dXfV8sowYSeiPFrUQKZZ_41EIHrRb_crTM_kegwkTsUNJ-1cJzgbCQKpiF63HtTy3e7Q8QWvpewRG9SiusnSacy1JT-kK_PG5gHe42iupAkwK9TrmstglhpktzI1oHZXwsUkor/s320/Untitled-9.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5184327872631998514&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://coders-project.blogspot.com/feeds/1746565456457259376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1192303979382219540/1746565456457259376' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/1746565456457259376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1192303979382219540/posts/default/1746565456457259376'/><link rel='alternate' type='text/html' href='http://coders-project.blogspot.com/2008/04/continue-and-goto-statements.html' title='The continue and goto statements.'/><author><name>CoderG</name><uri>http://www.blogger.com/profile/16980585448425937563</uri><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/AVvXsEjrKNkNLzW2S8y5tR2VBqYyfe6YOOYoMfG_x-GzeXrS7HUC4yfIgZH3QhvXoYOIJcoEoqoHKRJBeLA-irSYbdXPynmtPgx3Ws67W-U93Xmep7hP4pXQG5xwdh8Oi5TkwjVOijeDDDBydscA/s72-c/Untitled-8.gif" height="72" width="72"/><thr:total>0</thr:total></entry></feed>