<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>p2p.wrox.com Forums - Classic ASP Basics</title>
		<link>http://p2p.wrox.com</link>
		<description><![CDATA[For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0]]></description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 12:15:38 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://p2p.wrox.com/images/misc/rss.jpg</url>
			<title>p2p.wrox.com Forums - Classic ASP Basics</title>
			<link>http://p2p.wrox.com</link>
		</image>
		<item>
			<title>moving items from one listbox to another</title>
			<link>http://p2p.wrox.com/classic-asp-basics/77024-moving-items-one-listbox-another.html</link>
			<pubDate>Fri, 13 Nov 2009 20:02:31 GMT</pubDate>
			<description>Can we implement listbox in Classic ASP where I can move items from one list box to another by clicking on a button ?</description>
			<content:encoded><![CDATA[<div>Can we implement listbox in Classic ASP where I can move items from one list box to another by clicking on a button ?</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/classic-asp-basics-61/">Classic ASP Basics</category>
			<dc:creator>Nishapd</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/classic-asp-basics/77024-moving-items-one-listbox-another.html</guid>
		</item>
		<item>
			<title>Solution: Impersonation with Classic ASP</title>
			<link>http://p2p.wrox.com/classic-asp-basics/77007-solution-impersonation-classic-asp.html</link>
			<pubDate>Thu, 12 Nov 2009 15:50:23 GMT</pubDate>
			<description>Hello All,
Some time ago (over two years ago) a forum reader asked how to use impersonation in ASP; my response to the reader was a link out to the...</description>
			<content:encoded><![CDATA[<div>Hello All,<br />
Some time ago (over two years ago) a forum reader asked how to use impersonation in ASP; my response to the reader was a link out to the MSDN where Microsoft had provided a solution, albeit in VB6. Reference thread: <a href="http://p2p.wrox.com/classic-asp-basics/61844-identity-impersonate-asp.html" target="_blank">http://p2p.wrox.com/classic-asp-basi...onate-asp.html</a><br />
 <br />
As most of you know ASP executes under the guise, typically, of the IUSR_ account in IIS (IIS_IUSRS group for IIS 7) which has a very few permissions to do anything on the system (in most cases anyway). In .NET we can easily impersonate a user by placing some values into the web.config and viola. This, however, is not the case with ASP. Like most things in ASP the solution here is to create a COM component that can do some P/Invoke-ing to get a handle on some Win32 API's. I figured I could simply take the provided VB6 code, interepet it into C#, register the assembly for Interop and be done with it. Easy right?<br />
 <br />
While I could go on a rant about how Microsoft needs to contiually update their code references, ill spare you. The long and the short of it is to make impersonation a reality you need to hook 3 methods from <b>advapi32</b> and 1 method from <b>kernel32</b> which is simple enough, however, if you port the VB6 code to C# exactly as its wrote you will wind up with an Access Violation exception everytime you call LogonUser. After banging my head off the wall for sometime I consulted <a href="http://www.pinvoke.net" target="_blank">www.pinvoke.net</a> and realized that the signature that Microsoft had provided for the LogonUser method was incorrect. The provided signature was <b>string, string, string, long, long, long</b> but needed to be <b>string, string, string, int, int, out IntPtr</b>! The return types that Microsoft had provided were also incorrect (mostly the return type was long when it should of been bool).<br />
 <br />
Once I corrected the signature and re-registered the assembly I was able to impersonate a domain account and write a file to a protected share via ASP! Below I have provided a (mostly) complete soultion so as to save the next poor soul that has to do this a few grey hairs! (I say mostly complete only because the code could be refactored a small bit. Otherwise the code is fully functional and I have pointed out pitfalls and &quot;gotchas&quot; that I discovered)<br />
 <br />
<b>C# Code</b><br />
I used Visual Studio 2008 to create my assembly but, I assume, you could also use Visual C# 2008 Express. Create a new class library and give it a name. I called mine Impersonate. Rename the default Class1.cs to a more meaningful namel; I used UserLogon.cs.<br />
 <br />
<b>Using Statements</b><br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">csharp Code:</div>
	<pre class="alt2" style="margin:0px; padding:6px; border:1px inset; width:auto; height:68px; overflow:auto"><div dir="ltr" style="text-align:left;"><div class="csharp"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>;<br /><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Runtime</span>.<span style="color: #0000FF;">InteropServices</span>;</div></div></pre>
</div> <br />
<b>Class Definition</b><br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">csharp Code:</div>
	<pre class="alt2" style="margin:0px; padding:6px; border:1px inset; width:auto; height:516px; overflow:auto"><div dir="ltr" style="text-align:left;"><div class="csharp"><span style="color: #0600FF;">namespace</span> Impersonate<br /><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#91;</span>indent<span style="color: #000000;">&#93;</span><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> UserLogon<br /><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#91;</span>indent<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>DllImport<span style="color: #000000;">&#40;</span><span style="color: #808080;">"advapi32.dll"</span>, SetLastError=<span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br /><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">extern</span> <span style="color: #FF0000;">bool</span> LogonUser<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> lpszUsername, <span style="color: #FF0000;">string</span> lpszDomain, <span style="color: #FF0000;">string</span> lpszPassword, <span style="color: #FF0000;">int</span> dwLogonType, <span style="color: #FF0000;">int</span> dwLogonProvider, <span style="color: #0600FF;">out</span> IntPtr phToken<span style="color: #000000;">&#41;</span>;<br />&nbsp;<br /><span style="color: #000000;">&#91;</span>DllImport<span style="color: #000000;">&#40;</span><span style="color: #808080;">"advapi32.dll"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br /><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">extern</span> <span style="color: #FF0000;">int</span> ImpersonateLoggedOnUser<span style="color: #000000;">&#40;</span>IntPtr hToken<span style="color: #000000;">&#41;</span>;<br />&nbsp;<br /><span style="color: #000000;">&#91;</span>DllImport<span style="color: #000000;">&#40;</span><span style="color: #808080;">"advapi32.dll"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br /><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">extern</span> <span style="color: #FF0000;">bool</span> RevertToSelf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp;<br /><span style="color: #000000;">&#91;</span>DllImport<span style="color: #000000;">&#40;</span><span style="color: #808080;">"kernel32.dll"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br /><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">extern</span> <span style="color: #FF0000;">bool</span> CloseHandle<span style="color: #000000;">&#40;</span>IntPtr hObject<span style="color: #000000;">&#41;</span>;<br />&nbsp;<br /><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">const</span> <span style="color: #FF0000;">int</span> LOGON32_LOGON_INTERACTIVE = <span style="color: #FF0000;">2</span>;<br /><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">const</span> <span style="color: #FF0000;">int</span> LOGON32_PROVIDER_DEFAULT = <span style="color: #FF0000;">0</span>;<br /><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> Logon<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> strAdminUser, <span style="color: #FF0000;">string</span> strAdminPassword, <span style="color: #FF0000;">string</span> strAdminDomain<span style="color: #000000;">&#41;</span> <br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp;IntPtr hToken;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp;RevertToSelf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp;LogonUser<span style="color: #000000;">&#40;</span>strAdminUser, strAdminDomain, strAdminPassword, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, <span style="color: #0600FF;">out</span> hToken<span style="color: #000000;">&#41;</span>;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp;ImpersonateLoggedOnUser<span style="color: #000000;">&#40;</span>hToken<span style="color: #000000;">&#41;</span>;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp;CloseHandle<span style="color: #000000;">&#40;</span>hToken<span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> Logoff<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; RevertToSelf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><span style="color: #000000;">&#91;</span>/indent<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #000000;">&#91;</span>/indent<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span></div></div></pre>
</div> <br />
In the Solution Explorer locate the AssemblyInfo.cs file underneath the Properties folder of your project (you may need to click the 'Show all Files' button at the top of the solution explorer) and open it. Add the following line to the file:<br />
 <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">csharp Code:</div>
	<pre class="alt2" style="margin:0px; padding:6px; border:1px inset; width:auto; height:52px; overflow:auto"><div dir="ltr" style="text-align:left;"><div class="csharp"><span style="color: #000000;">&#91;</span>assembly: ComVisible<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span></div></div></pre>
</div> <br />
Hit Ctrl + Shift + B (Build) to create your assembly. <br />
 <br />
Start* up a Visual Studio Command Prompt which can, typically, be found in Start -- &gt; Programs --&gt; Visual Studio 2008 --&gt; Visual Studio Tools and navigate to the directory where your assembly is (something like: projectDirectory\bin\debug\) and issue the following command: regasm Impersonate.dll /tlb <br />
 <br />
<font size="1">*<i><b>if you are running Vista or Win7 run this prompt with Admin rights</b></i></font><br />
 <br />
In your ASP editor (I used Notepad) use the following code to test your assembly:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">asp Code:</div>
	<pre class="alt2" style="margin:0px; padding:6px; border:1px inset; width:auto; height:468px; overflow:auto"><div dir="ltr" style="text-align:left;"><div class="asp"><span style="color: #006600; font-weight:bold">&#91;</span>size=<span style="color: #800000;">2</span><span style="color: #006600; font-weight:bold">&#93;</span><span style="color: #0000ff; font-weight: bold;">&lt;%</span><br />&nbsp; &nbsp; <span style="color: #990099; font-weight: bold;">Option</span> <span style="color: #990099; font-weight: bold;">Explicit</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp;<span style="color: #990099; font-weight: bold;">Dim</span> objLogon, oFs, oTextFile<br />&nbsp;<br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #990099; font-weight: bold;">Set</span> objLogon = <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold">&#40;</span><span style="color: #cc0000;">"Impersonate.UserLogon"</span><span style="color: #006600; font-weight:bold">&#41;</span><br />&nbsp; &nbsp; &nbsp;objLogon.<span style="color: #9900cc;">Logon</span> <span style="color: #cc0000;">"username"</span>, <span style="color: #cc0000;">"password"</span>, <span style="color: #cc0000;">"domainname"</span><br />&nbsp;<br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span><span style="color: #006600; font-weight:bold">&#40;</span><span style="color: #cc0000;">"Impersonating"</span><span style="color: #006600; font-weight:bold">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp;<span style="color: #990099; font-weight: bold;">set</span> oFs = <span style="color: #990099; font-weight: bold;">server</span>.<span style="color: #330066;">createobject</span><span style="color: #006600; font-weight:bold">&#40;</span><span style="color: #cc0000;">"Scripting.FileSystemObject"</span><span style="color: #006600; font-weight:bold">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #990099; font-weight: bold;">set</span> oTextFile = oFs.<span style="color: #330066;">OpenTextFile</span><span style="color: #006600; font-weight:bold">&#40;</span><span style="color: #cc0000;">"C:<span style="color: #000099; font-weight: bold;">\f</span>oo.txt"</span>, <span style="color: #800000;">2</span>, <span style="color: #0000ff; font-weight: bold;">True</span><span style="color: #006600; font-weight:bold">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp;oTextFile.<span style="color: #330066;">Write</span> <span style="color: #cc0000;">"This is some data wrote as a domain user"</span><br />&nbsp; &nbsp; &nbsp;oTextFile.<span style="color: #330066;">Close</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp;<span style="color: #990099; font-weight: bold;">set</span> oTextFile = <span style="color: #0000ff; font-weight: bold;">nothing</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #990099; font-weight: bold;">set</span> oFS = <span style="color: #0000ff; font-weight: bold;">nothing</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp;objLogon.<span style="color: #9900cc;">Logoff</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #990099; font-weight: bold;">Set</span> objLogon = <span style="color: #0000ff; font-weight: bold;">Nothing</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span><span style="color: #006600; font-weight:bold">&#40;</span><span style="color: #cc0000;">"Done Impersonating"</span><span style="color: #006600; font-weight:bold">&#41;</span><br /><span style="color: #0000ff; font-weight: bold;">%&gt;</span><br /><span style="color: #006600; font-weight:bold">&#91;</span>/size<span style="color: #006600; font-weight:bold">&#93;</span></div></div></pre>
</div> <br />
Most of this is very basic but there are some things to point out here:<br />
 <ul><li>Make sure that the call to CreateObject for objLogon has the name of your assembly.  The format for the name will be Namespace.Class.  If you have followed along using my code then the correct name is Impersonate.UserLogon.</li>
<li>Provide a valid username, password, and domain.  I have not tried to impersonate a Local User but, <b>I assume</b>, you could simply provide the PC name as the domain and have this work.</li>
<li>Make sure that you call LogOff so that the thread reverts back to running as the IUSR account.</li>
</ul>Provided that you execute this ASP script under the guise of IUSR, under normal circumstances, the call to create a text file in the root of the C drive should fail with an Access Denied error so that is a good case to test out our impersonation assembly. As you can see above, a user is impersonated, a file is wrote, and the user is logged off. If all went according to plan you should now see a text file in the root of your C drive! Obviously I am making the assumption that the domain user you are impersonating has the right to create files in the root of the C drive so adjust this test case accordingly.<br />
 <br />
<b>Pitfalls and Gotchas</b><ul><li>If you are running IIS 7 on a x64 platform you may get a cryptic &quot;Active X is unable to Create Object&quot;.  Before you google the problem first start up inetmgr, and locate the Application Pool that your ASP script is running from, right click on it and select 'Advanced Settings' from the context menu.  The second option under the General section is 'Enable 32-Bit Applications'; change the value from False to True. If you still get the error, then Google it ;]</li>
<li>For testing purposes, I suggest moving your dll out of your debug directory and into another one and then register the dll from there. The reason for this is if you have to make any changes to the dll you will not be able to rebuild your project since the OS will have a lock on the dll in your bin directory.</li>
<li>If you need to make changes to your assembly after you have already registered it issue the following command from a Visual Studio command prompt inside the directory your assembly is registered from: regasm /u Impersonate.dll tlb:Impersonate.tlb  Make your changes and then re-register the assembly using the regasm from the main tutorial.  If, after you have unregistered the dll you are unable to replace the file (Access is denied because the file is in use by another process) start taskmgr and kill the w3wp.exe process (you will need to tick off the 'Show porcesses from all users' checkbox). You should now be able to replace the file.</li>
</ul>That should do it!  You should now have a fully operational component that allows for impersonation in Classic ASP!<br />
 <br />
As always, questions, comments, and criticisim are welcomed!<br />
 <br />
-Doug</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/classic-asp-basics-61/">Classic ASP Basics</category>
			<dc:creator>dparsons</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/classic-asp-basics/77007-solution-impersonation-classic-asp.html</guid>
		</item>
		<item>
			<title>FPDF in asp for bar chart</title>
			<link>http://p2p.wrox.com/classic-asp-basics/77005-fpdf-asp-bar-chart.html</link>
			<pubDate>Thu, 12 Nov 2009 15:37:30 GMT</pubDate>
			<description>Hi all,

The previous posts on FPDF in asp were all very helpful. 

I have a asp report that has dynamic barcharts in them which has to be converted...</description>
			<content:encoded><![CDATA[<div>Hi all,<br />
<br />
The previous posts on FPDF in asp were all very helpful. <br />
<br />
I have a asp report that has dynamic barcharts in them which has to be converted to PDF using FPDF in asp. Is there any extension available for it?<br />
Or How can I do it if I have to do it myself.<br />
<br />
Thanks in advance,</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/classic-asp-basics-61/">Classic ASP Basics</category>
			<dc:creator>van</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/classic-asp-basics/77005-fpdf-asp-bar-chart.html</guid>
		</item>
		<item>
			<title>CDONTS.NewMail ???</title>
			<link>http://p2p.wrox.com/classic-asp-basics/76985-cdonts-newmail.html</link>
			<pubDate>Tue, 10 Nov 2009 20:45:49 GMT</pubDate>
			<description><![CDATA[Hi to all...

I'm using the simple code to send an email...
the email look to get stuck in "C:\Inetpub\mailroot\queue\" folder...
I get NO errors on...]]></description>
			<content:encoded><![CDATA[<div>Hi to all...<br />
<br />
I'm using the simple code to send an email...<br />
the email look to get stuck in &quot;C:\Inetpub\mailroot\queue\&quot; folder...<br />
I get NO errors on my web page nor i get the email...<br />
the DLL is installed...<br />
<br />
Can someone please help... i do not know what else to try...<br />
<br />
Thanking you in advance...<br />
<br />
Rino<br />
<br />
Dim objNewMail<br />
Set objNewMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)<br />
objNewMail.From = fromEmail<br />
objNewMail.To = toEmail<br />
<br />
objNewMail.Subject = &quot;Testing&quot;<br />
strBody=strBody &amp; fromEmail &amp;&quot; Testing&quot; <br />
objNewMail.Body=strBody<br />
<br />
objNewMail.Send<br />
Set objNewMail = Nothing</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/classic-asp-basics-61/">Classic ASP Basics</category>
			<dc:creator>RinoDM</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/classic-asp-basics/76985-cdonts-newmail.html</guid>
		</item>
		<item>
			<title><![CDATA[ASP can't exec perl script]]></title>
			<link>http://p2p.wrox.com/classic-asp-basics/76905-asp-cant-exec-perl-script.html</link>
			<pubDate>Wed, 04 Nov 2009 20:10:17 GMT</pubDate>
			<description>I get a bad format error with the below stuff. Yet the dos dir command works fine. I don’t get it. The perl script works from the commandline and...</description>
			<content:encoded><![CDATA[<div><font face="Arial">I get a bad format error with the below stuff. Yet the dos dir command works fine. I don’t get it. The perl script works from the commandline and changes my file permissions. Can you help?</font><br />
<font face="Arial">Dim Executor<br />
Dim strResult<br />
    Set Executor = Server.CreateObject(&quot;ASPExec.Execute&quot;)<br />
    'Executor.Application = &quot;cmd /K dir &gt;C:\temp\log.txt&quot;<br />
    Executor.Application = &quot;C:\Inetpub\wwwroot\Test\GCI\scripts\permissions.p  l&quot;<br />
    Executor.Parameters = &quot;&quot;<br />
    Executor.ShowWindow = True<br />
    Executor.TimeOut = 120 <br />
    strResult = Executor.ExecuteWinApp<br />
    Response.Write strResult<br />
</font></div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/classic-asp-basics-61/">Classic ASP Basics</category>
			<dc:creator>frankm9639</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/classic-asp-basics/76905-asp-cant-exec-perl-script.html</guid>
		</item>
		<item>
			<title>bytearray to image file</title>
			<link>http://p2p.wrox.com/classic-asp-basics/76755-bytearray-image-file.html</link>
			<pubDate>Sun, 25 Oct 2009 07:16:17 GMT</pubDate>
			<description>hi ,my workmates do the flex develop,he post me an bytearray,how i can make the bytearray to  jpg  image file.i found a function like follow:
...</description>
			<content:encoded><![CDATA[<div>hi ,my workmates do the flex develop,he post me an bytearray,how i can make the bytearray to  jpg  image file.i found a function like follow:<br />
 Function SaveBinaryData(FileName, ByteArray)<br />
Const adTypeBinary = 1<br />
Const adSaveCreateOverWrite = 2<br />
<br />
'Create Stream object<br />
Dim BinaryStream<br />
Set BinaryStream = CreateObject(&quot;ADODB.Stream&quot;)<br />
<br />
'Specify stream type - we want To save binary data.<br />
BinaryStream.Type = adTypeBinary<br />
<br />
'Open the stream And write binary data To the object<br />
BinaryStream.Open<br />
BinaryStream.Write ByteArray<br />
<br />
'Save binary data To disk<br />
BinaryStream.SaveToFile FileName, adSaveCreateOverWrite<br />
End Function<br />
i have tried in my server but it can not works,can anybody give me a help..tks a lot..my email is <a href="mailto:wyxtwhut@gmail.com">wyxtwhut@gmail.com</a></div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/classic-asp-basics-61/">Classic ASP Basics</category>
			<dc:creator>wyxtwhut</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/classic-asp-basics/76755-bytearray-image-file.html</guid>
		</item>
	</channel>
</rss>
