<?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>LogikDevelopment &#187; VBScript</title>
	<atom:link href="http://www.logikdev.com/category/vbscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logikdev.com</link>
	<description>&#34;Il n&#039;y a pas de problème, il n&#039;y a que des solutions. L&#039;esprit de l&#039;homme invente ensuite le problème.&#34; André Gide</description>
	<lastBuildDate>Tue, 20 Dec 2011 12:25:13 +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>Use ServerXMLHTTP through a proxy</title>
		<link>http://www.logikdev.com/2010/07/07/use-serverxmlhttp-through-proxy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-serverxmlhttp-through-proxy</link>
		<comments>http://www.logikdev.com/2010/07/07/use-serverxmlhttp-through-proxy/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 19:22:17 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[proxycfg tool]]></category>
		<category><![CDATA[ServerXMLHTTP]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=647</guid>
		<description><![CDATA[The other day, I was trying to use the ServerXMLHTTP object. For information, this object was created to allow you to establish server-to-server HTTP connections. The code I firstly wrote looked like the following: with sURL the URL to call and sParams the parameters to send with the URL. The problem was that oXMLHTTP.responseText didn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I was trying to use the <strong>ServerXMLHTTP</strong> object. For information, this object was created to allow you to establish server-to-server HTTP connections.</p>
<p>The code I firstly wrote looked like the following:</p>
<pre class="brush: vb; title: ; notranslate">
Dim oXMLHTTP
Set oXMLHTTP = Server.CreateObject(&quot;MSXML2.ServerXMLHTTP&quot;)
oXMLHTTP.open &quot;POST&quot;, sURL, false
oXMLHTTP.setRequestHeader &quot;Content-Type&quot;, &quot;application/x-www-form-urlencoded&quot;
oXMLHTTP.send sParams
Response.Write oXMLHTTP.responseText
</pre>
<p>with <code>sURL</code> the URL to call and <code>sParams</code> the parameters to send with the URL.</p>
<p>The problem was that <code>oXMLHTTP.responseText</code> didn&#8217;t return anything. Or to be exact, it returned an empty string, which was obviously not the expected response&#8230; <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>After some investigation, it appeared that the problem was because the server was seating behind a proxy. All this is good and well, but the question now is how to tell the application to use the proxy?<br />
<br/><br />
First of all, the ServerXMLHTTP object has a <code>setProxy</code> method:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms760236(v=VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms760236(v=VS.85).aspx</a><br />
So I tried to add the following line to the previous code:</p>
<pre class="brush: vb; title: ; notranslate">
oXMLHTTP.setProxy 2, &quot;myProxyServer:80&quot;, &quot;&quot;
</pre>
<p>Unfortunately, this didn&#8217;t fix the problem. It looks like this line is simply ignored. If somebody knows why, please tell me! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<br/><br />
So the solution I finally adopted was to configure the proxy through the <strong>proxycfg</strong> tool.<br />
There are two ways of using this tool:</p>
<ul>
<li>Import the proxy settings from the current user&#8217;s Microsoft Internet Explorer manual settings using the command <code>proxycfg.exe -u</code></li>
<li>Configure the proxy settings manually using the command <code>proxycfg -p myProxyServer:80</code></li>
</ul>
<p>This last solution works for me and I hope it will help a few people. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<br/><br />
<strong>PS:</strong> I found the following page when writing this article: <a href="http://support.microsoft.com/kb/289481/">http://support.microsoft.com/kb/289481/</a>. It would have been so good to find it during my investigation but anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/07/07/use-serverxmlhttp-through-proxy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Image manipulation in VBScript</title>
		<link>http://www.logikdev.com/2010/06/09/image-manipulation-in-vbscript/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=image-manipulation-in-vbscript</link>
		<comments>http://www.logikdev.com/2010/06/09/image-manipulation-in-vbscript/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 21:35:57 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=572</guid>
		<description><![CDATA[I am back on Windows development. It is not what I prefer but still, it is development so I am right here! My task was to upload an image from a website (nothing difficult there) but the application has to resize and crop the uploaded image before saving it on the hard drive in order [...]]]></description>
			<content:encoded><![CDATA[<p>I am back on Windows development. It is not what I prefer but still, it is development so I am right here! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>My task was to upload an image from a website (nothing difficult there) but the application has to resize and crop the uploaded image before saving it on the hard drive in order to save space.<br />
Oh, and I forgot to mention that the website is built in VBScript (it would have been too easy if it has been built in ASP.Net&#8230;). <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_rolleyes.gif' alt=':roll:' class='wp-smiley' /> </p>
<p>I went across a lot of image management libraries which work with VBScript during my search:</p>
<ul>
<li><strong>AspImage</strong> from <a href="http://serverobjects.com/">ServerObjects Inc</a>;</li>
<li><strong>ImageGlue</strong> from <a href="http://www.websupergoo.com/">webSupergoo</a>;</li>
<li><strong>Active Image Processing Component</strong> from <a href="http://www.ultrashareware.com/">Ultra Shareware</a>.</li>
</ul>
<p>But I must admit that the most difficult part of this task was to find a good and FREE library.<br />
The one I finally picked is <a href="http://www.imagemagick.org/"><strong>ImageMagick</strong></a>.</p>
<p>Once the library is installed (click <a href="http://www.imagemagick.org/script/binary-releases.php#windows">here</a> to go to the download page), you can use the following code to resize the image to a maximum of 800 pixels and crop the white space around it:</p>
<pre class="brush: vb; title: ; notranslate">
Dim imageMagick
Set imageMagick = CreateObject(&quot;ImageMagickObject.MagickImage.1&quot;)

imageMagick.Convert &quot;C:/testimage.jpg&quot;, &quot;-fuzz&quot;, &quot;10%&quot;, &quot;-trim&quot;, &quot;-resize&quot;, &quot;800x800&gt;&quot;, &quot;C:/thumb-testimage.jpg&quot;
</pre>
<p>Obviously, this tool can do much more than that, but this will be subject of another topic.<br />
Or you can simply read the documentation: <a href="http://www.imagemagick.org/Usage/">http://www.imagemagick.org/Usage/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/06/09/image-manipulation-in-vbscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

