<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="2.0">
<channel>
	<title>FTP server in VB6.0</title>
	<link><![CDATA[http://www.dreamincode.net/forums/index.php?app=blog&module=showblog&blogid=562]]></link>
	<description>FTP server in VB6.0 Syndication</description>
	<pubDate>Sat, 06 Feb 2010 23:22:35 +0000</pubDate>
	<webMaster>admin@dreamincode.net (Dream.In.Code)</webMaster>
	<generator>IP.Blog</generator>
	<ttl>60</ttl>
	<item>
		<title>Downloading from FTP in VB6.0</title>
		<link><![CDATA[http://www.dreamincode.net/forums/index.php?app=blog&blogid=562&showentry=1480]]></link>
		<category></category>
		<description><![CDATA[It is my first blog so dont be so hard on me i lose lots of my time to try get this to work so i decide to share it <img src='http://http.cdnlayer.com/dreamincode/forums/public/style_emoticons/default/smile.gif' class='bbc_emoticon' alt=':)' /><br />
<br />
so here is the code <br />
<br />
so we add Inet1 <br />
i will show you how to copy a file from FTP<br />
<br />
<pre class='prettyprint '>
Dim str_url As String
Dim sFTPCommand As String  'the command send to ftp server
Dim sFTPSrcFileName As String ' the name of the file that we search in ftp server
Dim sFTPTgtFileName As String 'optional it is for new name when you copy &#40;you dont have to seth this it will copy it as the name of original&#41;
Dim sFTPUser As String ' the username
Dim sFTPPwd As String ' the password
Dim fWait As Boolean
dim sFTPurl as Strin ' the ip or the url of the FTP serve

sFTPUser=txtUsername.Text
sFTPPwd= txtPassword.Text
str_url=&#34;ftp&#58;//&#34; & sFTPUser & &#34;&#58;&#34; & sFTPPwd & &#34;@&#34; & sFTPurl
sFTPCommand = &#34;GET&#34; 'the command to FTP server
sFTPSrcFileName = &#34;Version.txt&#34; 'it is the file on the server
sFTPTgtFileName = &#34;Ver.txt&#34; ' it is the name of the file when you copy it on your HDD

' send the line to Inet1 to execute it 

Inet1.Execute str_url, sFTPCommand & Space&#40;1&#41; & sFTPSrcFileName & &#34; &#34; & sFTPTgtFileName

'NOW HERE IS THE TRICK YOU MUST WAIT TO BE SHURE IT IS DONE WITH THIS CYCLE HERE
'
  fWait = True
  Do Until fWait = False
		DoEvents
		fWait = Inet1.StillExecuting
  Loop


</pre><br />
<br />
<br />
and here we go now that you copy your file you can read it and do what ever you want with it now if you want to send to FTP just seth the command to PUT and your done <img src='http://http.cdnlayer.com/dreamincode/forums/public/style_emoticons/default/smile.gif' class='bbc_emoticon' alt=':)' /> i hope you like it <img src='http://http.cdnlayer.com/dreamincode/forums/public/style_emoticons/default/smile.gif' class='bbc_emoticon' alt=':)' />]]></description>
		<pubDate>Thu, 30 Jul 2009 07:43:05 +0000</pubDate>
		<guid><![CDATA[http://www.dreamincode.net/forums/index.php?app=blog&blogid=562&showentry=1480]]></guid>
	</item>
</channel>
</rss>