<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>API Programming &#187; Sever 2003</title>
	<atom:link href="http://www.brangle.com/wordpress/tag/sever-2003/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brangle.com/wordpress</link>
	<description>Just another computer weblog</description>
	<lastBuildDate>Wed, 14 Dec 2011 07:35:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Shutdown, Restart, Log off your computer with VB.NET or C#</title>
		<link>http://www.brangle.com/wordpress/2009/08/how-to-shutdown-restart-log-off-your-computer-with-vb-net-or-c/</link>
		<comments>http://www.brangle.com/wordpress/2009/08/how-to-shutdown-restart-log-off-your-computer-with-vb-net-or-c/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 08:27:06 +0000</pubDate>
		<dc:creator>lopezg</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Sever 2003]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://www.brangle.com/wordpress/?p=458</guid>
		<description><![CDATA[This is extremely easy using VB.NET or C# (pronounced C sharp) and using the built in windows EXE file <i>shutdown.exe</i>. To shutdown, restart, or log off your computer is as simple as entering 1 line into your program, it just so happens that the 1 line is identical whether you're using VB.NET or C#. [...]]]></description>
			<content:encoded><![CDATA[<p>This is extremely easy using VB.NET or C# (pronounced C sharp) and the built in windows EXE file <i>shutdown.exe</i>.  To shutdown, restart, or log off your computer is as simple as entering 1 line into your program, it just so happens that the 1 line is identical whether you&#8217;re using VB.NET or C#.<span id="more-458"></span></p>
<p>To shutdown/turn off your computer, just execute the following line of code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">System.Diagnostics.Process.Start(<span style="color: #800000;">&quot;shutdown.exe&quot;</span>, <span style="color: #800000;">&quot;-s -t 0&quot;</span>)</pre></td></tr></table></div>

<p>To restart/reboot your computer, just execute the following line of code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">System.Diagnostics.Process.Start(<span style="color: #800000;">&quot;shutdown.exe&quot;</span>, <span style="color: #800000;">&quot;-r -t 0&quot;</span>)</pre></td></tr></table></div>

<p>To log off your computer, just execute the following line of code (and yes, that&#8217;s a lowercase L, not the number 1):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">System.Diagnostics.Process.Start(<span style="color: #800000;">&quot;shutdown.exe&quot;</span>, <span style="color: #800000;">&quot;-l -t 0&quot;</span>)</pre></td></tr></table></div>

<p>The number zero at the end of each of those examples is how long the computer should wait in seconds before shutting down/restarting/etc&#8230; In this example, I&#8217;m going to shutdown the computer in 5 minutes (5 minutes * 60 seconds = 300 seconds)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">System.Diagnostics.Process.Start(<span style="color: #800000;">&quot;shutdown.exe&quot;</span>, <span style="color: #800000;">&quot;-s -t 300&quot;</span>)</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.brangle.com/wordpress/2009/08/how-to-shutdown-restart-log-off-your-computer-with-vb-net-or-c/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Add or Map a Custom Hostnames to IP Address without a DNS Server</title>
		<link>http://www.brangle.com/wordpress/2009/08/add-or-map-custom-hostnames-to-ip-address-without-dns-server/</link>
		<comments>http://www.brangle.com/wordpress/2009/08/add-or-map-custom-hostnames-to-ip-address-without-dns-server/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 07:32:14 +0000</pubDate>
		<dc:creator>lopezg</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iTouch]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Registry]]></category>
		<category><![CDATA[Sever 2003]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://www.brangle.com/wordpress/?p=400</guid>
		<description><![CDATA[There's been several times where I had an Apache server running locally on my computer as a development (or dev) server. Now if this is on my home network, or if your system administrator won't give you your own custom host name then you have to go the DIY (do it yourself) route. But, often times, I have to hard code host names, or I need several different websites hosted on my personal machine. Well that's where the <i>hosts</i> file comes into play. [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been several times where I had an Apache server running locally on my computer as a development (or dev) server.  Now if this is on my home network, or if your system administrator won&#8217;t give you your own custom host name then you have to go the DIY (do it yourself) route.  But, often times, I have to hard code host names, or I need several different websites hosted on my personal machine.  Well that&#8217;s where the <i>hosts</i> file comes into play.<span id="more-400"></span></p>
<p>Another example of needing a custom ip address is at my company, I&#8217;ve needed to check the status of a printer and if I want to try the access it via its hostname <i>http://printername</i> it wont work because the SysAdmin has shared the printer on the network without adding a custom dns host name, even though it has a static IP address on the network. So I added the name of each printer to my <i>hosts</i> file so now I have no problem accessing any printer via its name, without having to first look up its IP address.<!--more--></p>
<p>Also, if you intend to <b>block a website by its hostname</b> then this is also the solution for you.</p>
<p>You can find the <i>hosts</i> file in the following folder&#8230;<br />
Windows 95, 98, and ME in the %WinDir%\ directory<br />
NT, 2000, XP, 2003, Vista, 7 in the %SystemRoot%\system32\drivers\etc\ directory (%SystemRoot% is almost always C:\Windows)<br />
iPhone and iTouch in the /private/etc/hosts directory<br />
Linux in the /etc/hosts directory</p>
<p>Also, a note for 0.1% of Windows NT, 2000, XP, 2003, Vista, and Windows 7 users, the actual location may differ, to find the real location you&#8217;ll need to dig into the registry key, give the following a look up</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="regedit" style="font-family:monospace;">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters</pre></td></tr></table></div>

<p> and look for the following string key <i>DataBasePath</i>.  On my computer it was declared as <i>%SystemRoot%\System32\drivers\etc</i>  I know that&#8217;s what I said it would be above, I just want all you SysAdmins to be aware of that 0.1% chance.</p>
<p>Lastly once, you finish making any modifications you&#8217;ll need to flush your locally cached DNS on your computer. </p>
<p>In WinXP you can edit the <i>c:\windows\system32\drivers\etc\hosts</i> file by opening it in notepad or any ascii text editor. By default the last line you&#8217;ll see is
<pre>127.0.0.1       localhost</pre>
<p> but other programs can change this.  The IP address 127.0.0.1 is always the ip address of the local computer.  It doesn&#8217;t matter if the computer has a different IP address on the network, 127.0.0.1 is considered a loop back address, in other words, it always points to your computer.</p>
<p>you can add a new hostname followed by the ip address in the text file that&#8217;s it, it&#8217;s just that simple!  Let&#8217;s add example.com to our local host names, now if we had apache installed, this ip address would always map to our computer just by adding the following line to the end of your <i>hosts</i> file&#8230; </p>
<pre>127.0.0.1    example.com</pre>
<p>Now what if you want to block a website like MySpace? Add the following line </p>
<pre>0.0.0.0       myspace.com</pre>
<p>The problem with this approach is it only blocks the hostname myspace.com, it leaves www.myspace.com and login.myspace.com completely accessible, and other hostname that I don&#8217;t know about (or worse yet, any future host names that they decide to add).  So let&#8217;s block all we we can by pointing them to a null IP address</p>
<pre>0.0.0.0       myspace.com
0.0.0.0       www.myspace.com
0.0.0.0       login.myspace.com</pre>
<p>Ok great, I added my login.myspace.com to the <i>hosts</i> file, but I can still access it, what gives?!? There is two possible fixes for this solution. First close all of your browsers, for example, if you can still access the domain in Internet Explorer or FireFox it&#8217;s because the IP address has been cached, close the browser so that the browser can &quot;forget&quot; the IP address.  Now before you reopen the application we also need to clear the DNS entry from Windows.  We can clear a DNS entry from windows by clicking <i>Start</i>, <i>Run</i> typing <i>ipconfig /flushdns</i> then clicking ok.  This will flush the ip address address stored by the operating system.  You should now by able to open FireFox and Internet Explorer and verify that they no longer have the IP address cached.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brangle.com/wordpress/2009/08/add-or-map-custom-hostnames-to-ip-address-without-dns-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

