<?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-7541358197920037504</id><updated>2024-08-31T10:59:38.038-07:00</updated><category term=".NET"/><category term="GUID"/><category term="IsGuid"/><category term="c#"/><category term="csv"/><category term="if"/><category term="parsing"/><category term="short circuit"/><category term="validation"/><category term="wcf"/><category term="windows service"/><title type='text'>My .NET encounters</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnetdinesh.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7541358197920037504/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dotnetdinesh.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dinesh</name><uri>http://www.blogger.com/profile/00215577797507020580</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>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7541358197920037504.post-4331150753237339271</id><published>2009-12-08T04:54:00.000-08:00</published><updated>2009-12-09T00:58:37.741-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="if"/><category scheme="http://www.blogger.com/atom/ns#" term="short circuit"/><title type='text'>Short Circuit Evaluation</title><content type='html'>The below code snippet shows how .NET evaluates expressions in if statement.&lt;br /&gt;&lt;br /&gt;-------------------------------&lt;br /&gt;&lt;br /&gt;string x = null;&lt;br /&gt;if (!string.IsNullOrEmpty(x) &amp;&amp; x.ToString().Equals(&quot;&quot;))&lt;br /&gt;    Console.WriteLine(&quot;True&quot;);&lt;br /&gt;else&lt;br /&gt;    Console.WriteLine(&quot;False&quot;);&lt;br /&gt;&lt;br /&gt;if (string.IsNullOrEmpty(x) || x.ToString().Equals(&quot;&quot;))&lt;br /&gt;    Console.WriteLine(&quot;True&quot;);&lt;br /&gt;else&lt;br /&gt;    Console.WriteLine(&quot;False&quot;);&lt;br /&gt;&lt;br /&gt;-------------------------------&lt;br /&gt;&lt;br /&gt;Output: &lt;br /&gt;False&lt;br /&gt;True</content><link rel='replies' type='application/atom+xml' href='http://dotnetdinesh.blogspot.com/feeds/4331150753237339271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdinesh.blogspot.com/2009/12/short-circuit-evaluation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7541358197920037504/posts/default/4331150753237339271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7541358197920037504/posts/default/4331150753237339271'/><link rel='alternate' type='text/html' href='http://dotnetdinesh.blogspot.com/2009/12/short-circuit-evaluation.html' title='Short Circuit Evaluation'/><author><name>Dinesh</name><uri>http://www.blogger.com/profile/00215577797507020580</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-7541358197920037504.post-2046649603225030552</id><published>2009-12-03T22:31:00.001-08:00</published><updated>2009-12-03T22:46:43.796-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="csv"/><category scheme="http://www.blogger.com/atom/ns#" term="parsing"/><title type='text'>Parsing comma separated string</title><content type='html'>Following is the simple code to parse comma separated string into a string array.&lt;br /&gt;This StringSplitOptions reduces the overhead on developers.&lt;br /&gt;It trims &#39;,&#39; charaters (ie if any , present in the begining or end).&lt;br /&gt;It removes any empty values (ie &quot;Dinesh,,Uthayakumar&quot;).&lt;br /&gt;&lt;br /&gt;string Name = &quot;Dinesh,Uthayakumar,Din&quot;;&lt;br /&gt;string[] fullname = Name.Split(new char[] { &#39;,&#39; }, StringSplitOptions.RemoveEmptyEntries);&lt;br /&gt;Console.Write(fullname.Length);</content><link rel='replies' type='application/atom+xml' href='http://dotnetdinesh.blogspot.com/feeds/2046649603225030552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdinesh.blogspot.com/2009/12/parsing-comma-separated-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7541358197920037504/posts/default/2046649603225030552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7541358197920037504/posts/default/2046649603225030552'/><link rel='alternate' type='text/html' href='http://dotnetdinesh.blogspot.com/2009/12/parsing-comma-separated-string.html' title='Parsing comma separated string'/><author><name>Dinesh</name><uri>http://www.blogger.com/profile/00215577797507020580</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-7541358197920037504.post-388222953343099889</id><published>2009-12-02T22:36:00.000-08:00</published><updated>2009-12-02T22:45:42.927-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="wcf"/><category scheme="http://www.blogger.com/atom/ns#" term="windows service"/><title type='text'>WCF service hosting within Windows service - Issue</title><content type='html'>I faced the exception mentioned below when hosting a WCF service in a windows service. When i tried to start the windows serivce i got an message box throwing the following information:&lt;br /&gt;The Service1 service on Local Computer started and then stopped.  Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.&lt;br /&gt;&lt;br /&gt;Solution for the below exception:&lt;br /&gt;1. Open the Service Control Manager (Start-&gt;Run, type services.msc)&lt;br /&gt;2. Right click on the particular service&lt;br /&gt;3. Click on properties&lt;br /&gt;4. Select Local System Account radio button&lt;br /&gt;&lt;br /&gt;Service cannot be started. System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:5755/TestSoapAndRest/Service1/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---&gt; System.Net.HttpListenerException: Access is denied&lt;br /&gt;   at System.Net.HttpListener.AddAll()&lt;br /&gt;   at System.Net.HttpListener.Start()&lt;br /&gt;   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()&lt;br /&gt;   --- End of inner exception stack trace ---&lt;br /&gt;   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()&lt;br /&gt;   at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)&lt;br /&gt;   at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)&lt;br /&gt;   at System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)&lt;br /&gt;   at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout)&lt;br /&gt;   at System.ServiceModel.Channels.CommunicationObject...&lt;br /&gt;&lt;br /&gt;For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.</content><link rel='replies' type='application/atom+xml' href='http://dotnetdinesh.blogspot.com/feeds/388222953343099889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdinesh.blogspot.com/2009/12/wcf-hosting-within-windows-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7541358197920037504/posts/default/388222953343099889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7541358197920037504/posts/default/388222953343099889'/><link rel='alternate' type='text/html' href='http://dotnetdinesh.blogspot.com/2009/12/wcf-hosting-within-windows-service.html' title='WCF service hosting within Windows service - Issue'/><author><name>Dinesh</name><uri>http://www.blogger.com/profile/00215577797507020580</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-7541358197920037504.post-1650195765216180870</id><published>2009-10-25T21:34:00.000-07:00</published><updated>2009-11-01T20:04:39.354-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="GUID"/><category scheme="http://www.blogger.com/atom/ns#" term="IsGuid"/><category scheme="http://www.blogger.com/atom/ns#" term="validation"/><title type='text'>Guid Validation</title><content type='html'>Here is a method where we could validate a string as a GUID using Regex pattern matching. It validates the guid case insensitively.&lt;br /&gt;&lt;br /&gt;bool IsGuid(string Id)&lt;br /&gt;{&lt;br /&gt;    return !string.IsNullOrEmpty(Id) &amp;&amp; Regex.IsMatch(Id, &quot;^[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}$&quot;);  &lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://dotnetdinesh.blogspot.com/feeds/1650195765216180870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetdinesh.blogspot.com/2009/10/guid-validation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7541358197920037504/posts/default/1650195765216180870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7541358197920037504/posts/default/1650195765216180870'/><link rel='alternate' type='text/html' href='http://dotnetdinesh.blogspot.com/2009/10/guid-validation.html' title='Guid Validation'/><author><name>Dinesh</name><uri>http://www.blogger.com/profile/00215577797507020580</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></feed>