<?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>Codepolice.net &#187; file_get_contents()</title>
	<atom:link href="http://codepolice.net/tag/file_get_contents/feed/" rel="self" type="application/rss+xml" />
	<link>http://codepolice.net</link>
	<description>C#, ASP.NET, MVC, LINQ, Wordpress and stuff like that</description>
	<lastBuildDate>Wed, 01 Sep 2010 08:05:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>file_get_contents() in asp.net/C#</title>
		<link>http://codepolice.net/2009/02/13/file_get_contents-in-aspnetc/</link>
		<comments>http://codepolice.net/2009/02/13/file_get_contents-in-aspnetc/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 11:25:59 +0000</pubDate>
		<dc:creator>Ola</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[bit.ly]]></category>
		<category><![CDATA[file_get_contents()]]></category>
		<category><![CDATA[StreamReader]]></category>
		<category><![CDATA[WebRequest]]></category>

		<guid isPermaLink="false">http://codepolice.net/?p=137</guid>
		<description><![CDATA[The URL shortening service http://bit.ly has a really simple and convient API that lets just get a short url like this. http://bit.ly/api?url=http://www.myreallylong.com/url/with/lots?of=crap I&#8217;ve used this in a wordpress installation with PHP before and there i could just do. $twitter_url .= file_get_contents&#40;'http://bit.ly/api?url=' . get_permalink&#40;&#41;&#41;; Simple and clean. But today i wanted to do the same thing [...]]]></description>
			<content:encoded><![CDATA[<p>The URL shortening service http://bit.ly has a really simple and convient API that lets just get a short url like this.</p>
<p>http://bit.ly/api?url=http://www.myreallylong.com/url/with/lots?of=crap</p>
<p>I&#8217;ve used this in a wordpress installation with PHP before and there i could just do.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$twitter_url</span> <span style="color: #339933;">.=</span> <a href="http://www.php.net/file_get_contents"><span style="color: #990000;">file_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://bit.ly/api?url='</span> <span style="color: #339933;">.</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Simple and clean. But today i wanted to do the same thing with asp.net and found myself kind of lost. At last i came up with this, not as simple solution. But it works.</p>
<div class="codecolorer-container csharp twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666cc; font-weight: bold;">string</span> shortUrl <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StreamReader<span style="color: #008000;">&#40;</span>WebRequest<span style="color: #008000;">.</span><span style="color: #0000FF;">Create</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;http://bit.ly/api?url=http://fragor.ohsohightech.se&quot;</span> <span style="color: #008000;">+</span> Url<span style="color: #008000;">.</span><span style="color: #0000FF;">Action</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Question&quot;</span>, <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #008000;">&#123;</span> number <span style="color: #008000;">=</span> question<span style="color: #008000;">.</span><span style="color: #0000FF;">Number</span>, title <span style="color: #008000;">=</span> question<span style="color: #008000;">.</span><span style="color: #0000FF;">Title</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ConvertTextToUrl</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetResponse</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetResponseStream</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ReadToEnd</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></div></div>

]]></content:encoded>
			<wfw:commentRss>http://codepolice.net/2009/02/13/file_get_contents-in-aspnetc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->