<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7377270124168998422</id><updated>2012-02-16T16:37:06.574-08:00</updated><category term='VBScript'/><category term='OSPF'/><category term='Visual Studio'/><category term='teredo'/><category term='DNS'/><category term='SQL'/><category term='TFTP'/><category term='6to4'/><category term='Switch'/><category term='Cisco'/><category term='EIGRP'/><category term='Files'/><category term='Fun Stuff'/><category term='Attack'/><category term='Tutorial'/><category term='Windows'/><category term='Security'/><category term='Remote Desktop'/><category term='Web'/><category term='Redundancy'/><category term='Text'/><category term='VPN'/><category term='Scripting'/><category term='Access'/><category term='IOS'/><category term='ProCurve'/><category term='FTP'/><category term='ComboBox'/><category term='IPv4'/><category term='Visual Basic'/><category term='Decimal'/><category term='IP'/><category term='Routing'/><category term='Dos'/><category term='System.IO'/><category term='JScript'/><category term='RDP'/><category term='Visual Basic.net'/><category term='Hashtable'/><category term='IPv6'/><category term='Network'/><category term='xml'/><category term='Dictionary'/><category term='Load Balance'/><category term='CEF'/><category term='Javascript'/><category term='BGP'/><category term='Controls'/><category term='MPLS'/><category term='Server'/><category term='ListBox'/><category term='ASP'/><category term='Hyper-V'/><category term='Tips'/><category term='ICMP'/><category term='VB'/><category term='IIS'/><category term='Collection'/><category term='Folders'/><category term='Binary'/><category term='Master Page'/><category term='C#'/><category term='VB.net'/><category term='Array'/><category term='RIP'/><category term='Ping'/><category term='subnet'/><category term='Database'/><category term='HTML'/><category term='Pinkie'/><category term='CSharp'/><category term='Converter'/><category term='Short Circuit'/><category term='Tricks'/><category term='ASP.net'/><category term='System.XML'/><category term='IS-IS'/><category term='DHCP'/><category term='VS.net'/><category term='calculator'/><category term='Excel'/><title type='text'>Brian Dao's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>87</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-212154195121244206</id><published>2011-09-05T22:12:00.000-07:00</published><updated>2011-09-05T22:33:30.745-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Pinkie'/><category scheme='http://www.blogger.com/atom/ns#' term='subnet'/><category scheme='http://www.blogger.com/atom/ns#' term='6to4'/><category scheme='http://www.blogger.com/atom/ns#' term='calculator'/><category scheme='http://www.blogger.com/atom/ns#' term='IPv6'/><category scheme='http://www.blogger.com/atom/ns#' term='IPv4'/><category scheme='http://www.blogger.com/atom/ns#' term='teredo'/><title type='text'>Finally, an IPv6 calculator</title><content type='html'>In an effort to update &lt;a href="http://www.ipUptime.net/"&gt;Pinkie&lt;/a&gt; to support IPv6, I postponed my other projects to spend sometime on IPv6 and as the result, we have yet another &lt;a href="http://www.ipUptime.net/ipCalc.aspx"&gt;IP Address Calculator&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;When I finished integrating the IP calculator into the next release of &lt;a href="http://www.ipUptime.net/"&gt;Pinkie&lt;/a&gt;, I realized there wasn't one online that had the functionalities I wanted; I figured I wasn't the only one like that so I spend yet more time working to bring it online and now we have another &lt;a href="http://www.ipUptime.net/ipCalc.aspx"&gt;IPv6 calculator&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This one is a little bit different than all the others in a sense that it supports both IPv4 &amp; IPv6 on the same user interface (just because I hate having to go to different site for different types of IP address like I hate having the functionalities of &lt;a href="http://www.ipUptime.net/"&gt;Pinkie&lt;/a&gt; in multiple programs or windows for that matter).  It also help you convert and identify different type of IPv6 addresses.&lt;br /&gt;&lt;br /&gt;Hope you can use it!&lt;br /&gt;&lt;br /&gt;Last but not least, I hope you support my sponsors.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ipUptime.net/ipCalc.aspx"&gt;Online IP Address Calculator&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-212154195121244206?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/212154195121244206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=212154195121244206' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/212154195121244206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/212154195121244206'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2011/09/finally-ipv6-calculator.html' title='Finally, an IPv6 calculator'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-8705538723156955710</id><published>2010-05-13T18:47:00.000-07:00</published><updated>2010-05-13T18:53:57.799-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fun Stuff'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><title type='text'>Fun with Procurve switches</title><content type='html'>What would you do if you have a bunch of Procurve switches and some free time?&lt;br /&gt;&lt;br /&gt;Well, as I found out, you can have a little fun besides just learning and working.&lt;br /&gt;&lt;br /&gt;&lt;object width="640" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/BuavGOcxS9E&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xd0d0d0&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/BuavGOcxS9E&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xd0d0d0&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;This video was found through this blog: http://bhbodeezy.com/tag/locatorleds/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-8705538723156955710?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/8705538723156955710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=8705538723156955710' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8705538723156955710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8705538723156955710'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2010/05/fun-with-procurve-switches.html' title='Fun with Procurve switches'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5850408123683652074</id><published>2010-02-28T21:54:00.000-08:00</published><updated>2010-02-28T22:01:28.502-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Ping'/><category scheme='http://www.blogger.com/atom/ns#' term='IP'/><category scheme='http://www.blogger.com/atom/ns#' term='DNS'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'></title><content type='html'>Earlier this week, I released a suite of Windows network troubleshooting utilities called Pinkie through a website named &lt;a href="http://www.ipuptime.net/"&gt;ipUptime.net&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Everything went well.  The public seems to welcome it and as I monitor the statistics for the site as well as the download counts from other download sites, I realized that something is wrong with my site statistics; the numbers don't match up and my number came up short.&lt;br /&gt;&lt;br /&gt;As I found out, if people download the Pinkie through the link on my site then the download count is incremented.  But if they had download it from other sites, using the URL I had published then the download is not accounted for.&lt;br /&gt;&lt;br /&gt;Changing the published URL for all other sites will be time consuming so I was looking for a better solution to the issue.  Then I remember ASP.net 2.0 supports URL Mappings.  So by using URL Mappings, within a minute or two, my problem is solved.&lt;br /&gt;&lt;br /&gt;Here's the syntax for URL Mappings:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&amp;lt;urlmappings&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&amp;lt;add url="~/newurl.aspx" mappedurl="~/oldURL.aspx"&amp;gt;&amp;lt;/add&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&amp;lt;/urlmappings&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Best use for URL Mappings are for shortening long, hard to remember URL to something short &amp;amp; easy to remember or in my case, correct a mistake and save time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5850408123683652074?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5850408123683652074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5850408123683652074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5850408123683652074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5850408123683652074'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2010/02/earlier-this-week-i-released-suite-of.html' title=''/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4588779067058251978</id><published>2010-02-26T17:11:00.000-08:00</published><updated>2010-02-26T17:12:25.431-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Simple Website</title><content type='html'>A friend of mine runs a small business in Houston, TX and needed to enhance the company's web image.&lt;br /&gt;&lt;br /&gt;With the little free time I had, I was able to put together a simple, mostly static HTML site for her.&lt;br /&gt;&lt;br /&gt;You can check it out here: &lt;a href="http://www.eyecareforyouonline.com/"&gt;eyecareforyouonline.com&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4588779067058251978?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4588779067058251978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4588779067058251978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4588779067058251978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4588779067058251978'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2010/02/simple-website.html' title='Simple Website'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-9068977810659040421</id><published>2010-02-25T18:52:00.000-08:00</published><updated>2010-02-25T19:04:41.291-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><title type='text'>Blogging again!!!</title><content type='html'>It's been a long while since I posted a blog.  Well, apparently, I had forgotten my password and was unable to recover it since the email account I registered with Google wasn't active.  Therefore, I wasn't able to login to the site.&lt;br /&gt;&lt;br /&gt;In a recent Networking project called &lt;a href="http://www.ipuptime.net/"&gt;Pinkie&lt;/a&gt;, I needed to activate the web hosting account again and finally able to reset the password to the blogger account.&lt;br /&gt;&lt;br /&gt;So in the comming days, I'll start blogging again when I get some free time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-9068977810659040421?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/9068977810659040421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=9068977810659040421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/9068977810659040421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/9068977810659040421'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2010/02/blogging-again.html' title='Blogging again!!!'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-612670802568727205</id><published>2008-04-21T10:22:00.000-07:00</published><updated>2008-04-21T10:48:21.560-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VPN'/><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Virtual Private Networks Troubleshooting - Part I</title><content type='html'>I've seen quite a number of posts asking why VPN users are not able to access their network even though they have been successfully connected.&lt;br /&gt;&lt;br /&gt;Let's try to troubleshoot what happens here.  A very common VPN setup is to use 2 NICs and run Routing and Remote Access on one of them.  The benefits of this would be that you can isolate VPN traffic and keeping it from overloading the NIC that handles the internal network traffic.  One thing to note for is that the two NICs have to be assigned IPs from different networks or subnets.  For example:&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;1st NIC (VPN): 192.168.1.2 /24&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;2nd NIC(internal network): 192.168.2.2 /24&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(Don't worry if you don't understand the /24.  It's called the slash notation for the subnet mask which is the equivalent of 255.255.255.0)&lt;br /&gt;&lt;br /&gt;Through the initial RRAS setup, users will be able to connect to the VPN just fine and will be assigned an IP address of one of the networks.  The problem arise when they try to connect to network resources on through the 2nd NIC (the other network).  This is due to the fact that Windows doesn't know how to route the packets from the 192.168.1.0 network to 192.168.2.0 network.&lt;br /&gt;&lt;br /&gt;You can tell Windows how to route traffic between the two NICs by configuring a static route with the "Route" command.  Type "Route /?" at the Command Prompt for more information.&lt;br /&gt;&lt;br /&gt;And as usual, I have a second way to accomplish the job by turning on Routing using RIP or OSPF and add the two NICs to it.&lt;br /&gt;&lt;br /&gt;One thing that I see lacking from most Windows Administrators is the understanding of TCP/IP and network routing.  I would recommend Windows Administrators to take CCNA anytime.  Even though it might seem so remote from their daily tasks, one can walk away from a CCNA class with so much helpful information that makes their job much easier to do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-612670802568727205?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/612670802568727205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=612670802568727205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/612670802568727205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/612670802568727205'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/04/virtual-private-networks.html' title='Virtual Private Networks Troubleshooting - Part I'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2495706696965636711</id><published>2008-03-17T19:50:00.000-07:00</published><updated>2008-03-17T20:07:20.255-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Switch Port Security</title><content type='html'>If you are working in a strict security environment then switch port security is a must.  Configuring switch port security could become a tidious task.  However, if you can control the environment when you setup the network, this little trick can help you save a lot of work.&lt;br /&gt;&lt;br /&gt;Instead of configuring port security and manually enter MAC address for the port, you could plug all your hosts in then issue the following commands:&lt;br /&gt;&lt;br /&gt;Switch(config)#int range f0/1-xx&lt;br /&gt;Switch(config-if-range)#switchport port-security&lt;br /&gt;Switch(config-if-range)#switchport port-security maximum 1&lt;br /&gt;Switch(config-if)#switchport port-security violation restrict&lt;br /&gt;Switch(config-if-range)#switchport port-security mac-address sticky&lt;br /&gt;Switch(config-if-range)#end&lt;br /&gt;&lt;br /&gt;The first command takes you to the interface range configuration mode; the next two turn on the port security and set a maximum number of mac addresses to 1.  "Violation restrict" will not allow traffic for any host whose mac address  is different than what the switch has learned for the port in question.  After that, the "mac-address sticky" commands instruct the switch to learn the mac address dynamically and remembers it for the each port.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2495706696965636711?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2495706696965636711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2495706696965636711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2495706696965636711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2495706696965636711'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/03/switch-port-security.html' title='Switch Port Security'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-17566836542955895</id><published>2008-03-02T15:51:00.000-08:00</published><updated>2008-03-02T15:55:45.368-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Redundancy'/><category scheme='http://www.blogger.com/atom/ns#' term='CEF'/><category scheme='http://www.blogger.com/atom/ns#' term='Load Balance'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Basic Load Balancing</title><content type='html'>Load Balancing normally has two modes of operation: Per-Destination and Per-Packet. &lt;br /&gt;&lt;br /&gt;Per destination load balancing means the router distributes the data packets based on the destination address.  If you have two paths going to Host A &amp;amp; B on the same network then all packets for Host A will travel over the first path and all packets for Host B will travel over the second path.  This will preserve the packet order which is very useful in certain applications; however, it could result in unequal usage of the network links as bandwidth &amp;amp; load are not taken into route calculation.&lt;br /&gt;&lt;br /&gt;Per packet load balancing means the router sends one packet over the first path and second packet over the second path; all going to the same destination.  Per packet load balancing guarantees equal load across all the links; however, the packets may arrive at the destination out of order because of different delay/bandwidth may exist on different paths.&lt;br /&gt;&lt;br /&gt;Per destination load balancing is enable by the command:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router# config t&lt;br /&gt;Router(config)# interface Ethernet 0&lt;br /&gt;Router(config-if)# no ip route-cache&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Now the router CPU will look at every single packet and spread them across the different path available in the routing table for the destination.  This is not recommended on low end server as it could crash the router because the CPU must do all the processing and might not be able to handle it.  To enable fast switching, use the following commands:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router# config t&lt;br /&gt;Router(config)# interface Ethernet 0&lt;br /&gt;Router(config-if)# ip route-cache&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Newer switching schemes such as Cisco Express Forwarding (CEF) allow you to do per packet and per destination load balancing more quickly but it does imply that extra resources will be needed to maintain it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-17566836542955895?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/17566836542955895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=17566836542955895' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/17566836542955895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/17566836542955895'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/03/basic-load-balancing.html' title='Basic Load Balancing'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3672287826435787378</id><published>2008-02-28T05:45:00.000-08:00</published><updated>2008-02-28T05:46:29.923-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Reload</title><content type='html'>Working remotely with routers &amp;amp; switches you don't have the flexibility to reset the devices at will when things go wrong unless you can control power distribution to the devices.&lt;br /&gt;&lt;br /&gt;This is where the Reload command comes in handy.  Before making changes to the configuration, you can enter:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Reload in 10&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;which will reload the device in 10 minutes.  Once the command is entered, you can proceed with the configuration changes.  If things go wrong and you lost connectivity to the device, try back in about 10 minutes since the device will get reloaded with the original startup-configuration and restore connectivity.&lt;br /&gt;&lt;br /&gt;Once you confirm that your new configuration is working properly, you can issue the command:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Reload cancel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to cancel the reload.  I find this trick to be very useful when I have to telnet or SSH to a remote device and hopefully you too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3672287826435787378?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3672287826435787378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3672287826435787378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3672287826435787378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3672287826435787378'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/02/reload.html' title='Reload'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-99104166130612742</id><published>2008-02-25T19:56:00.000-08:00</published><updated>2008-02-25T20:24:03.599-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ping'/><category scheme='http://www.blogger.com/atom/ns#' term='EIGRP'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Redundancy'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Add Redundancy With Backup Command</title><content type='html'>You can add redundancy to your network and make you network more resilient with the Backup command. What this command does is specify an interface which will act as a back up in case the primary interface fails.&lt;br /&gt;&lt;br /&gt;Let's take a look at the following configurations:&lt;br /&gt;&lt;br /&gt;On RouterA:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Configure terminal&lt;br /&gt;Interface f0/0&lt;br /&gt;Ip address 192.168.1.1 255.255.255.0&lt;br /&gt;no shutdown&lt;br /&gt;Interface f0/1&lt;br /&gt;Ip address 192.168.2.1 255.255.255.0&lt;br /&gt;no shutdown&lt;br /&gt;Backup interface f0/0&lt;br /&gt;Exit&lt;br /&gt;Router eigrp 20&lt;br /&gt;network 192.168.1.0&lt;br /&gt;network 192.168.2.0&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;On RouterB:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Configure terminal&lt;br /&gt;Interface f0/0&lt;br /&gt;Ip address 192.168.2.2 255.255.255.0&lt;br /&gt;no shutdown&lt;br /&gt;Interface f0/1&lt;br /&gt;Ip address 192.168.2.2 255.255.255.0&lt;br /&gt;no shutdown&lt;br /&gt;Backup interface f0/0&lt;br /&gt;Interface loop 0&lt;br /&gt;Ip add 192.168.8.1 255.255.255.0&lt;br /&gt;Exit&lt;br /&gt;Router eigrp 20&lt;br /&gt;network 192.168.1.0&lt;br /&gt;network 192.168.2.0&lt;br /&gt;network 192.168.8.0&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;With these configurations loaded, both Fa0/1's will change to up/up while Fa0/0's will go into standby mode and monitor the activities on Fa0/1. In the event that Fa0/1 goes down, Fa0/0 will switch to active mode and establish neighbor relationship with the connected interface and complete the failover.&lt;br /&gt;&lt;br /&gt;To verify this, from RouterA you can ping 192.168.8.1 with the repeat parameter:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Ping 192.168.8.1 repeat 10000 &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This command will ping 192.168.8.1 10k times. While it's pinging, unplug the cable to Fa0/1. you will see that the link go down, the ping will fail and then within seconds Fa0/0 will be up and resume the active role and the pinging will resume as nothing has happened. If the link on Fa0/1 becomes active again, Fa0/0 will switch back to standby mode.&lt;br /&gt;&lt;br /&gt;This is a quick and easy way to add redundancy to your network. There are other techniques that you can use to add redundancy to your network to include both layer 2 and layer 3 redundancies which I will discuss at another opportunity.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-99104166130612742?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/99104166130612742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=99104166130612742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/99104166130612742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/99104166130612742'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/02/add-redundancy-with-backup-command.html' title='Add Redundancy With Backup Command'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-465182836703476513</id><published>2008-02-22T05:54:00.000-08:00</published><updated>2008-02-22T06:03:20.006-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Keyboard Shortcuts</title><content type='html'>If you use CLI to manage your Cisco routers &amp;amp; switches then you should to get familiarized with the keyboard shortcuts as the can save you a lot of time &amp;amp; typings.&lt;br /&gt;&lt;br /&gt;Here's the shortcut list:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Ctrl+B: Moves back one character at a time&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;EscB: Moves back one word at a time&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Ctrl+A: Moves to the start of a line&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Ctrl+F: Moves forward one character at a time&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Esc+F: Moves forward one word at a time&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Ctrl+E: Moves to the end of a line&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Delete: Erases the character to the left of the cursor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Backspace: Erases the character to the left of the cursor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Ctrl+D: Deletes the character at the cursor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Ctrl+K: Deletes all characters from the cursor to the end of the line&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Ctrl+U: Deletes all characters from the cursor to the beginning of the line&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Ctrl+X: Deletes all characters from the cursor to the beginning of the line&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Ctrl+W: Deletes the word to the left of the cursor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Esc+D: Deletes from the cursor to the end of a word&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If none of these commands work, enhanced editing may be turned off.  You can turn on enhanced editing issuing the command at the privileged command prompt:&lt;/p&gt;&lt;p&gt;&lt;span style="color:#006600;"&gt;Router# terminal editing&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-465182836703476513?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/465182836703476513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=465182836703476513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/465182836703476513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/465182836703476513'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/02/keyboard-shortcuts.html' title='Keyboard Shortcuts'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-7614861540112109076</id><published>2008-02-13T10:20:00.000-08:00</published><updated>2008-02-13T16:36:33.380-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Stop Logging Messages From Interrupting Your Work</title><content type='html'>One of the things that I find really annoying with the Cisco devices is that when I am configuring a router or a switch, the console messages keep popping up all over the places and interfere with my work. Although this doesn't cause any typo error but it's really difficult to see what you have typed.  Luckily, we can control the logging message behavior.&lt;br /&gt;&lt;br /&gt;To disable, use:&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config)# no logging console&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;or if you prefer to see what's going on with the router/switch then use the "logging synchronous" command:&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config)# line console 0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config-line)# logging synchronous&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config)# line vt 0 4&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config-line)# logging synchronous&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It would be nice if these were taken into consideration and set as default options when the IOS is built but it's not the case so until they change it, you will have to either put up with it or do a little extra work to change the default behavior.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-7614861540112109076?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/7614861540112109076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=7614861540112109076' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/7614861540112109076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/7614861540112109076'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/02/stop-logging-messages-from-interrupting.html' title='Stop Logging Messages From Interrupting Your Work'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-345939951492480148</id><published>2008-01-28T08:42:00.000-08:00</published><updated>2008-01-28T08:45:12.035-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='DNS'/><category scheme='http://www.blogger.com/atom/ns#' term='DHCP'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Configure DHCP on a Cisco Router or Switch</title><content type='html'>When it comes to configuring DHCP, you have a number of ways to do it.  You can run DHCP service on a Windows or a Linux box or as most networking professionals prefer, run it on an existing router or a switch.&lt;br /&gt;&lt;br /&gt;The advantage of this is that you can leverage existing hardware, provide DHCP locally at each site and reduce the dependency on the WAN link.&lt;br /&gt;&lt;br /&gt;To configure DHCP on a Cisco router or switch, follow these steps:&lt;br /&gt;&lt;br /&gt;1. Configure an IP address on the router's Ethernet port&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config)# interface e0/0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config-if)#ip address 172.16.1.1 255.255.255.0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config-if)# no shut&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;2. Create a DHCP IP address pool for the IP addresses you want to use.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config)# ip dhcp pool dhcppoolname&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;3. Specify the network and subnet for the addresses you want to use from the pool.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(dhcp-config)# network 172.16.1.0 255.255.255.0&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;4. Specify the DNS domain name for the clients.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(dhcp-config)#domain-name yourdomain.com&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;5.Specify the DNS server.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(dhcp-config)#dns-server 172.16.1.2&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;6. Specify the defaut router (or default gateway)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(dhcp-config)#default-router 172.16.1.1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;7. Specify the lease duration.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(dhcp-config)#lease 7&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;8. Let's say that you've decided that all IP addresses between .30 and .40 will be used for static IP devices such as mail servers and database servers and you don't want them to be available in the DHCP pool, you can exclude them using "exclude-address" command:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config)#ip dhcp excluded-address 172.16.1.30 172.16.1.40&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Now any device that requires an DHCP address on the 172.16.1.0 network will be able to send a DHCP request to 172.16.1.1.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-345939951492480148?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/345939951492480148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=345939951492480148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/345939951492480148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/345939951492480148'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/01/configure-dhcp-on-cisco-router-or.html' title='Configure DHCP on a Cisco Router or Switch'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-7818586658847956915</id><published>2008-01-18T13:43:00.000-08:00</published><updated>2008-01-18T13:48:16.576-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VBScript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP'/><title type='text'>Update Client Status on Long Running Job</title><content type='html'>Every once in a while I come across a question like: "I have a web application that has a long running job.  It could take up to a few dozen minutes to complete.  How can I keep the client status updated and not causing a timeout?"&lt;br /&gt;&lt;br /&gt;The problem with a web application like this is that if the job run too long, it will cause a script timeout error.  One can opt to increase the script timeout to prevent this but when you actually have an error, it would take forever before the client is notified of the error.&lt;br /&gt;&lt;br /&gt;People often think that AJAX is the only solution to this problem but it isn't.  But with a little clever coding, combining javascript with server side code, you can accomplish this.  You can apply this technique to classic ASP or ASP.NET or whatever techonolgy or language you choose to use.&lt;br /&gt;&lt;br /&gt;What we need to do is find a way to continuously sending data to the browser so that it doesn't time out on us.  with vbscript and vb.net Repsonse.Buffer &amp;amp; Response.Flush can take care of this quite nicely.&lt;br /&gt;&lt;br /&gt;So now we have the data streaming to the client, how to we update the status?  The answer is javascript.  We can script a function and take advantage of the ability to dynamically changing the content of the div or span tag to update the status when we receive some data from the server.&lt;br /&gt;&lt;br /&gt;Please examine the &lt;a href="http://www.geocities.com/ld762/ClientStatus.zip"&gt;source code&lt;/a&gt; for the complete example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-7818586658847956915?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/7818586658847956915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=7818586658847956915' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/7818586658847956915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/7818586658847956915'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/01/update-client-status-on-long-running.html' title='Update Client Status on Long Running Job'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-6481207004691669091</id><published>2008-01-15T20:54:00.000-08:00</published><updated>2008-01-15T20:58:17.129-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OSPF'/><category scheme='http://www.blogger.com/atom/ns#' term='EIGRP'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='BGP'/><category scheme='http://www.blogger.com/atom/ns#' term='RIP'/><category scheme='http://www.blogger.com/atom/ns#' term='MPLS'/><category scheme='http://www.blogger.com/atom/ns#' term='IS-IS'/><title type='text'>Optimize Routing Updates</title><content type='html'>Dynamic routing protocols such as EIGRP, OSPF &amp;amp; RIP update the routing table through the use of protocol updates. These updates are sent periodically from one router to another and can create quite a bit of traffic on your network.&lt;br /&gt;&lt;br /&gt;You can optimize your router and reduce this kind of traffic through the use of the "passive-interface" command. It works by instructing the router not to send update to specific interface(s).&lt;br /&gt;&lt;br /&gt;The "passive-interface" command can be used in two ways:&lt;br /&gt;&lt;br /&gt;1. Specify an interface that will not participating in routing updates.&lt;br /&gt;&lt;span style="color:#006600;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config)# router rip&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config-router)# passive-interface Ethernet 0/0&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;2. Make all interfaces passive then use "no passive-interface" on interfaces that you want to participating in routing updates.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config)# router rip&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config-router)# passive-interface default&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config-router)# no passive-interface Ethernet 0/0&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Note that the "passive-interface" command works on all IP routing protocols except BGP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-6481207004691669091?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/6481207004691669091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=6481207004691669091' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6481207004691669091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6481207004691669091'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/01/optimize-routing-updates.html' title='Optimize Routing Updates'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2698085838497281208</id><published>2008-01-01T11:23:00.000-08:00</published><updated>2008-01-01T12:01:03.400-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><title type='text'>Changing Computer SID</title><content type='html'>I've been working on a SharePoint project that requires a domain controller, an IIS web farm and a SQL Server. In order to quickly setup my development environment, I use Virtual Server 2005 and created a number of virtual machines and set them up in an isolated virtual network.&lt;br /&gt;&lt;br /&gt;I started out by setting up a barebone Windows Server 2003 with SP2 and .Net Framework 2.0. After all the security updates have been applied, I copied the virtual hard drive (.vhd) file, renaming it and attached to the new virtual machines. I brought them up one by one and renamed them. Once I got through all four, they all came up with no problem.&lt;br /&gt;&lt;br /&gt;When I promoted the DC and start joining the first member server things also went pretty well until I tried to logon to the member server with a domain account. The error message I received was:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This error occurred because I used only one installation of Windows 2003 Server. The SID is the same on all of my virtual machines because I just simply copied the .vhd file and renamed it.&lt;br /&gt;&lt;br /&gt;The solution was to download &lt;a href="http://download.sysinternals.com/Files/NewSid.zip"&gt;NewSID&lt;/a&gt; utility from SysInterals (now owned by Microsoft).  The tool allows you to change SID as well as computer name and works wonderfully in this situation.&lt;br /&gt;&lt;br /&gt;Here's a few tips for those who might run into this same scenario:&lt;br /&gt;&lt;br /&gt;1. Run NewSID when you bring up a clone server/computer and let it do the rename for you.  This will save you from rename the computer, reboot, login then change the SID only to reboot again.&lt;br /&gt;&lt;br /&gt;2. Run NewSID before you join the member server to the domain.  This is because it will save you from all the hassle of joining domain, reboot, unjoin, reboot, change SID reboot and rejoin domain...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2698085838497281208?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2698085838497281208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2698085838497281208' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2698085838497281208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2698085838497281208'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2008/01/changing-computer-sid.html' title='Changing Computer SID'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2640781787922327307</id><published>2007-12-27T16:05:00.001-08:00</published><updated>2007-12-27T16:17:25.129-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Ping'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='ICMP'/><title type='text'>ICMP - Pinging Server 2008</title><content type='html'>One of the most common ways for an administrator to see if a particular server is up or not is to send an ICMP package to the server or to Ping it. This is also called an Echo Request.&lt;br /&gt;&lt;br /&gt;Windows Server 2008 disable this Echo Request by default. Here's how you can turn this on:&lt;br /&gt;&lt;br /&gt;1. Open Server Manager&lt;br /&gt;2. Expand Configuration section&lt;br /&gt;3. Expand Windows Firewall with Advanced Security (OK, Microsoft, is there a Basic one???)&lt;br /&gt;4. Click on Inbound Rules&lt;br /&gt;5. In the middle pane, scroll down and find "File and Printer Sharing (Echo Request - ICMPvX-in)" where the X stands for the IP version number&lt;br /&gt;6. Right click it and select Enable&lt;br /&gt;7. If you want to edit advanced options then right click it and select Properties option instead&lt;br /&gt;&lt;br /&gt;If you are running the core version, you can accomplish the same thing by issuing the netsh command:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;netsh firewall set icmpsetting 8&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2640781787922327307?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2640781787922327307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2640781787922327307' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2640781787922327307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2640781787922327307'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/12/icmp-pinging-server-2008.html' title='ICMP - Pinging Server 2008'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-8745793084411951492</id><published>2007-12-27T15:53:00.000-08:00</published><updated>2007-12-27T16:03:36.259-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='FTP'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>IIS 7 - FTP Server</title><content type='html'>I was evaluating the much anticipated Windows Server 2008 RC1 and one of the areas I was focusing on was IIS7. Pretty much every component was updated except for the FTP server. It seems that Microsoft was rushing RC1 out and didn't have enough time to add the new FTP server in there so they went with the old version instead.&lt;br /&gt;&lt;br /&gt;When you enable FTP role, the old IIS 6 snapin will be added to let you manage the FTP server. I didn't like the way it turned out and searched around a bit more and found out FTP Server 7 RC0 is out.&lt;br /&gt;&lt;br /&gt;You can download the new FTP Server &lt;a href="http://www.iis.net/downloads/files/ftp/rc0/ftp7_x86_rc0.msi"&gt;here&lt;/a&gt;.  In order to install this package, you must first uninstall the old FTP version.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-8745793084411951492?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/8745793084411951492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=8745793084411951492' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8745793084411951492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8745793084411951492'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/12/iis-7-ftp-server.html' title='IIS 7 - FTP Server'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-7166472673803144886</id><published>2007-12-26T09:30:00.000-08:00</published><updated>2007-12-26T09:42:01.059-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Start a Port Configuration In a Clean State</title><content type='html'>If you are reconfiguring or changing the port settings on a router you can remove or change the old commands one by one until the job is done. However, there's a "default interface" command that you can use to quickly reset the port's configuration to its default values:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;Router(config#): default interface fa0/1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Once the "default interface"command issued, you can be certain that all previous commands set on the specified ports are gone.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-7166472673803144886?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/7166472673803144886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=7166472673803144886' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/7166472673803144886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/7166472673803144886'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/12/start-port-configuration-in-clean-state.html' title='Start a Port Configuration In a Clean State'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4369557907066927996</id><published>2007-12-20T05:56:00.000-08:00</published><updated>2007-12-20T05:59:18.462-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dos'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='BGP'/><category scheme='http://www.blogger.com/atom/ns#' term='Attack'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Protecting Your Network Edge with TTL</title><content type='html'>Protecting your network by authenticating every EBGP session is a good measure to keep the bad guys out.  While this approach can keep attackers from getting inside your network, it can't keep them from launching attacks by flooding packets at BGP port (TCP port 179) and causing tremendous authentication failures which can lead to legistimate BGP connections at the target interface to fail, BGP process failure or even system crash due to spike in system resources &amp;amp; CPU spike.&lt;br /&gt;&lt;br /&gt;Fortunately, you can use TTL (Time To Live) as an additional measure to reduce such DoS attacks against BGP.  The default behavior of most BGP implementations is that it will send packets to external neighbors with a TTL value of 1 and accepts packets from external neighbors with TTL of 0 or higher.&lt;br /&gt;&lt;br /&gt;You can tighten up your network by changing this default behavior by having BGP originated packets with a TTL value of 255 and only accepting packets with TTL of 254 (measured after the local router has decremented the TTL of the packet it received) or higher.&lt;br /&gt;&lt;br /&gt;Now even if the attackers originate packets with a maximum TTL value of 255, the packets can't get to your BGP network if the attackers are not directly connected to the target interface.  This is because each router hop decrements the TTL value by 1.  If they are two hops away, by the time the packets reach the port TTL will be decremented to 253 and will be rejected.&lt;br /&gt;&lt;br /&gt;You can configure the TTL value by issuing the statement:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;neighbor-address ttl-security hops 254&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will instruct your router to discard incoming BGP packets with TTL value below 254 and also set outgoing packets TTL value to 255.  You will need to make sure that both neighbors are configure with the same statement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4369557907066927996?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4369557907066927996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4369557907066927996' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4369557907066927996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4369557907066927996'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/12/protecting-your-network-edge-with-ttl.html' title='Protecting Your Network Edge with TTL'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-8379841405236579456</id><published>2007-12-17T20:57:00.000-08:00</published><updated>2007-12-17T21:12:58.956-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='IP'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>The Day The Routers Die</title><content type='html'>Those of us that are in the networking field might find this video amusing.&lt;br /&gt;&lt;br /&gt;Note: In the song, the performer (Gary Feldman) mentioned RIPE55 quite a few times. RIPE stands for Réseaux IP Européens (European IP Networks) which is a forum open to all parties who are interested in the technical development of internet and 55 is the meeting number during which he performed the song.&lt;br /&gt;&lt;br /&gt;Gary sung in native English accent so it might be a bit hard to understand. Here's a to &lt;a href="http://www.ripe.net/whois?searchtext=POEM-RIPE55-SONG"&gt;link&lt;/a&gt; the lyrics.&lt;br /&gt;&lt;br /&gt;&lt;embed src="http://www.youtube.com/v/_y36fG2Oba0&amp;amp;rel=" width="425" height="355" type="application/x-shockwave-flash" wmode="transparent"&gt;&lt;/embed&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-8379841405236579456?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/8379841405236579456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=8379841405236579456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8379841405236579456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8379841405236579456'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/12/day-routers-die.html' title='The Day The Routers Die'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3663396027446272584</id><published>2007-12-17T07:17:00.000-08:00</published><updated>2007-12-17T07:55:53.793-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VBScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Escape SQL strings</title><content type='html'>As part of my development job, I often create and troubleshoot SQL queries. And one of such tasks is validating SQL data to make sure the query would return the correct data set as expected.&lt;br /&gt;&lt;br /&gt;Time and again, I would run into queries like:&lt;br /&gt;&lt;br /&gt;Select blah blah From Table1 Where FieldName In ('abc', 'efd'.....)&lt;br /&gt;&lt;br /&gt;Dealing with a short list doesn't involve a lot of typing so it's not a big deal. But when facing a large list, this can be a daunting task as you have to escape the strings and separate them by commas.&lt;br /&gt;&lt;br /&gt;This is where Excel spreadsheet comes in handy. In Excel you can do a simple formula to take care of this by typing the following in a cell:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;="'" &amp;amp; A1 &amp;amp; "',"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What this does is it takes the value in cell A1 and wrapped it with a single quote and then adds a comma at the end. You can replicate this formula to other cells and it should save you quite a bit of typing.&lt;br /&gt;&lt;br /&gt;If you have a list of strings like:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;abc&lt;br /&gt;edf&lt;br /&gt;123&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;all you have to do is copy and paste it in the Excel spreadsheet created with the formula above and you will have a list of escape strings that you can place in your IN criteria.  I use this a lot and it saves me a whole lot of typing.&lt;br /&gt;&lt;br /&gt;Don't forget to take out the last comma. See &lt;a href="http://www.geocities.com/ld762/excel.xls"&gt;attached file&lt;/a&gt; for more info.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3663396027446272584?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3663396027446272584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3663396027446272584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3663396027446272584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3663396027446272584'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/12/escape-sql-strings.html' title='Escape SQL strings'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5781927733992457864</id><published>2007-12-16T12:29:00.000-08:00</published><updated>2007-12-16T12:58:52.302-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Hyper-V'/><title type='text'>Windows 2008 Hyper-V Installation - Login</title><content type='html'>I was checking out Windows 2008 Hyper-V RC1. Downloaded the ISO image and installed it. Everything went pretty well with minimum user intervention. After a couple of auto reboots the login window appeared and I had only one option - Other Login (for the core installation).&lt;br /&gt;&lt;br /&gt;I was scratching my head trying to figure out what login I can use since the installation didn't ask me to create any login. So I tried out a couple of well known default username and password and finally I got in with the Administrator &amp;amp; blank password combination.&lt;br /&gt;&lt;br /&gt;Once I logged in, I was presented with the good old Command prompt. For those of you who are used to the Windows interface, this might be a bit of a shocker.&lt;br /&gt;&lt;br /&gt;The next thing I did was to enable Hyper-V in the core server deployment. This was done with the command:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Start /w ocsetup Microsoft-Hyper-V&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A reboot is required once Hyper-V is enabled. Please note that the command is case sensitive so you must type the command exactly as seen here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5781927733992457864?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5781927733992457864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5781927733992457864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5781927733992457864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5781927733992457864'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/12/windows-2008-hyper-v-installation-login.html' title='Windows 2008 Hyper-V Installation - Login'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-8164794816040818081</id><published>2007-12-11T06:20:00.001-08:00</published><updated>2007-12-11T06:37:41.139-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>How to set up SQL Server to listen on multiple static TCP ports</title><content type='html'>&lt;a href="http://bp1.blogger.com/_bTDrD8248hs/R16gFXZUUjI/AAAAAAAAABQ/Ca3yI9gzu4U/s1600-h/TCPport.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5142723838543680050" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://bp1.blogger.com/_bTDrD8248hs/R16gFXZUUjI/AAAAAAAAABQ/Ca3yI9gzu4U/s320/TCPport.gif" border="0" /&gt;&lt;/a&gt;  &lt;div&gt;Did you know you can have your MS SQL Server listen on multiple TCP ports? I find this feature very useful since I run my DB server on a specific port and often run into clients that require to have database connection on a different port because it falls inline with their security practice.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Here's how you can do it:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;1. Start SQL Server Network Utility&lt;/div&gt;&lt;div&gt;2. Select TCP/IP and click Properties button&lt;/div&gt;&lt;div&gt;3. Enter the port numbers (separated by commas)&lt;/div&gt;&lt;div&gt;4. Click OK twice&lt;/div&gt;&lt;div&gt;5. Stop &amp;amp; restart SQL Server for the change to take effect&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-8164794816040818081?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/8164794816040818081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=8164794816040818081' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8164794816040818081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8164794816040818081'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/12/how-to-set-up-sql-server-to-listen-on.html' title='How to set up SQL Server to listen on multiple static TCP ports'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_bTDrD8248hs/R16gFXZUUjI/AAAAAAAAABQ/Ca3yI9gzu4U/s72-c/TCPport.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2437258572585658943</id><published>2007-12-04T04:51:00.000-08:00</published><updated>2007-12-04T05:01:07.965-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Dos'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><title type='text'>Terminal Services Client (MSTSC) and Vista/2008</title><content type='html'>A few months back, I wrote a blog about as you can see &lt;a href="http://brian-dao.blogspot.com/2007/05/remote-desktop-and-then-some.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Well, in the newer version of MSTSC for Windows Vista and Windows 2008, the "/console" option is no longer available.  However, you can use a new switch "/admin".&lt;br /&gt;&lt;br /&gt;This new switch has an advantage that "/admin" session can still be created when the session count has maxed out.  Also, the "/admin" sessions don't count toward the session limit that may be configured on a terminal server to limit the number of sessions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2437258572585658943?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2437258572585658943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2437258572585658943' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2437258572585658943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2437258572585658943'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/12/terminal-services-client-mstsc-and.html' title='Terminal Services Client (MSTSC) and Vista/2008'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3097589799332702677</id><published>2007-11-04T14:28:00.000-08:00</published><updated>2007-11-04T15:23:11.737-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Unable to Start Debugging on the Web Server</title><content type='html'>One of the error you'll probably run into when setting up a new ASP.net project is the "Unable to Start Debugging on the Web Server".  Most of the time, this error can be fixed by enabling Integrated Windows Authentication.  You can do this by:&lt;br /&gt;&lt;br /&gt;1. Launch IIS Management Console.&lt;br /&gt;2. Right click on the website and select Properties.&lt;br /&gt;3. Click on the Directory Security Tab.&lt;br /&gt;4. Check the box that reads "Integrated Windows authentication".&lt;br /&gt;&lt;br /&gt;If that doesn't work, you'll need to make sure that Keep HTTP-Alives Enabled option is checked.  And if all fails, register the .net framework again and check your permission settings.&lt;br /&gt;&lt;br /&gt;Good Luck!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3097589799332702677?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3097589799332702677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3097589799332702677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3097589799332702677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3097589799332702677'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/11/unable-to-start-debugging-on-web-server.html' title='Unable to Start Debugging on the Web Server'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-6786750275798675892</id><published>2007-10-19T12:28:00.000-07:00</published><updated>2007-10-19T12:31:13.727-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Dictionary'/><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='Hashtable'/><category scheme='http://www.blogger.com/atom/ns#' term='Collection'/><title type='text'>Iterate through HashTable</title><content type='html'>What is a Hashtable?&lt;br /&gt;&lt;br /&gt;A Hashtable is a collection type object that is used to store key-value combinations. In a way, it's very similar to a good old Dictionary object. You can retrieve stored value/object by either keys or by associated value. However, the performance is at its best when you search with keys.&lt;br /&gt;&lt;br /&gt;Let's see how we can create and use a hashtable:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim htCars As New Hashtable&lt;br /&gt;htCars.Add(1, "Buick")&lt;br /&gt;htCars.Add(2, "Chevy")&lt;br /&gt;htCars.Add(3, "GM")&lt;br /&gt;&lt;br /&gt;Dim myCar As String&lt;br /&gt;myCar = htCars.Item(2)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This code fragment creates a hashtable object and adds three items to it. Then it calls the Item property to get the value for item with key 2. Item is the default value for the hashtable so &lt;span style="color:#009900;"&gt;myCar = htCars(2)&lt;/span&gt; would have produce the same result.&lt;br /&gt;&lt;br /&gt;OK, so you've got a hashtable built and can get a single value out of it. But how do you iterate through all the items that were stored in it?&lt;br /&gt;&lt;br /&gt;One way to do this is to use the Keys collection to pull out the values:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim carID As Integer&lt;br /&gt;For Each carID In htCars.Keys&lt;br /&gt;Console.Writeline(carID &amp;amp; " - " &amp;amp; htCars(carID))&lt;br /&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another way is to use the DictionaryEntry object as in:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim dictEntry As DictionaryEntry&lt;br /&gt;For Each dictEntry In htCars&lt;br /&gt;Console.Writeline(dictEntry.Key &amp;amp; " - " &amp;amp; dictEntry .Value)&lt;br /&gt;Next dictEntry&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And last but not least, you can run through all the items stored in the hashtable by obtaining the enumerator object through the IDictionaryEnumerator which is returned by the GetEnumerator function:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim myEnumerator As IDictionaryEnumerator = htCars.GetEnumerator()&lt;br /&gt;While myEnumerator.MoveNext()&lt;br /&gt;Console.Writeline(myEnumerator.Key &amp;amp; " - " &amp;amp; myEnumerator.Value)&lt;br /&gt;End While&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Hashtable are easy to use, efficient &amp;amp; fast. I often use it to preload frequently use data like reference tables and it really improves the application performance nicely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-6786750275798675892?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/6786750275798675892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=6786750275798675892' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6786750275798675892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6786750275798675892'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/10/iterate-through-hashtable.html' title='Iterate through HashTable'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5677664968748377372</id><published>2007-10-15T15:19:00.000-07:00</published><updated>2007-10-15T15:25:53.769-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Using Enumerations To Document Your Code</title><content type='html'>Enumeration is a great way to assign easy to understand &amp;amp; remember textual names to your values. Consider the example:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Public Sub CityWork(ByVal CityID As Integer)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;If CityID = 0 Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;'do something&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;ElseIf CityID = 1 Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;'do something&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;ElseIf CityID = 2 Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;'do something&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Else&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;'do something&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;By the look of that, the code is pretty hard to understand as you have to remember what all those numbers are to associate with their function. To clarify things a bit, we can modify the above code using enumeration:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Public Enum CityTypes&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SanDiego&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SanFrancisco&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SanJose&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;End Enum&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Public Sub CityWork(ByVal CityID As CityTypes)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;If CityID = CityTypes.SanDiego Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;'do something&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;ElseIf CityID = CityTypes.SanFrancisco Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;'do something&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;ElseIf CityID = CityTypes.SanJose Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;'do something&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Else&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;'do something&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now this code is pretty much self-documented. It makes it so much easier to understand and will also allows you to take advantage of intellisense to help you code faster.&lt;br /&gt;&lt;br /&gt;By default, the first enumerated value (SanDiego in this case) will have a value of 0. You can change that by explicitly assign an integer to it. The next enumerated value, if not specified, will be increased by 1 from the previous value (SanJose = 6)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Public Enum CityTypes&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SanDiego = 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SanFrancisco = 5&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SanJose&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;End Enum&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you write your code this way, you'll find that it's much easier to understand, you can code faster, it's less prone to errors and at the same time, you pretty much self-documented the code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5677664968748377372?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5677664968748377372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5677664968748377372' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5677664968748377372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5677664968748377372'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/10/using-enumerations-to-document-your.html' title='Using Enumerations To Document Your Code'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-8562774724048189581</id><published>2007-10-12T10:43:00.000-07:00</published><updated>2007-10-12T10:49:32.496-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Troubleshooting ASP.net Application with CustomErrors</title><content type='html'>There are many ways to troubleshoot IIS application errors. Here I will discuss a simple yet effective way to troubleshoot your IIS applications.&lt;br /&gt;&lt;br /&gt;In the Web.config, under System.web node, there's one section called customErrors. By default this is commented out and the mode set to&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;lt;customerrors mode="RemoteOnly"&amp;gt;&lt;br /&gt;&amp;lt;system.web&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With this setting in place, if you run into some error, chances are you will only see a generic runtime error that reads:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;In order to see what's going on, you will need to modify the Web.config file so the customErrors tag read:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;lt;customerrors mode="Off"&amp;gt;&lt;br /&gt;&amp;lt;system.web&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note that this should only be done on development workstations as the detailed error message could expose information you don't want users to see like identity impersonation information... As for production, try to run the application on the server to see the error.&lt;br /&gt;&lt;br /&gt;Now that you can see what's actually causing the error, it should be easy to narrow the problem to a particular line number and take corrective action.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-8562774724048189581?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/8562774724048189581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=8562774724048189581' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8562774724048189581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8562774724048189581'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/10/troubleshooting-aspnet-application-with.html' title='Troubleshooting ASP.net Application with CustomErrors'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3726851351400359363</id><published>2007-10-11T18:38:00.000-07:00</published><updated>2007-10-11T18:52:00.403-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Fixing Fail To Access IIS Metabase Error</title><content type='html'>I often run into this error message for various reasons like doing a reinstallation, machine upgrade or preparing a workstation for a new co-worker...&lt;br /&gt;&lt;br /&gt;This error is fairly simple to fix but if you don't know how, it could drive one crazy. You often run into this error after you install Visual Studio 2005 and then try to run a webpage on your machine. The error you encounter will read something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;Failed to access IIS metabase.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If so, you may have installed IIS after the .NET framework has been installed. To fix this, try to repair your ASP.NET installation and set up all of the appropriate ISAPI extension mappings using the aspnet_regiss utility in the .NET framework folder.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;aspnet_regiis -i&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This utility is found in the .NET framework version number under your Windows installation folder.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3726851351400359363?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3726851351400359363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3726851351400359363' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3726851351400359363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3726851351400359363'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/10/fixing-fail-to-access-iis-metabase.html' title='Fixing Fail To Access IIS Metabase Error'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3734636657871657344</id><published>2007-10-09T15:30:00.000-07:00</published><updated>2007-10-09T15:33:02.871-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='DNS'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Configure DNS or Disable DNS lookup</title><content type='html'>If you mistype a command in the Privileged Mode on  Cisco router, by default, the router thinks you're trying to connect to a remote host through Telnet. So it performs a DNS lookup on the information you entered.&lt;br /&gt;&lt;br /&gt;If you haven't configured DNS on the router, the command prompt will hang until the DNS lookup timeouts. This is one of the thing that really bothers me so to resolve it, I have two options:&lt;br /&gt;&lt;br /&gt;The first option is to disable DNS using the "domain-lookup" command as in:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Router(config)# no ip domain-lookup&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;br /&gt;&lt;/span&gt;The second option is to properly configure DNS and point it to a valid DNS server. Here's an example:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Router(config)# ip name-server 4.2.2.1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By configure the router using one of the two options above it will save you a bit of time and cut a bit of frustration out of your daily routines.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3734636657871657344?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3734636657871657344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3734636657871657344' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3734636657871657344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3734636657871657344'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/10/configure-dns-or-disable-dns-lookup.html' title='Configure DNS or Disable DNS lookup'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-6056269125174458493</id><published>2007-10-07T20:12:00.000-07:00</published><updated>2008-04-22T06:08:30.534-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Truncate SQL Logfile</title><content type='html'>In the last blog, I discussed the process of &lt;a href="http://brian-dao.blogspot.com/2007/10/how-to-truncate-log-file-in-sql-server.html"&gt;shrinking the database size&lt;/a&gt; to make it easier to move around. The process involved detaching the database and reattaching it. I've an email from one of the readers asking if this can be done while the database is online.&lt;br /&gt;&lt;br /&gt;Well, the answer is yes. You can shrink the log file while the database is up. There are two commands that one can use to truncate a log file to reduce its size. They are Backup Log and DBCC ShrinkFile.&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;br /&gt;Backup Log demo01 with truncate_only&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;DBCC ShrinkFile('demo01_log', 1)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The commands above will truncate the log file and reduce its size to one megabytes. Before this is carried out though, I highly suggest that you backup your database first.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-6056269125174458493?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/6056269125174458493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=6056269125174458493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6056269125174458493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6056269125174458493'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/10/truncate-slq-logfile.html' title='Truncate SQL Logfile'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4033043447135234946</id><published>2007-10-01T05:23:00.001-07:00</published><updated>2007-10-01T08:48:53.402-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>How To Truncate Log File In SQL Server 2005</title><content type='html'>I as part of my development role, often perform database backup/restore operations and move the databases from one server to another (ie: development to test, to QA...).  One issue I often encounter is the amount of data I have to transfer from one server to another.  If the server is on a local network then it's not a big deal but if it goes out to a remote data center then I want to cut the file size down as much as I can.&lt;br /&gt;&lt;br /&gt;I accomplished by eliminating the log file thus trim down a nice portion of unnecessary data.  Here are the steps:&lt;br /&gt;&lt;br /&gt;1. Take the database offline&lt;br /&gt;2. Detach the database&lt;br /&gt;3. Delete or rename the log file&lt;br /&gt;4. Attach the database without the log file (highlight the log file and click Remove button)&lt;br /&gt;&lt;br /&gt;SQL Server should create a new log file for your database.  At this time, I backup the database and send it to the new server.  I find this process has helped me save a quite a bit of time, especially when setting up the database on a remote server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4033043447135234946?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4033043447135234946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4033043447135234946' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4033043447135234946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4033043447135234946'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/10/how-to-truncate-log-file-in-sql-server.html' title='How To Truncate Log File In SQL Server 2005'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3011716325176089463</id><published>2007-08-30T05:35:00.000-07:00</published><updated>2007-08-30T05:37:27.237-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><title type='text'>Disable Windows Error Reporting</title><content type='html'>Every now and then I run into one of these application or system error that pops up the Error Reporting dialog box.  This is one way Microsoft is getting the feedback from users on how well (or not) their software is performing or interacting with other applications and improve their products.&lt;br /&gt;&lt;br /&gt;This is fine with me but sometimes, it gets really annoying when the same error keeps occurring and you have to report, wait and then close the dialog box or choose not to report it.  To get rid of this headache once and for all, you can turn off this feature completely.&lt;br /&gt;&lt;br /&gt;1. Launch System Properties dialog box&lt;br /&gt;2. Click on Advanced Tab&lt;br /&gt;3. Click on Error Reporting button&lt;br /&gt;4. Select "Disable error reporting" radio button&lt;br /&gt;5. Click OK twice to exit&lt;br /&gt;&lt;br /&gt;You can launch System Properties dialog box through the Control Panel or by Right Click on My Computer then select Properties.  Another way to bring it up is to press the &lt;span style="color:#009900;"&gt;[Windows][Break]&lt;/span&gt; key combinations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3011716325176089463?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3011716325176089463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3011716325176089463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3011716325176089463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3011716325176089463'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/08/disable-windows-error-reporting.html' title='Disable Windows Error Reporting'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3068821284812791869</id><published>2007-08-20T13:20:00.000-07:00</published><updated>2007-08-20T13:22:34.627-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Configure Interface -  Cisco vs. Procurve</title><content type='html'>In Cisco IOS, you can switch from one interface from another real easy.  The Interface command moves you from one interface to another without having to Exit every time you configure an interface.&lt;br /&gt;&lt;br /&gt;With Procurve switch, you don't have the same kind of flexibility.  Everytime you configure an interface, you would need to Exit out to Configuration mode before you can enter another interface.&lt;br /&gt;&lt;br /&gt;Let look at this example on a Cisco switch:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Int g0/1&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;desc "IBA LAN"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Int g0/2&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;desc "ESV LAN"&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;That's perfectly legal on the Cisco IOS.  Now configure that on a Procurve switch:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Int g0/1&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;name "IBA LAN"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;exit&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Int g0/2&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;name "ESV LAN"&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;If you miss Exit command, you'll received an "Invalid Input" error because you can not go to a different interface from within an interface.  I never like this approach and prefer the shortcut where you enter two commands on one single line.  Not only it cuts out the Exit command but keeps you in the Config mode.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Int g0/1 name "IBA LAN"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Int g0/2 name "ESV LAN"&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3068821284812791869?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3068821284812791869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3068821284812791869' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3068821284812791869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3068821284812791869'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/08/configure-interface-cisco-vs-procurve.html' title='Configure Interface -  Cisco vs. Procurve'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-6376820153267989318</id><published>2007-08-13T14:55:00.001-07:00</published><updated>2007-08-13T14:59:31.809-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Web Application Security</title><content type='html'>Web applications are at great risks due to the fact that most applications are widely available to anyone with internet access. They often get compromised by script exploits.&lt;br /&gt;&lt;br /&gt;Most script exploits require the application to accept malicious input and inject it into a page where it will be executed on the server or in the client browser. The potential damage from such an exploit depends on the script that is being executed (taking over a system, install malware, deleting data...)&lt;br /&gt;&lt;br /&gt;The primary defense against script exploit is to never trust the information obtained from users. This apply to both incoming and outgoing data from users (data written to and data pulled from database).&lt;br /&gt;&lt;br /&gt;There are many things a developer can do to protect application against script exploits. Data input by users should always be validated. Form elements should be HTML-encoded. Dynamic SQL might be flexible but yet it can compromise your data. Consider parameterized query against SQL queries using string concatenation.&lt;br /&gt;&lt;br /&gt;In this simple example:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;"Select * From Customers where LastName = " &amp; txtLastName.Value&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;A malicious user who knows a something about database could turn that SQL statement into:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Select * From Customers Where LastName = 'a'; Delete From Customers Where LastName &gt; ''&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And when it gets executed, the database is compromised.&lt;br /&gt;&lt;br /&gt;It is very important to understand how users and their data interact with your application. That way you can better protect your data, application and users from script exploits.&lt;br /&gt;For more information on how to protect your web application see &lt;a href="http://msdn2.microsoft.com/en-us/library/zdh19h94.aspx"&gt;Basic Security Practices for Web Applications&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-6376820153267989318?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/6376820153267989318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=6376820153267989318' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6376820153267989318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6376820153267989318'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/08/web-application-security.html' title='Web Application Security'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-6821085301080676149</id><published>2007-08-13T13:25:00.000-07:00</published><updated>2007-08-13T13:27:29.632-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Controls'/><title type='text'>How To Set Access Key For ASP.net Web Server Controls</title><content type='html'>Access key combination allows users to press ALT key plus another key to focus or jump to a specific control.&lt;br /&gt;&lt;br /&gt;Some controls have Access property where you can set this like TextBox or ListBox.  As an alternative, you can set an Access key for a Label control and then tell the browser to associate it with another control.  With this approach, you can use the Label control as caption to indicate the access key with an underlined letter.&lt;br /&gt;&lt;br /&gt;To set the access key using label control you must:&lt;br /&gt;&lt;br /&gt;1. Add the control to be associated&lt;br /&gt;2. Add a Label control&lt;br /&gt;3. Set the access key&lt;br /&gt;4. Associate the control to receive focus&lt;br /&gt;&lt;br /&gt;Here's an example:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;asp:Label ID="lblLastName" runat="server"&lt;br /&gt;  AccessKey="L"&lt;br /&gt;  AssociatedControlID="txtLastName"&lt;br /&gt;  Text="&amp;lt;u&amp;gt;L&amp;lt;/u&amp;gt;ast name: "&amp;gt;&lt;br /&gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;asp:TextBox ID="txtLastName" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note that setting focus by using access key from a Label control requires that client scripting is enabled in the browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-6821085301080676149?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/6821085301080676149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=6821085301080676149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6821085301080676149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6821085301080676149'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/08/how-to-set-access-key-for-aspnet-web.html' title='How To Set Access Key For ASP.net Web Server Controls'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-573779187197848950</id><published>2007-08-13T12:50:00.000-07:00</published><updated>2007-08-13T12:52:09.839-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Download File with Visual Basic</title><content type='html'>My.Computer.Network namespace provides the DownloadFile method which can be used for downloading a remote file to a specific location.&lt;br /&gt;&lt;br /&gt;The basic syntax for calling DownloadFile method is to specify the file's location as a string or URI and the location to store the file as seen below:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;My.Computer.Network.DownloadFile("&lt;/span&gt;&lt;a href="http://www.server.com/readme.txt"&gt;&lt;span style="color:#009900;"&gt;http://www.server.com/readme.txt&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#009900;"&gt;", "c:\docs\readme.txt")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The overloaded methods allow you to specify more advanced parameter like timeout, username &amp; password for protected file.  The example below downloads password protected file.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;My.Computer.Network.DownloadFile("&lt;/span&gt;&lt;a href="http://www.server.com/readme.txt"&gt;&lt;span style="color:#009900;"&gt;http://www.server.com/readme.txt&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#009900;"&gt;", "c:\docs\readme.txt", "myusername", "mypassword")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note that FTP protocol is used by the DownloadFile method to send information including username &amp; password in plain text.  It should not be used to transmit sensitive information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-573779187197848950?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/573779187197848950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=573779187197848950' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/573779187197848950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/573779187197848950'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/08/download-file-with-visual-basic.html' title='Download File with Visual Basic'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5462703881501522809</id><published>2007-07-31T22:51:00.000-07:00</published><updated>2007-08-13T12:55:35.381-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fun Stuff'/><title type='text'>Now for something different!</title><content type='html'>&lt;a href="http://bp3.blogger.com/_bTDrD8248hs/RsC3G6nS49I/AAAAAAAAABI/WFLriC6xUIc/s1600-h/CompDown.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5098276107624571858" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://bp3.blogger.com/_bTDrD8248hs/RsC3G6nS49I/AAAAAAAAABI/WFLriC6xUIc/s320/CompDown.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5462703881501522809?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5462703881501522809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5462703881501522809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5462703881501522809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5462703881501522809'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/07/now-for-something-different.html' title='Now for something different!'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_bTDrD8248hs/RsC3G6nS49I/AAAAAAAAABI/WFLriC6xUIc/s72-c/CompDown.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-8472312132321962431</id><published>2007-07-17T13:09:00.000-07:00</published><updated>2007-07-17T13:17:11.464-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dos'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Cisco Command Aliases</title><content type='html'>Alias command allows you to define aliases for long commands. Alias command breaks down into three modes:&lt;br /&gt;&lt;br /&gt;Alias Exec for Privileged Mode.&lt;br /&gt;Alias Configure for Global Configuration Mode.&lt;br /&gt;Alias Interface for Interface Configuration Mode.&lt;br /&gt;&lt;br /&gt;Let say that you want to shorten Show Running-Configuration command to just two keystrokes, you could define it as follow:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Router(Config)# alias exec sr Show Running-config&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Or if you want to use ns to perform No Shut command on an interface you could define it as:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#33cc00;"&gt;Router(Config)# alias interface ns no shutdown&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;So now instead of typing out all those long commands you could type sr for show runn or ns for no shut down and still achieve the same desired effects.&lt;br /&gt;&lt;br /&gt;Cisco IOS includes some built-in command aliases. You can view these aliases by using the "show alias" command. Here are the default command aliases:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;h - help &lt;li&gt;lo - logout &lt;li&gt;p - ping &lt;li&gt;r - resume &lt;li&gt;s - show &lt;li&gt;u - undebug &lt;li&gt;un - undebug &lt;li&gt;w - where&lt;/li&gt;&lt;/ul&gt;The Alias Command reminds me of the .bat files back in the DOS days when we used it to combine multiple commands together and shorten the filename to just a few keystrokes. If used effectively, this could saving you a lot of time and typing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-8472312132321962431?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/8472312132321962431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=8472312132321962431' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8472312132321962431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8472312132321962431'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/07/cisco-command-aliases.html' title='Cisco Command Aliases'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3626239906081455699</id><published>2007-07-16T14:06:00.001-07:00</published><updated>2007-07-16T14:38:16.762-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Show Running-Configuration</title><content type='html'>One of the most commonly used command when troubleshooting a switch or router is the "Show Run" command. It gives you an insight into the currently running configuration.&lt;br /&gt;&lt;br /&gt;Sometimes, this command yields so much output one would be overwhelm with the amount of text on the screen and have to keep pressing the space key to scroll down to see more information.&lt;br /&gt;&lt;br /&gt;Well, if you know what you are looking for then you could add a command prefix " begin keyword" and it'll start showing the configuration from that where the keyword occurs.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;SwitchA# Show runn | begin spanning-tree&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the example above, the switch will show the current configuration from the line where it finds the first occurrence of the word "spanning-tree".&lt;br /&gt;&lt;br /&gt;Using this command can really save you all the trouble of spacing through all the text only to find that you go too fast and miss the relevant information and have to scroll back to look for it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3626239906081455699?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3626239906081455699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3626239906081455699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3626239906081455699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3626239906081455699'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/07/show-running-configuration.html' title='Show Running-Configuration'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5401388263418760856</id><published>2007-07-16T06:38:00.001-07:00</published><updated>2007-07-16T06:48:24.030-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Array'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>Funky Name</title><content type='html'>&lt;a href="http://bp3.blogger.com/_bTDrD8248hs/Rpt0-Pk2FcI/AAAAAAAAABA/qphuoi2zLyw/s1600-h/FunkyName.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5087788816726889922" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://bp3.blogger.com/_bTDrD8248hs/Rpt0-Pk2FcI/AAAAAAAAABA/qphuoi2zLyw/s320/FunkyName.gif" border="0" /&gt;&lt;/a&gt; I had a little time to spare and wanted to have some fun to relieve the stress so I created a little application that generate some funky names based on the user's input.&lt;br /&gt;&lt;br /&gt;The name generation logic is based on a children's book, Captain Underpants And the Perilous Plot Professor Poopypants, by Dave Pilkey, in which the evil Professor forces everyone to assume new names...&lt;br /&gt;&lt;br /&gt;The program uses some simple one dimensional arrays and use the user's input to index into the arrays and generate the new name.  It also makes use of the one click deployment option.&lt;br /&gt;&lt;br /&gt;Pretty funny.  Give it a try.&lt;br /&gt;&lt;br /&gt;The program can be downloaded from &lt;a href="http://www.meshflowers.com/FunkyNames/"&gt;http://www.meshflowers.com/FunkyNames/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5401388263418760856?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5401388263418760856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5401388263418760856' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5401388263418760856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5401388263418760856'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/07/funky-name.html' title='Funky Name'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_bTDrD8248hs/Rpt0-Pk2FcI/AAAAAAAAABA/qphuoi2zLyw/s72-c/FunkyName.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4671428311038858095</id><published>2007-07-03T07:47:00.000-07:00</published><updated>2007-07-03T07:57:02.680-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='System.XML'/><title type='text'>Reading XML File Using XMLDocument Object</title><content type='html'>In the previous blog, I discussed &lt;a href="http://brian-dao.blogspot.com/2007/06/reading-xml-file-using-xmltextreader.html"&gt;how to read XML file using XMLTextReader object&lt;/a&gt; of the System.XML namespace. In the same namespace, we also have XMLDocument which can also be used to read XML files.&lt;br /&gt;&lt;br /&gt;You can use the Load method to read an XML file and process the elements using XPath selection if you know the structure of the XML document as follow:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim myXmlDoc as New XmlDocument&lt;br /&gt;Dim myNode as XmlNode&lt;br /&gt;myXmlDoc.Load("Cars.xml")&lt;br /&gt;myNode = myXmlDoc.SelectSingleNode("/car/honda")&lt;br /&gt;myTextBox.Text = myNode.InnerXml &amp; vbCrLf&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The XmlNode object provides the NextSibling method which can be used to move to the next element or node.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;myNode = myNode.NextSibling&lt;br /&gt;myTextBox.Text &amp;amp;= myNode.InnerXml&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Now that works fine if you know the the structure of the XML document. If you don't know the structure, you can navigate through the document using FirstChild and NextSibling methods.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;myNode = myXmlDoc.FirstChild&lt;br /&gt;While myNode.NodeType &lt;&gt; XmlNodeType.Element And Not myNode Is Nothing&lt;br /&gt;myNode = myNode.NextSibling&lt;br /&gt;End While&lt;br /&gt;myTextBox.Text = myNode.InnerXml&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.geocities.com/ld762/XMLRead2.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5080408953304857298" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://www.geocities.com/ld762/XMLRead2.gif" border="0"&gt;&lt;/a&gt;This will dump everything in that node to the textbox including the element names and attributes.&lt;br /&gt;&lt;br /&gt;It's not possible to cover all the methods and properties of the XMLDocument and XMLNode in a short blog, but I hope this will get you going.&lt;br /&gt;&lt;br /&gt;Further reading should be done on the following topics: XMLDocument, XMLNode, XMLAttribute, FirstChild, HasChildNodes, InnerText, InnerXML...&lt;br /&gt;&lt;br /&gt;Download the sample project &lt;a href="http://www.geocities.com/ld762/XMLRead2.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4671428311038858095?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4671428311038858095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4671428311038858095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4671428311038858095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4671428311038858095'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/07/reading-xml-file-using-xmldocument.html' title='Reading XML File Using XMLDocument Object'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-1553714014049517476</id><published>2007-06-29T09:05:00.000-07:00</published><updated>2007-07-03T07:58:13.638-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='System.XML'/><title type='text'>Reading XML File Using XMLTextReader</title><content type='html'>System.XML namespace provides us with the XMLTextReader class which we could use to read and process XML files.&lt;br /&gt;&lt;br /&gt;The most commonly used attributes are .Name and .Value which returns information of about the elements and their associated information.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.geocities.com/ld762/XMLRead.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5080408953304857298" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://www.geocities.com/ld762/XMLRead.gif" border="0" /&gt;&lt;/a&gt;MoveToNextAttribute method is used to navigate to the next element. The project below uses an OpenFileDialog box to get the XML file which is then passed to XMLTextReader object and open it. Then the Read method is called to read in and processed the entire XML file and put its content into a textbox.&lt;br /&gt;&lt;br /&gt;In my opinion, reading XML this way is rather confusing. I like &lt;a href="http://brian-dao.blogspot.com/2007/07/reading-xml-file-using-xmldocument.html"&gt;reading XML file using XMLDocument object&lt;/a&gt; better as it’s very simple and gives you a much clearer view of the whole process.&lt;br /&gt;&lt;br /&gt;This sample project can be downloaded &lt;a href="http://www.geocities.com/ld762/XMLRead.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-1553714014049517476?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/1553714014049517476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=1553714014049517476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1553714014049517476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1553714014049517476'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/reading-xml-file-using-xmltextreader.html' title='Reading XML File Using XMLTextReader'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-652276542112978554</id><published>2007-06-26T09:12:00.001-07:00</published><updated>2007-06-26T09:31:31.333-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ListBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ComboBox'/><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='Controls'/><title type='text'>ListBox - Select Multiple Items</title><content type='html'>I've seen quite a number of forums posts asking how to get the selected items of a listbox when the listbox selection mode has been changed to allow for multiple items to be selected. It's actually pretty simple to do in .net.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp0.blogger.com/_bTDrD8248hs/RoE9Bp9zOtI/AAAAAAAAAA4/8V_kvCchdRw/s1600-h/ListBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5080408953304857298" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://bp0.blogger.com/_bTDrD8248hs/RoE9Bp9zOtI/AAAAAAAAAA4/8V_kvCchdRw/s320/ListBox.gif" border="0" /&gt;&lt;/a&gt;What you need to do is to loop through the SelectedItems collection to get to the items that have been selected. The list box also has a property called SelectedIndices that you can use.&lt;br /&gt;&lt;br /&gt;Download the &lt;a href="http://www.geocities.com/ld762/ListBox.zip"&gt;zip file&lt;/a&gt; to see the sample code on this which also shows you how to add a name-value pair item like we used to do in VB6.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-652276542112978554?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/652276542112978554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=652276542112978554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/652276542112978554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/652276542112978554'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/listbox-select-multiple-items.html' title='ListBox - Select Multiple Items'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_bTDrD8248hs/RoE9Bp9zOtI/AAAAAAAAAA4/8V_kvCchdRw/s72-c/ListBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-1865915477936743843</id><published>2007-06-21T12:51:00.000-07:00</published><updated>2007-06-21T12:55:47.979-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Using Meta Tags</title><content type='html'>Web pages are only useful if you have people accessing them. People only come to your site if they know how to get to it. If your site isn't well established then you need to depend on search engines to advertise your pages to the rest of the world. One way of doing that is through the use of Meta Tags.&lt;br /&gt;&lt;br /&gt;Most web developers are too focused on creating the page content, they often overlook Meta Tags. Here, I'll discuss some of the commonly used Meta tags.&lt;br /&gt;&lt;br /&gt;Description Meta tag describes what the page or site is about. The syntax for this is:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;Meta Name="Description" Content="Page description"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Keywords Meta tag contains the keywords that would be relevant to the page/site. For example:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;Meta Name="Keywords" Content="Web, Programming, Blog"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Description &amp; Keywords often go hand in hand. You could apply this at the site level (all pages have the same descriptions &amp;amp; keywords) or at the page level (all pages have different descriptions and keywords). I’ll talk more about this in search engine ranking blog.&lt;br /&gt;&lt;br /&gt;Author Meta contains the name of the person who published the page:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;Meta Name="Author" Content="Brian Dao"&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Revisit-After Meta tag tells the web crawlers or spiders to revisit the page after certain period has passed.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;Meta Name="Revisit-After" Content="7 days"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Robots Meta tag can instruct the crawlers to index the page and whether to follow the links found on the site or not:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;Meta Name="Robots" Content="index, follow"&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;These are just a few things you can do to help published your webpages and get them indexed with the search engines and not optimizing your site for better ranking in search engine index as I'll talk about that in another blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-1865915477936743843?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/1865915477936743843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=1865915477936743843' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1865915477936743843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1865915477936743843'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/using-meta-tags.html' title='Using Meta Tags'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2763006710914405210</id><published>2007-06-12T13:39:00.000-07:00</published><updated>2007-06-13T14:30:02.658-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='IP'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Switch'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Changing IP on Cisco/ProCurve Switch</title><content type='html'>Let's say we have the IP address 10.10.10.1/24 assigned to vlan 1 and want to change it to 10.10.10.2. On a Cisco switch, you can telnet in and send these commands to the switch:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;conf t&lt;br /&gt;interface vlan 1&lt;br /&gt;ip address 10.10.10.2 255.255.255.0&lt;/span&gt;&lt;br /&gt;&lt;p&gt;The Cisco switch will update the IP address and disconnect your session.  On a ProCurve switch, if you issue the same commands it will spit out an error saying:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff6600;"&gt;"The IP address (or subnet) 10.10.10.2/24 already exists."&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;If you were going through the console port, you can set the new IP using the following commands:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;conf t&lt;br /&gt;vlan 1&lt;br /&gt;no ip address 10.10.10.1/24&lt;br /&gt;ip address 10.10.10.2/24&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;However, you can't do that if you connect to the switch remotely. As soon as the "no ip address" command is received and processed by the switch, your session will be disconnected and you won't be able to get to the switch.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp1.blogger.com/_bTDrD8248hs/Rm8GCZ9zOsI/AAAAAAAAAAw/w8E07LYJehU/s1600-h/3500.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5075281943469439682" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://bp1.blogger.com/_bTDrD8248hs/Rm8GCZ9zOsI/AAAAAAAAAAw/w8E07LYJehU/s320/3500.jpg" border="0" /&gt;&lt;/a&gt;The trick to get around this issue is to make this IP address change through the switch's built-in menu system instead of using the plain old CLI.&lt;br /&gt;&lt;br /&gt;1. Type "menu", hit Enter&lt;br /&gt;2. Select "Switch Configuration"&lt;br /&gt;3. Select "IP Configuration"&lt;br /&gt;4. Navigate to Edit, hit Enter&lt;br /&gt;5. Change the IP and then Save&lt;br /&gt;&lt;br /&gt;You will be disconnected once you save it but you will be able to reconnect using the new IP.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2763006710914405210?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2763006710914405210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2763006710914405210' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2763006710914405210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2763006710914405210'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/changing-ip-on-procurve-switch.html' title='Changing IP on Cisco/ProCurve Switch'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_bTDrD8248hs/Rm8GCZ9zOsI/AAAAAAAAAAw/w8E07LYJehU/s72-c/3500.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-9092219015449411638</id><published>2007-06-12T08:29:00.000-07:00</published><updated>2007-06-13T13:58:15.692-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='IOS'/><category scheme='http://www.blogger.com/atom/ns#' term='TFTP'/><category scheme='http://www.blogger.com/atom/ns#' term='Ping'/><category scheme='http://www.blogger.com/atom/ns#' term='IP'/><category scheme='http://www.blogger.com/atom/ns#' term='FTP'/><category scheme='http://www.blogger.com/atom/ns#' term='Files'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Cisco Switch - TFTP IOS Upgrade</title><content type='html'>Update, Copy, Backup, Restore IOS and startup-config are pretty much done in the same manner. First, you've got to configure the switch and the PC to talk then run the TFTP or FTP server and start the copy process.&lt;br /&gt;&lt;br /&gt;Let's walk though how you can update Cisco IOS on a 6500.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Router&gt; enable&lt;br /&gt;Router# configure terminal&lt;br /&gt;Router(config)# interface gig 9/1&lt;br /&gt;Router(config-int)# switchport&lt;br /&gt;Router(config-int)# switchport mode access&lt;br /&gt;Router(config-int)# switchport access vlan 1&lt;br /&gt;Router(config-int)# no shutdown&lt;br /&gt;Router(config-int)# exit&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;At this point, we have turn port 9/1 into a layer 2 port on vlan 1. Now we need to assign an ip address to this default vlan so we can communicate to it.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Router(config)# interface vlan 1&lt;br /&gt;Router(config-int)# ip address 10.10.10.1 255.255.255.0&lt;br /&gt;Router(config-int)# no shutdown&lt;br /&gt;Router(config-int)# exit&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.geocities.com/ld762/ProCurve.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5074916849774443186" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://www.geocities.com/ld762/ProCurve.jpg" border="0" valign="top"/&gt;&lt;/a&gt;The next thing we need to do is to configure the network adapter on your PC or laptop and give it an address that's on the same network as the switch. In this case, I set it to be 10.10.10.2 255.255.255.0.&lt;br /&gt;&lt;br /&gt;Plug in the cable from the PC to the port we just configured; and to make sure the PC can talk to the 6500 we can try pinging it:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Router(config)# do ping 10.10.10.2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you have a successful ping reply then you should be good to go. Launch the TFTP server and start the copy process. To copy from data from TFTP server to the switch use:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Router# copy tftp: disk0:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After you issue either of this command, you will be prompted for the FTFP server address and filename. Enter 10.10.10.2 and the filename you want to copy, then confirm it to start the copy process.&lt;br /&gt;&lt;br /&gt;And to copy data from flash to FTFP server use the command:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Router# copy disk0: tftp: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you are copying a rather large file then you should use FTP instead of TFTP and issue the command:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Router# copy FTP: Disk0: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I have run into some issue while moving a large file to the Cisco 6509. See this &lt;a href="http://brian-dao.blogspot.com/2007/06/cisco-tftp-flash-update.html"&gt;blog&lt;/a&gt; for more details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-9092219015449411638?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/9092219015449411638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=9092219015449411638' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/9092219015449411638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/9092219015449411638'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/cisco-switch-tftp-ios-upgrade.html' title='Cisco Switch - TFTP IOS Upgrade'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4340785614150249573</id><published>2007-06-11T13:54:00.000-07:00</published><updated>2007-06-13T13:50:30.463-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='IOS'/><category scheme='http://www.blogger.com/atom/ns#' term='TFTP'/><category scheme='http://www.blogger.com/atom/ns#' term='Ping'/><category scheme='http://www.blogger.com/atom/ns#' term='IP'/><category scheme='http://www.blogger.com/atom/ns#' term='FTP'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><title type='text'>ProCurve Switch - TFTP Flash Update</title><content type='html'>To update the IOS on the HP's ProCurve switches you first need to configure an access port so it can communicate to the TFTP Server.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;ProCurve Switch 3500yl-48G&gt; enable&lt;br /&gt;ProCurve Switch 3500yl-48G# configure terminal&lt;br /&gt;ProCurve Switch 3500yl-48G(config)# vlan 1&lt;br /&gt;ProCurve Switch 3500yl-48G(vlan-1)# ip address 10.10.10.1/24&lt;br /&gt;ProCurve Switch 3500yl-48G(vlan-1)# exit&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.geocities.com/ld762/ProCurve.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5074916849774443186" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://www.geocities.com/ld762/ProCurve.jpg" border="0" /&gt;&lt;/a&gt;Next, you will need to configure the network adapter on your PC or laptop and give it an address that's on the same network as the switch. In this case, I set it to be 10.10.10.2 255.255.255.0.&lt;br /&gt;&lt;br /&gt;Then the next step is to connect your machine to the switch; plug a cable from your laptop or PC to the switch. And just to make sure that the data can travel from one end to another, we'll go ahead and try to send a ping to the server:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;ProCurve Switch 3500yl-48G# ping 10.10.10.2&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;If the ping is successful, you need to launch your TFTP Server, then you can go ahead and update the flash by issuing the copy command and pass to it the server address and the filename:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;ProCurve Switch 3500yl-48G# copy tftp flash 10.10.10.2 k_12_02.swi&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;And if you need to update the secondary flash, then issue this command:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;ProCurve Switch 3500yl-48G# copy tftp flash 10.10.10.2 k_12_02.swi secondary &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I make a habit of using scripts to make the whole process easier to manage and make the update faster so here's the entire script:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;enable&lt;br /&gt;configure terminal&lt;br /&gt;vlan 1&lt;br /&gt;no ip add&lt;br /&gt;ip address 10.10.10.1/24&lt;br /&gt;exit&lt;br /&gt;ping 10.10.10.2&lt;br /&gt;copy tftp flash 10.10.10.2 k_12_02.swi&lt;br /&gt;y&lt;br /&gt;copy tftp flash 10.10.10.2 k_12_02.swi secondary&lt;br /&gt;y&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;Note: If you use this script, make sure that you update the ip address and change the filename.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4340785614150249573?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4340785614150249573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4340785614150249573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4340785614150249573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4340785614150249573'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/procurve-switch-tftp-flash-update.html' title='ProCurve Switch - TFTP Flash Update'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5936709371560145708</id><published>2007-06-11T07:17:00.000-07:00</published><updated>2007-06-11T07:26:42.803-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Controls'/><title type='text'>Programmatically Add Event Handlers to Controls At Runtime</title><content type='html'>If you have read my previous blogs, you'll see that I have discussed about how to &lt;a href="http://brian-dao.blogspot.com/2007/06/programmatically-add-controls-at.html"&gt;add&lt;/a&gt; and &lt;a href="http://brian-dao.blogspot.com/2007/06/programmatically-remove-controls-at.html"&gt;remove&lt;/a&gt; controls at run time. Some controls created at runtime are pretty much useless if they have no event handlers attached to them.&lt;br /&gt;&lt;br /&gt;What are event handlers? Think of event handlers as actions that are bound to controls. What action(s) would you want to carry out when certain things happen (ie: like a button is clicked, doubleclicked…)?&lt;br /&gt;&lt;br /&gt;Let take a look at the following lines of code:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim newButton as Windows.Forms.Button&lt;br /&gt;Dim i As Integer&lt;br /&gt;For i = 1 To 5&lt;br /&gt;newButton = New Windows.Forms.Button&lt;br /&gt;newButton.Name = "btnButton" &amp; i&lt;br /&gt;newButton.Text = "Button " &amp;amp; i&lt;br /&gt;newButton.Top = 20 + i * 30&lt;br /&gt;newButton.Left = 40&lt;br /&gt;Me.Controls.Add(newButton)&lt;br /&gt;Next&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The code block above will add 5 buttons to the form at runtime. But when you click on the buttons, nothing happen. Why? This is because at this time, there are no event handlers attached to the buttons.&lt;br /&gt;&lt;br /&gt;Let make some modifications:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Public WithEvents newButton As Windows.Forms.Button&lt;br /&gt;Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;Dim i As Integer&lt;br /&gt;For i = 1 To 5&lt;br /&gt;newButton = New Windows.Forms.Button&lt;br /&gt;newButton.Name = "btnButton" &amp; i&lt;br /&gt;newButton.Text = "Button " &amp;amp; i&lt;br /&gt;newButton.Top = 20 + i * 30&lt;br /&gt;newButton.Left = 40&lt;br /&gt;AddHandler newButton.Click, AddressOf ButtonClicked&lt;br /&gt;Me.Controls.Add(newButton)&lt;br /&gt;Next&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub ButtonClicked(ByVal sender As Object, ByVal e As EventArgs)&lt;br /&gt;MsgBox("You clicked: " &amp; sender.name &amp;amp;amp;amp; vbCrLf &amp; "Button name: " &amp;amp; sender.Text)&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Here the newButton has been redefined as a control with events and the AddHandler call attached the method ButtonClicked to the Click event of the control. Note that the control is declared as a global variable. You can’t declare a control with events as a local variable. The address of ButtonClick method is then bound or attached to newButton’s click event. Any time the button is clicked, ButtonClicked method will run and a message box will be displayed.&lt;br /&gt;&lt;br /&gt;As you can see, it's pretty straight forward to add, remove and attached events to controls that are created on the fly. This blog only scratches the surface of these issues. You can further your study from these links:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/74wy9422(VS.80).aspx"&gt;Delegates and the AddressOf Operator&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/2z7x8ys3(VS.80).aspx"&gt;Events and Event Handlers&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Download sample code: &lt;a href="http://www.geocities.com/ld762/EventHandlers.zip"&gt;EventHandlers.zip&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5936709371560145708?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5936709371560145708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5936709371560145708' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5936709371560145708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5936709371560145708'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/programmatically-add-event-handlers-to.html' title='Programmatically Add Event Handlers to Controls At Runtime'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2632751368280504789</id><published>2007-06-10T20:30:00.000-07:00</published><updated>2007-06-10T20:49:59.091-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Controls'/><title type='text'>Programmatically Remove Controls At Runtime</title><content type='html'>&lt;div&gt;In the last &lt;a href="http://brian-dao.blogspot.com/2007/06/programmatically-add-controls-at.html"&gt;blog&lt;/a&gt;, I discussed about how to programmatically add controls at runtime. This blog, we'll do just the opposite of that - removing controls programmatically.&lt;br /&gt;&lt;br /&gt;The Controls collection offers a few methods that we can use to remove controls at runtime (Clear, Remove, RemoveAt).&lt;br /&gt;&lt;br /&gt;Be careful when you call Remove or RemoveAt method though, as the Count property as well as the collection will be updated instantaneously and might produce undesirable result. Consider the following code snippet:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim i as Integer&lt;br /&gt;With Me.Controls&lt;br /&gt;For i = 0 to .Count - 1&lt;br /&gt;If TypeOf .Item(i) is CheckBox Then&lt;br /&gt;.RemoveAt(i)&lt;br /&gt;Next&lt;br /&gt;End With &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will work just fine if you have only one checkbox. However, if you have more than one checkboxes on the form, then it will remove every other one as the control collection is updated as soon as a control is removed resulting in a change in the Count property which messes things up and eventually throw an index out of range error.&lt;br /&gt;&lt;br /&gt;To work around this, we'll have to remove the controls from the high end of the Count property as follow:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim i as Integer&lt;br /&gt;With Me.Controls&lt;br /&gt;For i = .Count - 1 To 0 Step -1&lt;br /&gt;If TypeOf .Item(i) is CheckBox Then&lt;br /&gt;.RemoveAt(i)&lt;br /&gt;Next&lt;br /&gt;End With&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can download the code for this blog &lt;a href="http://www.geocities.com/ld762/Controls.zip"&gt;here&lt;/a&gt;. &lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5074646923964791458" style="FLOAT: left; MARGIN: 0px 10px 10px 0px;" alt="" src="http://bp2.blogger.com/_bTDrD8248hs/RmzEfZ9zOqI/AAAAAAAAAAc/udalgVVgqAc/s320/Controls.jpg" border="0" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2632751368280504789?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2632751368280504789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2632751368280504789' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2632751368280504789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2632751368280504789'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/programmatically-remove-controls-at.html' title='Programmatically Remove Controls At Runtime'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_bTDrD8248hs/RmzEfZ9zOqI/AAAAAAAAAAc/udalgVVgqAc/s72-c/Controls.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-1201609439485331909</id><published>2007-06-10T19:29:00.000-07:00</published><updated>2007-06-10T20:46:17.089-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Controls'/><title type='text'>Programmatically Add Controls At Runtime</title><content type='html'>As I have experienced it, in some situations, you might not know the types of control or how many controls will be needed at design time. In these cases, you'd have to create the controls programmatically and dynamically add them to the form at runtime.&lt;br /&gt;&lt;br /&gt;Adding controls at runtime is pretty simple:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim newControl as New Windows.Forms.CheckBox&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;newControl.Name = "chkCheckAll"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;newControl.Text = "check all"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;newControl.Top = 10&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;newControl.Left = 10me.Controls.Add(newControl)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The code snippet above will declare a checkbox and add it to the current form.&lt;br /&gt;&lt;br /&gt;If you don't know the type of control then it'd be best to declare the new control as a generic control and then later modify to suite your need.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim newControl as Windows.Forms.Control&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;If createCheckBox Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;newControl = New Windows.Forms.CheckBox&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Else&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;newControl = New Windows.Forms.RadioButton&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;End If&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;I find the .Tag property particularly helpful when working with controls dynamically. You can use it to store specific information about the control and you it later on when you process the control.&lt;br /&gt;&lt;br /&gt;This blog only touches some of the properties for CheckBox &amp; RadioButton as I try to keep the blog short. You should further explore their other properties to gain more understanding about them.&lt;br /&gt;&lt;br /&gt;Now that you know how to add controls at runtime, let's see how you can &lt;a href="http://brian-dao.blogspot.com/2007/06/programmatically-remove-controls-at.html"&gt;programmatically remove&lt;/a&gt; them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-1201609439485331909?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/1201609439485331909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=1201609439485331909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1201609439485331909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1201609439485331909'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/programmatically-add-controls-at.html' title='Programmatically Add Controls At Runtime'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-1693764306379628691</id><published>2007-06-08T15:42:00.000-07:00</published><updated>2008-02-13T10:18:09.271-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='IOS'/><category scheme='http://www.blogger.com/atom/ns#' term='TFTP'/><category scheme='http://www.blogger.com/atom/ns#' term='FTP'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Files'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Cisco TFTP - Flash Update Problem</title><content type='html'>I was upgrading the IOS for the Cisco 6509s. I got Cisco TFTP Server setup and connected to it to download the file. The file was around 80Mb. TFTP Server threw an exception and shutdown. Upon restart, the file started to get downloaded but a few seconds later Cisco TFTP Server threw another error. This time I was able to view the error message and it said the transfer failed due to Synchronization Error.&lt;br /&gt;&lt;br /&gt;I switched to SolarWinds TFTP Server and got a more detailed error saying the file was too large to be transferred through TFTP.&lt;br /&gt;&lt;br /&gt;As an alternative, I used FTP Server from 3CDaemon and issued the command:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;copy FTP: Disk0:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and it worked like a champ.&lt;br /&gt;&lt;br /&gt;I had IIS running on my laptop so I turned off 3CDaemon and used IIS's FTP server. It worked out just fine.&lt;br /&gt;&lt;br /&gt;So if you are transferring a large file you should use FTP and not TFTP to avoid potential problems and I also recommend 3CDaemon as it's got TFTP Server, FTP Server, Syslog as well as TFTP client all in one package.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-1693764306379628691?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/1693764306379628691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=1693764306379628691' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1693764306379628691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1693764306379628691'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/cisco-tftp-flash-update.html' title='Cisco TFTP - Flash Update Problem'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2661022031344500150</id><published>2007-06-08T07:11:00.000-07:00</published><updated>2007-06-08T07:13:24.928-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Date Delimiter for Access and SQL Server</title><content type='html'>Microsoft's two most popular databases (MS Access &amp; MS SQL Server) implement date delimiter differntly.  This makes it hard to write queries that are compatible with both.&lt;br /&gt;&lt;br /&gt;What I normally do this in situation would be creating a flag to indicate which database is being used and use the appropriate delimiter as follow:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim bAccessInUse As Boolean&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim sSql As String&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Function DateOut(byVal TheDate as String) as String&lt;br /&gt;  If bAccessInUse Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;    Return "#" &amp; TheDate &amp;amp; "#"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;  Else    Return "'" &amp; TheDate &amp;amp; "'"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;  End If&lt;br /&gt;End Function&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;sSQL = "Select * From tablename Where date_col=" &amp;amp; DateOut(the_date)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;If you use this function throughout your code and set and the flag by checking the connection string, you should have no problem making it run against either database without any modification.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2661022031344500150?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2661022031344500150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2661022031344500150' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2661022031344500150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2661022031344500150'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/date-delimiter-for-access-and-sql.html' title='Date Delimiter for Access and SQL Server'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5982002247768458428</id><published>2007-06-08T03:26:00.000-07:00</published><updated>2007-06-08T07:14:27.621-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><title type='text'>Simple Way To Add Watermark</title><content type='html'>Here's a pretty simple way to add watermark to your image in VB6.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Private Sub Form_Load()&lt;br /&gt;Dim Message As String&lt;br /&gt;With Picture1&lt;br /&gt;.AutoRedraw = True&lt;br /&gt;With .Font&lt;br /&gt;.Name = "Arial"&lt;br /&gt;.Size = 18&lt;br /&gt;.Bold = True&lt;br /&gt;End With&lt;br /&gt;Message = "Hello World"&lt;br /&gt;.CurrentX = (.Width - .TextWidth(Message)) / 2&lt;br /&gt;.CurrentY = (.Height - .TextHeight(Message)) / 2&lt;br /&gt;End With&lt;br /&gt;Picture1.Print Message&lt;br /&gt;End Sub&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5982002247768458428?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5982002247768458428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5982002247768458428' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5982002247768458428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5982002247768458428'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/simple-water-mark.html' title='Simple Way To Add Watermark'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-7745662175392017675</id><published>2007-06-08T03:13:00.000-07:00</published><updated>2007-06-08T03:17:41.907-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='Files'/><category scheme='http://www.blogger.com/atom/ns#' term='Folders'/><title type='text'>File System Object</title><content type='html'>The FileSystemObject object library, which is part of the Microsoft Scripting Runtime library (Scrrun.dll) provides an object-oriented approach to directories &amp; files manipulation. For instance, system folder creation and deletion is one common task your code will need to perform. Naturally, before you attempt to either create or delete a folder, your procedure will want to determine if it exists. The FileSystemObject library provides the perfect solution.&lt;br /&gt;&lt;br /&gt;First, you'll need to set a project reference to the Scrrun.dll. The FileSystemObject is the top-level object within the file hierarchy, and you create an instance of it just like you would with any other object variable:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VB6&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Set oFSO = New Scripting.FileSystemObject&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;ASP&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Set oFSO = Server.CreateObject("Scripting.FileSystemObject")&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The FolderExists() method returns True if the folder exists and False if not. The CreateFolder() and DeleteFolder() methods create and delete folders respectively. All three of these methods require the full path to the folder in question. The following code shows how to use these methods (assuming you've set a reference to the Microsoft Scripting Runtime library):&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;If Not oFSO.FolderExists("C:\Test") Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Call oFSO.CreateFolder "C:\Test"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Call oFSO.DeleteFolder "C:\Test"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Set oFSO = Nothing&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-7745662175392017675?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/7745662175392017675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=7745662175392017675' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/7745662175392017675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/7745662175392017675'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/06/file-system-object.html' title='File System Object'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5298210541545773347</id><published>2007-05-30T21:12:00.003-07:00</published><updated>2007-08-13T12:55:57.585-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fun Stuff'/><title type='text'>Now for something different!</title><content type='html'>How are you protecting your PC?&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_bTDrD8248hs/Rl85fqsDUPI/AAAAAAAAAAU/C4I5ph3ukMc/s1600-h/virus.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5070834921640251634" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://bp2.blogger.com/_bTDrD8248hs/Rl85fqsDUPI/AAAAAAAAAAU/C4I5ph3ukMc/s320/virus.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5298210541545773347?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5298210541545773347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5298210541545773347' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5298210541545773347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5298210541545773347'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/coming-soon_30.html' title='Now for something different!'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_bTDrD8248hs/Rl85fqsDUPI/AAAAAAAAAAU/C4I5ph3ukMc/s72-c/virus.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-351399631084333290</id><published>2007-05-30T21:12:00.001-07:00</published><updated>2007-06-03T14:01:38.023-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Basic SQL Syntax Troubleshooting</title><content type='html'>Developing dynamic web and/or desktop applications often involve querying the database for the desired data. One of the problems new programmers often run into is troubleshooting SQL syntax.&lt;br /&gt;&lt;br /&gt;Here's a simple tip to help you troubleshoot your SQL syntax:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;1. Write the SQL statement out to screen&lt;br /&gt;2. Copy the SQL statement&lt;br /&gt;3. Open the Access database&lt;br /&gt;4. Create a new query&lt;br /&gt;5. View the query text&lt;br /&gt;6. Paste the SQL statement in the query window&lt;br /&gt;7. Try to run the SQL statement&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This should give you more info about the error you are running into.&lt;br /&gt;&lt;br /&gt;But I am using SQL Server instead of Access database...&lt;br /&gt;&lt;br /&gt;Don't worry, if you are running SQL Server or other databases, you can use Access and created linked tables to your database and take it from there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-351399631084333290?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/351399631084333290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=351399631084333290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/351399631084333290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/351399631084333290'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/coming-soon.html' title='Basic SQL Syntax Troubleshooting'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4128948693651148351</id><published>2007-05-30T20:37:00.001-07:00</published><updated>2007-05-31T15:20:03.930-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='OSPF'/><category scheme='http://www.blogger.com/atom/ns#' term='EIGRP'/><category scheme='http://www.blogger.com/atom/ns#' term='BGP'/><category scheme='http://www.blogger.com/atom/ns#' term='RIP'/><category scheme='http://www.blogger.com/atom/ns#' term='MPLS'/><category scheme='http://www.blogger.com/atom/ns#' term='IS-IS'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>OSPF - Wild Card Mask</title><content type='html'>Open Shortest Path First (OSPF) is an open standard, internal routing protocol, capable of supporting large network spanning multiple sites. Routers running OSPF are aware of their network topology; they get update of changes in the network through HELLO packets.&lt;br /&gt;&lt;br /&gt;Some of OSPF's strengths include:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;It converges quickly, compared to distance-vector protocol.&lt;br /&gt;Routing update packets are small, and only reflect the change (it doesn't send the whole routing table).&lt;br /&gt;It's not prone to routing loops.&lt;br /&gt;It scales very well for large networks.&lt;br /&gt;Bandwidth is taken into account when it selects a link to install in the routing table.&lt;br /&gt;It support Variable-Length Subnet Masks (VLSM)&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;While many people get confused by the Wild Card Mask that is required in the Network statement, I find it's not that difficult at all.&lt;br /&gt;&lt;br /&gt;Let's say you need to advertise the network 172.30.105.84 255.255.255.252 and wants to find the wild card mask. All you have to do is take 255 and subtract each octet of the subnet mask. So in this case you would advertise the network as:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Router(config)# router ospf {process number}&lt;br /&gt;Router(config-router)# network 172.30.105.84 0.0.0.3 area 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Where do you get the 0.0.0.3? Using the rule above, you take 255 - 255 = 0 (in the first 3 octets) and 255 - 252 = 3 (in the last octet). See, it's not that hard to find the wild card mask at all.&lt;br /&gt;&lt;br /&gt;Where do I get 255 from, you ask? Each octet is made up of 8 bits and 255 is the maximum value that 8 bits can hold.&lt;br /&gt;&lt;br /&gt;Here are some common OSPF commands that are very useful in checking the status of OSPF configuration:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;show ip ospf&lt;br /&gt;show ip ospf neighbor&lt;br /&gt;show ip ospf interface&lt;br /&gt;show ip route ospf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Further readings:&lt;br /&gt;&lt;a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hirp_r/rte_osph.htm#wp1001842"&gt;http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cr/hirp_r/rte_osph.htm#wp1001842&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Open_Shortest_Path_First"&gt;http://en.wikipedia.org/wiki/Open_Shortest_Path_First&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4128948693651148351?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4128948693651148351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4128948693651148351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4128948693651148351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4128948693651148351'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/ospf.html' title='OSPF - Wild Card Mask'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4751030745957836774</id><published>2007-05-30T20:36:00.000-07:00</published><updated>2007-06-07T11:46:50.775-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='ProCurve'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Updating IOS on ProCurve Switches</title><content type='html'>Updating IOS software on HP's ProCurve switches are pretty simple and straight forward.  All you need to do is run a TFTP server, log into the switch, add an IP to the switch, specified a default gateway so the switch can talk to the TFTP server and download the new IOS.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;SwitchA# vlan 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;SwitchA# ip address 192.168.1.9 255.255.255.0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;SwitchA# exit&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;SwitchA# ip default-gateway 192.168.1.1&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;SwitchA# copy tftp flash 192.168.1.8 filename.swi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note that when you do this the switch will download the new software and reboots itself when it's done processing the file.  If you need to update both primary and secondary flash then you should find out whether the switch boots from primary flash or secondary flash and copy the other one first.&lt;br /&gt;&lt;br /&gt;Let's say the switch boots from primary flash then the sequence of commands should be:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;SwitchA# copy tftp flash 192.168.1.8 filename.swi secondary&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;SwitchA# y&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;SwitchA# copy tftp flash 192.168.1.8 filename.swi &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;SwitchA# y&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will let you update the IOS on both primary and secondary flashes before the switch reboots itself and save you some time.  Plus you can script this and cut down the update time.  If you do it otherwise, the switch will update primary flash, reboot and then you have to manually update the secondary flash.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4751030745957836774?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4751030745957836774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4751030745957836774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4751030745957836774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4751030745957836774'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/mpls.html' title='Updating IOS on ProCurve Switches'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-6527195683846343809</id><published>2007-05-30T20:34:00.001-07:00</published><updated>2007-05-30T21:06:48.689-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='OSPF'/><category scheme='http://www.blogger.com/atom/ns#' term='EIGRP'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='BGP'/><category scheme='http://www.blogger.com/atom/ns#' term='RIP'/><category scheme='http://www.blogger.com/atom/ns#' term='MPLS'/><category scheme='http://www.blogger.com/atom/ns#' term='IS-IS'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Routing Information Protocol (RIP)</title><content type='html'>Routing Information Protocol (RIP) at one time was one of the most commonly used routing protocols on small, internal network. With the availability of other routing protocol such as IGRP, EIGRP, OSPF, IS-IS, BGP... plus the lack of support for large network the usage of RIP has been decreased and it is considered obsolete. For this reason, it's often referred to as "Rest In Peace" protocol.&lt;br /&gt;&lt;br /&gt;Nonetheless, Cisco and other networking vendors are still making RIP &amp; RIPv2 available today in their IOS models. I like RIP for the fact that it's very simple and easy to setup. You can get a small network running RIP up in just a few minutes. RIP is also a very good choice of protocol to get one familiarized with routing protocols.&lt;br /&gt;&lt;br /&gt;Besides its infamous Pros and Cons, one lesser known fact about RIP is that you can also use it to load balance your network. However, beware of the fact that RIP does not take bandwidth into consideration when it installs learned routes into the routing table.&lt;br /&gt;&lt;br /&gt;So let's say you have two ways to send a packet from A to B and the first path is going through a 128k line while the second goes through a T1 line; RIP will treat both paths equally as if they have the same bandwidth.&lt;br /&gt;&lt;br /&gt;Suggested Readings:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Routing_Information_Protocol"&gt;http://en.wikipedia.org/wiki/Routing_Information_Protocol&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/rip.htm"&gt;http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/rip.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-6527195683846343809?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/6527195683846343809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=6527195683846343809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6527195683846343809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6527195683846343809'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/rip.html' title='Routing Information Protocol (RIP)'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3724893762025952946</id><published>2007-05-30T20:25:00.000-07:00</published><updated>2007-05-30T20:36:18.609-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Dos'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Ping'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ICMP'/><title type='text'>Programmatically Ping A Networking Device</title><content type='html'>I would say Ping is one of the most popular software tool used to troubleshoot network issue. When a networking device or server goes down, one of the first things network engineers or system admininistrator do is try to ping it and see if it can be reached.&lt;br /&gt;&lt;br /&gt;This blog will show you two ways to ping a device so you can integrate the ping feature into your application.&lt;br /&gt;&lt;br /&gt;The first and easiest way to issue a ping command is to call the Ping method in the My.Computer.Network class:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;If my.Computer.Network.Ping("&lt;/span&gt;&lt;span style="color:#009900;"&gt;&lt;a href="http://www.google.com"&gt;www.google.com&lt;/a&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;") Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;MsgBox("device up")&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Else&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;MsgBox("device down")&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The drawback of this method is that it only gives you a boolean as the result to indicate whether the device is up or down.&lt;br /&gt;&lt;br /&gt;The second way is to call the Ping.Send() method in the System.Net.NetworkInformation namespace which returns a PingReply through which you could get more detailed information about the ping:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim myPing As New System.Net.NetworkInformation.Ping&lt;br /&gt;Dim PR As System.Net.NetworkInformation.PingReply&lt;br /&gt;PR = myPing.Send("&lt;a href="http://www.yahoo.com"&gt;www.yahoo.com&lt;/a&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;")&lt;br /&gt;If PR.Status = IPStatus.Success Then&lt;br /&gt;MsgBox("Reply from " &amp; PR.Address.ToString &amp;amp; ": BYTES=" &amp; PR.Buffer.Length &amp;amp; " TIME&amp;lt;" &amp; PR.RoundtripTime &amp;amp; "ms TTL=" &amp;amp; PR.Options.Ttl)&lt;br /&gt;Else&lt;br /&gt;MsgBox(PR.Status.ToString)&lt;br /&gt;End If&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;There you have it. Two ways of pinging a networking device. I recommend that you further study the PingReply object to get more information from the ping reply.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3724893762025952946?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3724893762025952946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3724893762025952946' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3724893762025952946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3724893762025952946'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/programmatically-ping-networking-device.html' title='Programmatically Ping A Networking Device'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-8507799342692120935</id><published>2007-05-30T15:52:00.000-07:00</published><updated>2007-05-30T16:00:28.943-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Text'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='System.IO'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><title type='text'>Parsing Text File</title><content type='html'>I often come across various postings in different forums asking for simple things like reading information from text file and parsing data from the text. Well, I get kind of tired of answering those question so I decided to write a blog about it and then point them to the blog. So here it is.&lt;br /&gt;&lt;br /&gt;Now the text file named C:\Test.txt I have two simple line:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Firstname: Brian&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;Lastname: Dao&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;and I want to grab "Brian" &amp; "Dao" out to use for some other purpose. The code is listed below:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim mySR As System.IO.StreamReader&lt;br /&gt;Dim myFirstName, myLastName, myTempStr As String&lt;br /&gt;mySR = System.IO.File.OpenText("C:\Test.txt")&lt;br /&gt;If Not mySR.EndOfStream Then&lt;br /&gt;myTempStr = mySR.ReadLine&lt;br /&gt;myFirstName = Mid(myTempStr, InStr(myTempStr, "Firstname:", CompareMethod.Text) + 10)&lt;br /&gt;myTempStr = mySR.ReadLine myLastName = Mid(myTempStr, InStr(myTempStr, "Lastname:", CompareMethod.Text) + 9)&lt;br /&gt;End If&lt;br /&gt;txtOutput.Text = myFirstName &amp;amp; vbCrLf &amp; myLastName&lt;br /&gt;mySR.Close()mySR = Nothing&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Note that this doesn't take care of the leading space which could be trimmed by:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;myTempStr.Trim&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;myTempStr = Trim(myTemStr)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Another way of accomplishing the same thing would be to call the Replace method and pass in the required parameters. The code sample below show two different ways you can call the Replace medhod.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;myFirstName = Replace(myTempStr, "FirstName:", "", , , CompareMethod.Text)&lt;br /&gt;myFirstName = myTempStr.Replace("FirstName:", "")&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;For those who are new to all this, be sure to look up the following string processing methods: InStr, InStrRev, Replace, Mid.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-8507799342692120935?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/8507799342692120935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=8507799342692120935' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8507799342692120935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8507799342692120935'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/parsing-text-file.html' title='Parsing Text File'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3260341202789068191</id><published>2007-05-30T08:56:00.000-07:00</published><updated>2007-05-30T09:08:18.392-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='System.XML'/><title type='text'>Adding Attributes To An Existing XML Document</title><content type='html'>In the previous blog, I've demonstrated how to &lt;a href="http://brian-dao.blogspot.com/2007/05/adding-nodes-using-innertext-property.html"&gt;add a node or an XML element to an existing document&lt;/a&gt;. In this blog, I'll introduce two ways to add an attribute to an existing node.&lt;br /&gt;&lt;br /&gt;The first way we will use the SetAttributeNode method of the DocumentElement object to add an XMLAttribute as seen below:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim objDocument As New XmlDocument&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objDocument.LoadXml("&amp;lt;Cars&amp;gt;&amp;lt;Make&amp;gt;Toyota&amp;lt;/Make&amp;gt;&amp;lt;/Cars&amp;gt;")&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim objAttribute1 As XmlAttribute&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objAttribute1 = objDocument.CreateAttribute("Type")&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objAttribute1.InnerText = "Foreign"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objDocument.DocumentElement.SetAttributeNode(objAttribute1)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The second way is to add an attribute is to call the Append method of the Attributes collection class:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim objAttribute2 as XmlAttribute&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objAttribute2 = objDocument.CreateAttribute("Body")&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objAttribute2.Value = "Sedan"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objDocument.DocumentElement.FirstChild.Attributes.Append(objAttribute2)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and finally we can show the output to the textbox with the statement:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;txtOutput.Text = objDocument.InnerXml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the end, if you run these two code blocks together, your output should look something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;Cars Type="Foreign"&amp;gt;&amp;lt;Make Body="Sedan"&amp;gt;Toyota&amp;lt;/Make&amp;gt;&amp;lt;/Cars&amp;gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3260341202789068191?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3260341202789068191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3260341202789068191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3260341202789068191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3260341202789068191'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/adding-attributes-to-existing-xml.html' title='Adding Attributes To An Existing XML Document'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3176728034841324776</id><published>2007-05-29T13:25:00.000-07:00</published><updated>2007-05-29T13:43:25.111-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='System.XML'/><title type='text'>Adding Nodes using InnerText Property and CreateTextNode Method</title><content type='html'>In this blog, I'll discuss two simple ways of adding a node to an existing XML document.&lt;br /&gt;&lt;br /&gt;Before we do anything, we will need to declare an XMLDocument and call the LoadXML method which takes an XML string as the parameter to populate the document&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim objDocument As New System.Xml.XmlDocument&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objDocument.LoadXML("&amp;lt;Cars&amp;gt;&amp;lt;/Cars")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Doing this, we will obtain a document with the root node as Cars and no child element.&lt;br /&gt;&lt;br /&gt;In the first method, we will create the element using the CreateElement method, then create an XMLText object and set the value using CreateTextNode method, add the text object to the XML element before adding it to the document as follow:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim objElement As System.Xml.XmlElement&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim objText As System.Xml.XmlText&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objElement = objDocument.CreateElement("Make")&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objText = objDocument.CreateTextNode("Honda")&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objElement.AppendChild(objText)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objDocument.DocumentElement.AppendChild(objElement)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;'these last too lines produce the same result as the previous two&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;'objDocument.DocumentElement.AppendChild(objElement)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;'objDocument.DocumentElement.LastChild.AppendChild(objText)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The second method is much simpler. We create an element using the CreateElement method of the XMLElement object, set its value in the InnerText property and add it to the document using AppendChild method:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim objElement As System.Xml.XmlElement&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objElement = objDocument.CreateElement("Make")&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objElement.InnerText = "Toyota"&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;objDocument.DocumentElement.AppendChild(objElement)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There you have two ways of adding a new element to an existing XML document. I prefer the second method as it is much simpler, less coding and easier to understand.&lt;br /&gt;&lt;br /&gt;TIPS: You can quickly show the content of the XML document by sending its content to a textbox using the following statement:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;txtOutput.Text = objDocument.InnerXml&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3176728034841324776?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3176728034841324776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3176728034841324776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3176728034841324776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3176728034841324776'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/adding-nodes-using-innertext-property.html' title='Adding Nodes using InnerText Property and CreateTextNode Method'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5800587410239738029</id><published>2007-05-29T08:45:00.000-07:00</published><updated>2007-05-29T08:56:32.717-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='CSharp'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='System.XML'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Introduction to XML</title><content type='html'>For those of you just starting out with XML, I highly recommend that you check out the video tutorial(s) below:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VB&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/vstudio/express/beginner/windows/tier3/begin10/vb/"&gt;Working with XML &amp; VB.net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C# &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/vstudio/express/beginner/windows/tier3/begin10/cs/"&gt;Working with XML &amp;amp; C#&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5800587410239738029?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5800587410239738029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5800587410239738029' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5800587410239738029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5800587410239738029'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/introduction-to-xml.html' title='Introduction to XML'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5127566786586150517</id><published>2007-05-25T14:07:00.000-07:00</published><updated>2007-05-31T14:05:57.604-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='JScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Optimize Your Website For Performance</title><content type='html'>Performance can affect the number of visitors come to your site. The faster the site load, the better experience the visitors will get and the chances of them coming back will also be higher.&lt;br /&gt;&lt;br /&gt;Network latency, congestion, packet drops... are already reducing your application performance. If you, the developer, can do anything to speed up content delivery, by all means, you should do it.&lt;br /&gt;&lt;br /&gt;Unfortunately, most developers often neglect to pay attention to this are since it's not something they can really visually see and fix because there is no error that will popup and say "Hey, I am slow... fix me..." or something like that.&lt;br /&gt;&lt;br /&gt;Here are a few tips that any developer can use to help speed up their web pages:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Put CSS code at the top of the page: if you put CSS at the top of the page, the browser will read it first. When the browser renders a web page, it doesn't have to search up and down looking for the style rules.&lt;br /&gt;&lt;br /&gt;Move JavaScript code down to the bottom of the page: JavaScript’s are mostly run on the client side AFTER the page has been rendered. Moving them to the bottom of the page will allow the browser to render other markup tags first and present the UI to the client faster.&lt;br /&gt;&lt;br /&gt;Compress java scripts &amp; remove white space: The browser doesn't care if you name your function with a single character nor does it care if the name is 50 characters as long as they are valid. White spaces might make your code look good but will not help when it comes to speed. The less data your server has to spit out the faster your page will be delivered over the wire.&lt;br /&gt;&lt;br /&gt;Remove duplicate and/or unused scripts: If it's not being used, remove it. If anything, it will cause more load on your network and create more confusion having it there when it comes time to troubleshoot some problems.&lt;br /&gt;&lt;br /&gt;Do not mix Javascripts and HTML markups: Sometimes, you will need to use Javascripts to produce HTML markups. But try to reduce this to a minimum and let the browser finish one thing before it starts the next one (ie: complete HTML render before executing javascript...)&lt;br /&gt;&lt;br /&gt;Move CSS &amp;amp; Javascripts out of HTML markups: Don't make the browser go back and forth between HTML markups and javascripts when it renders the page as there is a performance cost to this.&lt;br /&gt;&lt;br /&gt;Add expires header: The browser save the pages onto the hard disk so that it can load the same site faster next time around. If there isn't a need for this, add expires header to it doesn't write the pages to disk.&lt;br /&gt;&lt;br /&gt;Disable viewstates: ASP.net pages have viewstate enabled by default which adds a bunch of encrypted code to the page. If viewstate is not required, disable it and it will improve the page performance.&lt;br /&gt;&lt;/blockquote&gt;These tips will not significantly improve the performance of your web site as that will also depend upon how you compose your application but it will definitely improve the delivery of the page to the visitors.  This is especially true if you have high traffic on your site.&lt;br /&gt;&lt;br /&gt;If you get the opportunity, you should examine the HTML output for well known sites like Yahoo or Google and see how they optimize their site for performance. Chances are you will see these tips in action.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5127566786586150517?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5127566786586150517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5127566786586150517' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5127566786586150517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5127566786586150517'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/optimize-your-website-for-performance.html' title='Optimize Your Website For Performance'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-7137792816212555295</id><published>2007-05-24T13:39:00.001-07:00</published><updated>2007-05-24T13:43:20.282-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Dos'/><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Attack'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='ICMP'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco'/><title type='text'>Smurf Attack</title><content type='html'>A smurf attack is a Denial of Service (DoS) attacked that uses spoofed broadcast ping messages to flood the target system with ping replies. The attack method gets its name after its exploit program.&lt;br /&gt;&lt;br /&gt;In this attack, an attacker sends out a large number of ICMP Echo Request packets to IP broadcast addresses with all requests having a spoofed source address of the intended victim. Once the routing device receives this type of request, it will broadcast it to all hosts on its network. When the hosts reply, they will overwhelm the targeted's network with so much traffic that it will effectively shut out the network from the rest of the world.&lt;br /&gt;&lt;br /&gt;Using a Cisco router, one can issue the command:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;no ip directed-broadcast&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;to secure their network from this type of attack.&lt;br /&gt;&lt;br /&gt;Note that this does not prevent a network from becoming the target of a smurf attack; it just prevent the network from taking part in an attack agains other networks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-7137792816212555295?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/7137792816212555295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=7137792816212555295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/7137792816212555295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/7137792816212555295'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/smurf-attack.html' title='Smurf Attack'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-1135842053330039345</id><published>2007-05-24T13:16:00.000-07:00</published><updated>2007-05-24T13:42:23.622-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Dos'/><category scheme='http://www.blogger.com/atom/ns#' term='Ping'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Attack'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='ICMP'/><title type='text'>Ping Flood Attack</title><content type='html'>A ping flood is a simple Denial of Service (DoS) attack where the attacker sends a massive number of ICMP Echo Request (ping) packets to the victim in hope of overwhelming the victim and consuming both outgoing and incoming bandwidth on the victim's network. An effective attack could render the victim's network useless.&lt;br /&gt;&lt;br /&gt;This type of attack only succeeds if the attacker has more available bandwidth than the victim (like a T3 versus and DSL line) which is very unlikely. To get around this, the attacker normally use an army of computers (a network of computers that attacker has control called zombies or bots) numbered in the hundreds or thousands to attack the victim with their combined bandwidth power.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#009900;"&gt;Defense Your Network&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To reduce the effects of ping flood attack, one can use a firewall to inspect the traffic and filter ICMP Echo Request packets. However, doing this can also have its side effects such that it prevents legistimate users from pinging their hosts. For this reason, we can use firewall to authorize ICMP Echo Request packets from legistimate source only.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-1135842053330039345?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/1135842053330039345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=1135842053330039345' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1135842053330039345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1135842053330039345'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/ping-flood-attack.html' title='Ping Flood Attack'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4332940028702027164</id><published>2007-05-24T12:03:00.000-07:00</published><updated>2007-05-24T12:10:31.774-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Text'/><category scheme='http://www.blogger.com/atom/ns#' term='ComboBox'/><category scheme='http://www.blogger.com/atom/ns#' term='System.IO'/><category scheme='http://www.blogger.com/atom/ns#' term='CSharp'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Reading Text File Into Combo Box</title><content type='html'>In the previous blog (&lt;a href="http://brian-dao.blogspot.com/2007/05/reading-text-file-using-streamreader.html"&gt;Reading Text File Using StreamReader Class&lt;/a&gt;), I demonstrated the use of StreadReader class to read text file. The System.IO.File class also provide us with a couple of ways to read text file as well.&lt;br /&gt;&lt;br /&gt;We will use it's capability in this blog to read the data from text file and load it directly into a combo box.&lt;br /&gt;&lt;br /&gt;Code sample:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;string[] theStates;&lt;br /&gt;theStates=System.IO.File.ReadAllLines(txtFilename.Text);&lt;br /&gt;cboStates.Items.AddRange(theStates); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A sample application is available &lt;a href="http://www.geocities.com/ld762/ComboBox-TextFile.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;img alt="Load text file into combobox" src="http://www.geocities.com/ld762/ComboBox-TextFile.gif" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4332940028702027164?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4332940028702027164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4332940028702027164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4332940028702027164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4332940028702027164'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/reading-text-file-into-combo-box.html' title='Reading Text File Into Combo Box'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4768415564744792405</id><published>2007-05-24T09:08:00.000-07:00</published><updated>2007-05-24T11:20:19.059-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Text'/><category scheme='http://www.blogger.com/atom/ns#' term='System.IO'/><category scheme='http://www.blogger.com/atom/ns#' term='CSharp'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Reading Text File Using StreamReader Class</title><content type='html'>The namespace System.IO has a class called StreamReader which can be used for reading text files.&lt;br /&gt;&lt;br /&gt;The StreamReader class provides us with a couple of methods and a property as listed below:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Close: Closes the StreamReader object and the underlying stream, and releases any system resources associated with the reader.&lt;br /&gt;&lt;br /&gt;Peek: Returns the next available character but does not consume it.&lt;br /&gt;&lt;br /&gt;Read: Reads the next character or next set of characters from the input stream.&lt;br /&gt;&lt;br /&gt;ReadLine: Reads a line of characters from the current stream and returns the data as a string.&lt;br /&gt;&lt;br /&gt;ReadToEnd: Reads the stream from the current position to the end of the stream.&lt;/blockquote&gt;&lt;br /&gt;To read a text file, we need to open it using System.IO.File.OpenText method which returns a StreamReader object. Once we obtain the StreamReader object, just call the appropriate method to pull the data.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C#&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;System.IO.StreamReader oSR;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;oSR = System.IO.File.OpenText(sFilename);&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;txtOutput.Text = oSR.ReadToEnd();&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VB&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim oSR As System.IO.StreamReader&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;oSR = System.IO.File.OpenText(sFileName)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;txtOutput.Text = oSR.ReadToEnd()&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For further reading, please visit the this &lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.streamreader_methods.aspx"&gt;link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Sample applications can be downloaded here: &lt;a href="http://www.geocities.com/ld762/TextFile-VB.zip"&gt;VB.net&lt;/a&gt; or &lt;a href="http://www.geocities.com/ld762/TextFile-CSharp.zip"&gt;C#&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4768415564744792405?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4768415564744792405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4768415564744792405' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4768415564744792405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4768415564744792405'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/reading-text-file-using-streamreader.html' title='Reading Text File Using StreamReader Class'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-8532240347835517817</id><published>2007-05-21T12:54:00.000-07:00</published><updated>2007-05-21T12:57:48.375-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>ViewState and Postback</title><content type='html'>I see a lot of people having problem preserving the controls's state when they perform postback. Most of these due to the fact they that don't quite understand how the form is processed on postback as seen in the following questions:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.vbdotnetforums.com/showthread.php?t=18985"&gt;http://www.vbdotnetforums.com/showthread.php?t=18985&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.vbdotnetforums.com/showthread.php?t=19534"&gt;http://www.vbdotnetforums.com/showthread.php?t=19534&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Have a look at this code snippet:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;&lt;br /&gt;If Not IsPostBack Then&lt;br /&gt;&lt;br /&gt;....&lt;br /&gt;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;LoadComboBoxes()&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;IsPostBack will yield a True value if the page was posted back. You can use this to see whether this is the page load or refresh versus a post back and take appropriate action.&lt;br /&gt;&lt;br /&gt;Let's say in the method LoadComboBoxes() you query the data from SQL and load that into the combo boxes. If you don't check for postback using IsPostBack, one of two things will happen:&lt;br /&gt;&lt;br /&gt;1. If data binding is used on the controls or the Clear() method is called, all the state information gets wiped out and the controls will not retain their values.&lt;br /&gt;&lt;br /&gt;2. If the Clear() method is not called then the combo boxes might have duplicate items added everytime you do a post back.&lt;br /&gt;&lt;br /&gt;The recommended way for doing this is to move LoadComboBoxes inside the If statement that way it gets called once and also preserves postback data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-8532240347835517817?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/8532240347835517817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=8532240347835517817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8532240347835517817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/8532240347835517817'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/viewstate-and-postback.html' title='ViewState and Postback'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5480136734896281679</id><published>2007-05-20T21:00:00.000-07:00</published><updated>2007-05-20T21:03:44.294-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><title type='text'>Access IIS application from computers on the same network</title><content type='html'>A user was having problem accessing his website on the network. The site is working fine from the local machine. However, when he tries to access the same site from a computer on the network, it's not working.&lt;br /&gt;&lt;br /&gt;The problem and attempted answers can be viewed in this &lt;a target=new href="http://www.vbdotnetforums.com/showthread.php?p=43460#post43460"&gt;post&lt;/a&gt;.   You should read the posts in that forum before continuing on this blog so things would make sense when you read the paragraphs below.&lt;br /&gt;&lt;br /&gt;Let's logically work through the posts and try to sort out the problems:&lt;br /&gt;&lt;br /&gt;1. Setting up a new website, IP address and port number is not necessary as the original site already working on the machine IIS is running from. Since all the computers are on the same network, you should be able to access it by computer name as well.&lt;br /&gt;&lt;br /&gt;2. On Win XP, you can actually host more than one sites and running more than one IP on the same computer. But this won't be discussed in this blog. On top of that, it's not even relevant to the problem we are trying to solve.&lt;br /&gt;&lt;br /&gt;3. This shouldn't be security issue also since IIS applications typically run on anonymous account by default and permission is granted when the site is set up; unless you specifically make change to it.&lt;br /&gt;&lt;br /&gt;The true answer to this lies in Windows XP Pro SP2's built-in Firewall. Open port 80 in Windows Firewall to allow web traffic should solve this issue. If there are other software firewall running, check and open port 80 as well.&lt;br /&gt;&lt;br /&gt;Brian Dao&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5480136734896281679?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5480136734896281679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5480136734896281679' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5480136734896281679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5480136734896281679'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/access-iis-application-from-computers.html' title='Access IIS application from computers on the same network'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2239064498627810729</id><published>2007-05-20T10:19:00.000-07:00</published><updated>2008-04-21T10:55:07.024-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Short Circuit'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='CSharp'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Short Circuit Evaluation</title><content type='html'>What is Short Circuit? In the simplest terms, Short Circuit is a control structure put in place to allow the control of the program to be passed onto a different set of instructions while minimizing the evaluation of the code. It operates on booleans or boolean expressions in which the second boolean or boolean expression is only evaluated if the first one does not suffice to determine the value of the entire expression.&lt;br /&gt;&lt;br /&gt;Consider the following example:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;bool hasMoney = false;&lt;br /&gt;double totalMoney = 0;&lt;br /&gt;if (hasMoney &amp;amp;&amp;amp; totalMoney &gt; 5)&lt;br /&gt;{&lt;br /&gt;MessageBox.Show("Buy burger.");&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;If we have no money (hasMoney=false) then there is no need to check and see if the amount of money we have is greater than 5 bucks so the boolean expression on the right hand side of boolean operator "&amp;amp;&amp;amp;" will not be evaluated in this case.&lt;br /&gt;&lt;br /&gt;You can really appreciate short circuiting in the following example:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;bool hasMoney = false;&lt;br /&gt;double totalMoney = 0;&lt;br /&gt;if (hasMoney &amp;amp;&amp;amp; checkTotalMoney())&lt;br /&gt;{&lt;br /&gt;MessageBox.Show("Buy burger.");&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As you can see, this is just a simple example to demonstrate how short circuit evaluation works but what if in the method checkTotalMoney() you have some lengthy code that goes on to evaluate if you have enough money to pay for the burger and the taxes as well?&lt;br /&gt;&lt;br /&gt;Things just get a little bit more complicated and you can see all of that work is skipped if the boolean expression on the left of the operation becomes false. This is important to consider because if you have checkTotalMoney() on the left, the method will be evaluated to determine its value before it can move on to the second expression on the right hand side.&lt;br /&gt;&lt;br /&gt;Knowing how short circuit evaluation works and carefully design expressions that use conditional logical operators you can greatly improve your code and boost the performance of your applications by avoiding unnecessary work. You can read more about short-circuit evaluation &lt;a href="http://en.wikipedia.org/wiki/Minimal_evaluation"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2239064498627810729?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2239064498627810729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2239064498627810729' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2239064498627810729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2239064498627810729'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/short-circuit-evaluation.html' title='Short Circuit Evaluation'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3732591653298589054</id><published>2007-05-18T13:07:00.000-07:00</published><updated>2007-05-18T13:48:48.776-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Decimal'/><category scheme='http://www.blogger.com/atom/ns#' term='Converter'/><category scheme='http://www.blogger.com/atom/ns#' term='CSharp'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Binary'/><title type='text'>Converting from Decimal to binary and back</title><content type='html'>This project was written in C# to demonstrate how to convert data from Decimal to Binary and from Binary back to Decimal number.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.geocities.com/ld762/SimpleBinaryConverter.bmp" alt="Simple Binary Converter"&gt;&lt;br /&gt;&lt;br /&gt;There are a number of ways to convert Decimal to Binary. Here, I used a small function to basically loop through and use division by 2 to convert the decimal number to binary format. Here's the code for the function:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;private static string Dec2Bin(Int64 nDecimal)&lt;br /&gt;{&lt;br /&gt;Int64 nBinaryDigit;&lt;br /&gt;string sBinaryNumber = "";&lt;br /&gt;while (nDecimal &gt; 0)&lt;br /&gt;{&lt;br /&gt;nBinaryDigit = nDecimal % 2;&lt;br /&gt;sBinaryNumber = nBinaryDigit + sBinaryNumber;&lt;br /&gt;nDecimal = nDecimal / 2;&lt;br /&gt;}&lt;br /&gt;return sBinaryNumber;&lt;br /&gt;} &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To convert Binary number back to Decimal, we can use the built-in function called Convert as seen in the code snippet below:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;txtToDecimal.Text = Convert.ToInt64(txtFromBinary.Text, 2).ToString(); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can download the C# project sample &lt;a href="http://www.geocities.com/ld762/SimpleBinaryConverter.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3732591653298589054?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3732591653298589054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3732591653298589054' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3732591653298589054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3732591653298589054'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/converting-from-decimal-to-binary-and.html' title='Converting from Decimal to binary and back'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-9005226717448771151</id><published>2007-05-17T12:46:00.000-07:00</published><updated>2007-05-18T13:52:09.092-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Remote Desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='RDP'/><title type='text'>More on Remote Desktop</title><content type='html'>You can make your HDs available on the RDPed target by going to Options - Local Resources - check Disk Drives option. This will allows you to copy files between your machine and the RDPed machine.&lt;br /&gt;&lt;br /&gt;Windows XP SP2 &amp;amp; Windows Server 2003 SP1 has Firewall built in. This will block RDP traffic and on Remote Desktop is disabled by default. When troubleshoot RDP look in these areas first.&lt;br /&gt;&lt;br /&gt;RDP runs on port 3389 by default. Most companies deploy firewall to protect their servers. In order to RDP to them, you would need to open traffic on this port (or which ever you choose to run RDP on) to the servers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-9005226717448771151?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/9005226717448771151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=9005226717448771151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/9005226717448771151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/9005226717448771151'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/more-on-remote-desktop.html' title='More on Remote Desktop'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2720913753112989777</id><published>2007-05-17T12:32:00.000-07:00</published><updated>2007-05-18T13:53:00.732-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Remote Desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='RDP'/><title type='text'>Remote Desktop and then some</title><content type='html'>By default, RDP only allows you to have 2 people login remotely at the same time to work on the server (with Remote Desktop for Administration setting). You can also have another person logon at the console so that makes 3 people can work on the server at the same time.&lt;br /&gt;&lt;br /&gt;Here's a little known tip: You can emulate the console login so you don't have to be right in front of the console to login as the 3rd person and have 3 people RDPing at the same time.&lt;br /&gt;&lt;br /&gt;To emulate console login, use the following Command line syntax:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;mstsc /v:servernameorip /console&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;You can also shorten /console to /c to save some typing.&lt;br /&gt;&lt;br /&gt;If you have to RDP into your servers, it's a good security practice to always try to VPN in and then RDP to the machines if you can. Otherwise, if firewall or router permits, then only allows RPD from known location (your office, your home IPs...). And as the last resort, open RDP port for access from any where.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2720913753112989777?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2720913753112989777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2720913753112989777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2720913753112989777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2720913753112989777'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/remote-desktop-and-then-some.html' title='Remote Desktop and then some'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-5623163118960619770</id><published>2007-05-17T11:52:00.000-07:00</published><updated>2007-05-18T13:53:45.089-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Centering content on a web page</title><content type='html'>This is a very simple technique but if you take advantage of it, you could create very attractive web pages with it.&lt;br /&gt;&lt;br /&gt;What you need to do is to create a table to wrap the content of your webpage in and set both the width and height properties of the table to "100%". For the horizontal alignment property of the cell, make it "center". You should also set the vertical property to "middle". By default, the browser will set this value to "middle" but it wouldn't hurt to explicitly set it yourself. If anything at all it would only make the code clearer and easier to understand.&lt;br /&gt;&lt;br /&gt;Here's the sample code:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;table border="0" width="100%" height="100%"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td align="center" valign="middle"&amp;gt;&lt;br /&gt;Your content goes here.&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With this code in place, when you resize the browser, the table size will be updated and the content will be re-render to center it within the page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-5623163118960619770?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/5623163118960619770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=5623163118960619770' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5623163118960619770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/5623163118960619770'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/centering-content-on-web-page.html' title='Centering content on a web page'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-3104617946908133312</id><published>2007-05-16T12:17:00.000-07:00</published><updated>2007-05-18T13:51:15.499-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Master Page'/><category scheme='http://www.blogger.com/atom/ns#' term='CSharp'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Using Master Pages in ASP.net Web Applications</title><content type='html'>Master page helps you to create a consistent look and feel to your site while minimizing the amount of work you have to do. With the introduction ASP.net 2.0 Master Pages, you no longer have to use server side includes to keep the site consistent among different pages. To be able to use and apply master page to your site you first need to create a master page:&lt;br /&gt;&lt;br /&gt;1. Right click on the Project&lt;br /&gt;2. Click Add New Item&lt;br /&gt;3. Change the filename as appropriate then click OK to accept&lt;br /&gt;4. Design the layout of the page as you wish and save it&lt;br /&gt;&lt;br /&gt;Note that the design in the master page will be applied to all pages that use it except for the content part.&lt;br /&gt;&lt;br /&gt;Now that we have a master page, we can start using it. Let's create a web page that would use the master page.&lt;br /&gt;&lt;br /&gt;1. Right click on the Project&lt;br /&gt;2. Click Add New Item&lt;br /&gt;3. Select Web Form&lt;br /&gt;4. Check the box called Select Master Page&lt;br /&gt;5. Select the master page you just created and hit OK.&lt;br /&gt;&lt;br /&gt;At this point, the code window will open up for you to edit. The new web page doesn't look like a typical web form but instead it will look something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %&amp;gt;&amp;lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;your code goes here&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;your code goes here&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;/asp:Content&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When you run the application and/or browsing to the web form, IIS will merge both the master page and the web form to produce the finale code and send it to the browser.&lt;br /&gt;&lt;br /&gt;Now that you know how to use master page, you might want to take a look at this blog to learn &lt;a href="http://brian-dao.blogspot.com/2007/05/dynamically-changing-master-page-on.html"&gt;how to dynamically change master page at run time&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-3104617946908133312?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/3104617946908133312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=3104617946908133312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3104617946908133312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/3104617946908133312'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/using-master-pages-in-aspnet-web.html' title='Using Master Pages in ASP.net Web Applications'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-6080320810147753928</id><published>2007-05-16T11:24:00.000-07:00</published><updated>2007-05-18T13:54:43.736-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Master Page'/><category scheme='http://www.blogger.com/atom/ns#' term='CSharp'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Dynamically changing master page on your website</title><content type='html'>If you notice, you will see that a lot of blog sites out there allow you to create and use different site template. With a click of a button, you can completely change the look and feel of the entire site; including the theme, layout, navigation...&lt;br /&gt;&lt;br /&gt;While this can certainly be done using classic ASP, ASP.net master pages have made it extremely easy to set this up. All you have to do is define a couple of master pages before and change MasterPageFile property at run time.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit&lt;br /&gt;Page.MasterPageFile = "NewMasterPage.master"&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;In this code snippet, I just assign a new master page to the MasterPageFile property of the Page object during the preinit stage and the site gets a new look.&lt;br /&gt;&lt;br /&gt;If you are new to master pages, please have a look at this blog: &lt;a href="http://brian-dao.blogspot.com/2007/05/using-master-pages-in-aspnet-web.html"&gt;Using Master Pages in ASP.net Applications&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-6080320810147753928?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/6080320810147753928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=6080320810147753928' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6080320810147753928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/6080320810147753928'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/dynamically-changing-master-page-on.html' title='Dynamically changing master page on your website'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4082511189033727650</id><published>2007-05-13T21:09:00.000-07:00</published><updated>2007-05-18T13:55:26.001-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Create View Source Link</title><content type='html'>This blog will show you how to create a hyperlink on a Web page that displays the source code for the current page or another page when the hyperlink is clicked.&lt;br /&gt;&lt;br /&gt;The normal Anchor tag when associate with the HREF parameter will cause the browser to pull the URL and display the page when the anchor link is clicked on. However, if you add the "view-source" prefix in front of the link, it will cause the browser to display the HTML source for the page instead of the rendered page itself.&lt;br /&gt;&lt;br /&gt;Being able to display the source code of a web page is extremely valuable especially if you want to be able to show your site visitors how to do certain things or teach beginners how to compose HTML documents.&lt;br /&gt;&lt;br /&gt;Keep in mind that "view-source" works only on absolute links. Also, if you are trying to access an HTML file through the FILE protocol, you must fully qualify the URL which means you have to include the full path to the file.&lt;br /&gt;&lt;br /&gt;Here's the source code to create view source link:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;a href="view-source:http://yoursite.com/FileName.htm"&amp;gt;Source Code&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4082511189033727650?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4082511189033727650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4082511189033727650' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4082511189033727650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4082511189033727650'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/create-view-source-link.html' title='Create View Source Link'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2966741204083927926</id><published>2007-05-13T21:03:00.000-07:00</published><updated>2007-05-18T13:56:05.778-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Adding Your Logo to a Bookmark</title><content type='html'>Ever wonder how you could add your logo or icon to your website's URL so that when people bookmark it, they will see the logo along with the URL itself?&lt;br /&gt;&lt;br /&gt;It's actually pretty simple to do this. What you need is a 16x16 icon in 16 colors and make a link to it in your webpage.&lt;br /&gt;&lt;br /&gt;Here's the sample code for it:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;HEAD&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;LINK REL="SHORTCUT ICON" HREF="&lt;/span&gt;&lt;a href="http://www.yoursite.com/favicon.ico"&gt;&lt;span style="color:#009900;"&gt;http://www.yoursite.com/favicon.ico&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#009900;"&gt;"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;/HEAD&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.yoursite.com/"&gt;http://www.yoursite.com/&lt;/a&gt; is the URL to your website and favicon.ico is the name of your icon. You could, of course, use a different name if you want. But keep in mind that even though this might looks good, it is an Internet Explorer specific feature so it won't work on other browsers (or at least at the time this was written)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2966741204083927926?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2966741204083927926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2966741204083927926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2966741204083927926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2966741204083927926'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/adding-your-logo-to-bookmark.html' title='Adding Your Logo to a Bookmark'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-565847636943064764</id><published>2007-05-12T17:50:00.000-07:00</published><updated>2007-05-18T13:57:16.666-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Add Multithreading to your VB.NET Applications</title><content type='html'>VB.NET natively supports free threaded applications. In plain English, this means you can split up your application into multiple threads so that it can do different things at the same time.&lt;br /&gt;&lt;br /&gt;There are many situations in which spawning a new thread to run in the background will make your application more responsive and increase its usability. Consider the following example:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Public Class Form1&lt;br /&gt;Private sMessage As String &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;CountUp()&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;MsgBox(sMessage)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Private Sub CountUp()&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim I As Integer&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;For I = 1 To 10&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;sMessage = "Iteration #: " &amp;amp; I&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;System.Threading.Thread.Sleep(2000)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;End Class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In this simple example, we are just counting from 1 to 10. Note that when each counter is increamented the computer would wait 2 seconds before process the next instruction. So when the routine &lt;strong&gt;CountUp&lt;/strong&gt; is invoked, it would run for approximately 20 seconds. During that time, your application can't do anything else thus you can't click on Button1 to see the message.&lt;br /&gt;&lt;br /&gt;To execute code in a thread, we need to use the Thread object that is a part of the &lt;strong&gt;System.Threading&lt;/strong&gt; namespace in the .NET framework classes. The first thing we need to do is to instantiate a new Thread object and pass to it the address of the code block we want to run under the thread and then invoke the Start method.&lt;br /&gt;&lt;br /&gt;The example above could be modified as below:&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Dim myThread As System.Threading.Thread&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;myThread = New System.Threading.Thread(AddressOf CountUp)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;myThread.Start()&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now when you run the application again, it will be more responsive and if you keep clicking on Button1, you will see the message changes as the application runs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-565847636943064764?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/565847636943064764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=565847636943064764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/565847636943064764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/565847636943064764'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/vb.html' title='Add Multithreading to your VB.NET Applications'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-9005141702356880494</id><published>2007-05-12T10:52:00.000-07:00</published><updated>2007-05-18T13:57:35.133-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Redirect user to another pager after x seconds using Meta tag</title><content type='html'>In this blog you will learn how to redirect the users to another page/site after a number of seconds using meta tag.&lt;br /&gt;&lt;br /&gt;Sometimes to be able to redirect your site visitors to another page automatically will come in handy, especially when you want to inform them that your site has been "moved" to a different URL so they can update their bookmarks.&lt;br /&gt;&lt;br /&gt;To redirect the visitors to another page after a specified number of seconds, all you have to do is add the meta tag &lt;strong&gt;&amp;lt;META HTTP-EQUIV=" REFRESH" CONTENT="xxx; URL=newpage.htm"&amp;gt;&lt;/strong&gt; to the header section of your page where xxx is the number of seconds to delay and newpage.htm is the URL of the page you want the visitors to go to.&lt;br /&gt;&lt;br /&gt;Here's the code for it:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&lt;span style="color:#009900;"&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;META HTTP-EQUIV="REFRESH" CONTENT="3; URL=newpage.htm"&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;In this example, the browser will send the user to newpage.htm after 3 seconds.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-9005141702356880494?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/9005141702356880494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=9005141702356880494' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/9005141702356880494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/9005141702356880494'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/redirect-user-to-another-pager-after-x.html' title='Redirect user to another pager after x seconds using Meta tag'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-1287706405450062578</id><published>2007-05-12T10:36:00.000-07:00</published><updated>2007-05-18T13:58:09.425-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='JScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Making a window focus - Javascript</title><content type='html'>At times, you will want to make a page active or re-gain focus after it has been loaded. You probably have seen a lot of these already while surfing the internet, especially from sites that has a lot of pop up ads.&lt;br /&gt;&lt;br /&gt;One simple line of Javascript code &lt;strong&gt;window.focus();&lt;/strong&gt; will make the loading window gain focus. Alternatively, you might want to wait for the window to completely finish loading before you making it gain focus. To do so, simply add &lt;strong&gt;window.focus(); &lt;/strong&gt;in the &lt;strong&gt;&lt;/strong&gt;tag of the document along with the onload event.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Here's the code:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&lt;span style="color:#009900;"&gt;&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;Body onload="window.focus();"&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Another way is to put the script at the very last line of code, just before &lt;strong&gt;&lt;/strong&gt;tag as seen in the code below:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;Body&amp;gt;&lt;br /&gt;...&lt;br /&gt;...&lt;br /&gt;&amp;lt;script language=javascript&amp;gt;&lt;br /&gt;window.focus();&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/Body&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-1287706405450062578?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/1287706405450062578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=1287706405450062578' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1287706405450062578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/1287706405450062578'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/making-window-focus-javascript.html' title='Making a window focus - Javascript'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-2252112868655566422</id><published>2007-05-11T20:23:00.000-07:00</published><updated>2007-05-18T14:00:08.684-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Obtain all IP Addresses</title><content type='html'>System.Net namespace provides some functions that I find really useful when it comes to networking. You can use the GetHostName method to retrieve the computer name and GetHostEntry to get all IPs assigned to that computer.&lt;br /&gt;&lt;br /&gt;Both Visual Basic.net &amp; C Sharp examples are provided below.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;VB.net&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;Private Function GetIPs() As String&lt;br /&gt;&lt;br /&gt;Dim strHostName As String = Dns.GetHostName&lt;br /&gt;Dim myipaddress As IPAddress&lt;br /&gt;Dim strTemp As String = "Host Name: " &amp;amp; strHostName &amp; vbCrLf &amp;amp; "IPs: "&lt;br /&gt;Dim ipHostEntry As IPHostEntry = Dns.GetHostEntry(strHostName)&lt;br /&gt;&lt;br /&gt;For Each myipaddress In ipHostEntry.AddressList&lt;br /&gt;strTemp += myipaddress.ToString &amp; ","&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;Return strTemp.Substring(1, strTemp.Length - 2)&lt;br /&gt;&lt;br /&gt;End Function&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000000;"&gt;C#&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;private string GetIPs()&lt;br /&gt;{&lt;br /&gt;string strHostName = Dns.GetHostName();&lt;br /&gt;string strTemp = "Host Name: " + strHostName + "\r\n" + "IPs: ";&lt;br /&gt;&lt;br /&gt;IPHostEntry ipHostEntry = Dns.GetHostEntry(strHostName);&lt;br /&gt;foreach (IPAddress myipaddress in ipHostEntry.AddressList)&lt;br /&gt;{&lt;br /&gt;strTemp = strTemp + myipaddress + ",";&lt;br /&gt;}&lt;br /&gt;return strTemp.Substring(1, (strTemp.Length - 2));&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-2252112868655566422?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/2252112868655566422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=2252112868655566422' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2252112868655566422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/2252112868655566422'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/obtain-all-ip-addresses.html' title='Obtain all IP Addresses'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7377270124168998422.post-4772639147591639095</id><published>2007-05-11T12:18:00.000-07:00</published><updated>2007-05-18T14:01:03.905-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='VS.net'/><title type='text'>Failed to access IIS metabase</title><content type='html'>I got a new laptop recently and tried to setup IIS and transfer existing sites to it. The laptop had typical Windows XP Pro setup with IIS 5.1, Visual Web Developer 2005 Express Edition and Microsoft .NET Framework 2.0 installed.&lt;br /&gt;&lt;br /&gt;The sites were copied over and set to use ASP.NET version 2.0.50707 but when launched IIS generated the "Failed to access IIS metabase" error. Poking around on the internet I found some articles referring to things like granting permission to specific user accounts and re-registering ASP.NET... but none of these worked.&lt;br /&gt;&lt;br /&gt;I even tried setting up a brand new website and still got the same problem. The only thing that worked was running the web apps as File System but that's not how I want it done.&lt;br /&gt;&lt;br /&gt;While poking around with installed components (in Add/Remove Programs) and IIS settings, I suspected that the Microsoft .NET Framework 2.0 got corrupted so I reinstalled it.&lt;br /&gt;&lt;br /&gt;Once the framework got repaired, all websites functioned the way they were supposed to. Hope this tip will help you solve problem.&lt;br /&gt;&lt;br /&gt;Brian&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7377270124168998422-4772639147591639095?l=brian-dao.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brian-dao.blogspot.com/feeds/4772639147591639095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7377270124168998422&amp;postID=4772639147591639095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4772639147591639095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7377270124168998422/posts/default/4772639147591639095'/><link rel='alternate' type='text/html' href='http://brian-dao.blogspot.com/2007/05/failed-to-access-iis-metabase.html' title='Failed to access IIS metabase'/><author><name>Brian Dao</name><uri>http://www.blogger.com/profile/08040428568476637319</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://3.bp.blogspot.com/_bTDrD8248hs/S4c9Bj7jkmI/AAAAAAAAACM/TeWxxIA3LLE/S220/TamCa.jpg'/></author><thr:total>0</thr:total></entry></feed>
