<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Fox4um - İnternetten dosya indirmek]]></title>
	<link rel="self" href="http://www.fox4um.com/feed/atom/topic/256/"/>
	<updated>2009-10-09T06:43:51Z</updated>
	<generator>PunBB</generator>
	<id>http://www.fox4um.com/topic/256/internetten-dosya-indirmek/</id>
		<entry>
			<title type="html"><![CDATA[Re: İnternetten dosya indirmek]]></title>
			<link rel="alternate" href="http://www.fox4um.com/post/8381/#p8381"/>
			<content type="html"><![CDATA[<p>Birol, yazdığın kod harika çalışıyor süper. Teşekkürler.
<br />Peki arkadaşlar, yukarıdaki örnekteki tek bir kütük yerine bir klasör ismini vererek tüm klasörün içeriğini kopyalatmak mümkün mü ?</p>]]></content>
			<author>
				<name><![CDATA[ozcan]]></name>
				<uri>http://www.fox4um.com/user/94/</uri>
			</author>
			<updated>2009-10-09T06:43:51Z</updated>
			<id>http://www.fox4um.com/post/8381/#p8381</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: İnternetten dosya indirmek]]></title>
			<link rel="alternate" href="http://www.fox4um.com/post/7967/#p7967"/>
			<content type="html"><![CDATA[<p>Bu kodla dosya indirebilirsin.&nbsp; Ayrıca dosya indirme sırasında progressbar göstermek istersen başka bir kod daha vardı, istersen bulabilirim.
<br />Birde wget.exe&#039;i kullanarak DOS&#039;tan da dosya indirebilirsin.
</p><div class="codebox"><div class="head">Visual Fox Pro</div><table class="visualfoxpro fxcode"><tbody><tr class="li1"><td class="ln"><pre class="de1">1
<br />2
<br />3
<br />4
<br />5
<br />6
<br />7
<br />8
<br />9
<br />10
<br />11
<br />12
<br />13
<br />14
<br />15
<br />16
<br /></pre></td><td class="de1"><pre class="de1">xurl<span class="sy0">=</span><span class="st0">&quot;www.espor.com/aa.zip&quot;</span>
<br />xfilename<span class="sy0">=</span><span class="st0">&quot;C:<span class="es0">\a</span>a.zip&quot;</span>
<br />&nbsp;
<br /><span class="kw1">if</span> getfilefromurl<span class="br0">&#40;</span>xurl<span class="sy0">,</span>xfilename<span class="br0">&#41;</span><span class="sy0">=</span><span class="nu0">0</span>
<br />&nbsp; &nbsp; <span class="sy0">?</span> <span class="st0">&quot;OK&quot;</span>
<br /><span class="kw1">else</span>
<br />&nbsp; &nbsp; <span class="sy0">?</span> <span class="st0">&quot;HATA&quot;</span>
<br /><span class="kw1">endif</span>
<br />&nbsp;
<br />&nbsp;
<br /><span class="sy0">************************</span>
<br /><span class="kw1">procedure</span> getfilefromurl
<br />&nbsp; &nbsp; <span class="kw1">lparameters</span> tcremotefile<span class="sy0">,</span>tclocalfile
<br />&nbsp; &nbsp; <span class="kw1">declare</span> <span class="kw2">integer</span> URLDownloadToFile <span class="kw2">in</span> urlmon<span class="sy0">.</span><span class="kw1">dll</span> <span class="kw2">integer</span> pCaller<span class="sy0">,</span><span class="kw3">string</span> szURL<span class="sy0">,</span><span class="kw3">string</span> szFileName<span class="sy0">,</span><span class="kw2">integer</span> dwReserved<span class="sy0">,</span><span class="kw2">integer</span> lpfnCB
<br />&nbsp; &nbsp; <span class="kw2">return</span> urldownloadtofile<span class="br0">&#40;</span><span class="nu0">0</span><span class="sy0">,</span>m<span class="sy0">.</span><span class="me1">tcremotefile</span><span class="sy0">,</span>m<span class="sy0">.</span><span class="me1">tclocalfile</span><span class="sy0">,</span><span class="nu0">0</span><span class="sy0">,</span><span class="nu0">0</span><span class="br0">&#41;</span>
<br /><span class="kw1">endproc</span></pre></td></tr></tbody></table></div>]]></content>
			<author>
				<name><![CDATA[birol]]></name>
				<uri>http://www.fox4um.com/user/159/</uri>
			</author>
			<updated>2009-08-28T20:17:07Z</updated>
			<id>http://www.fox4um.com/post/7967/#p7967</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: İnternetten dosya indirmek]]></title>
			<link rel="alternate" href="http://www.fox4um.com/post/7964/#p7964"/>
			<content type="html"><![CDATA[<p>Aşağıdaki linkleri incelemeni öneririm :
<br /><a href="http://activevfp.codeplex.com/">http://activevfp.codeplex.com/</a>
<br /><a href="http://www.ctl32.com.ar/default.asp">http://www.ctl32.com.ar/default.asp</a></p>]]></content>
			<author>
				<name><![CDATA[ugurlu2001]]></name>
				<uri>http://www.fox4um.com/user/30/</uri>
			</author>
			<updated>2009-08-28T14:31:42Z</updated>
			<id>http://www.fox4um.com/post/7964/#p7964</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: İnternetten dosya indirmek]]></title>
			<link rel="alternate" href="http://www.fox4um.com/post/7960/#p7960"/>
			<content type="html"><![CDATA[<p>Merhaba bana ftp ile dosya gönderme komutu lazım.yardımcı olursanız çok sevinirim...</p>]]></content>
			<author>
				<name><![CDATA[style_41]]></name>
				<uri>http://www.fox4um.com/user/807/</uri>
			</author>
			<updated>2009-08-28T14:06:26Z</updated>
			<id>http://www.fox4um.com/post/7960/#p7960</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: İnternetten dosya indirmek]]></title>
			<link rel="alternate" href="http://www.fox4um.com/post/1222/#p1222"/>
			<content type="html"><![CDATA[<p>ben de kullandığım kodu gönderiyorum
</p><p>***Commandbuton clik
<br />SET CURSOR OFF
<br />Set Safety Off
</p><p>Wait &quot;İnternetten Dosyalar Alınıyor. Bekleyiniz.&quot; window at 10,41 timeout 5
</p><p>ftpx=&quot;ftp.xxxxxx.com&quot;
<br />adix=&quot;ftpdenbil&quot;
<br />sifrex=&quot;1denbil&quot;
<br />ftpdekidosyax=&quot;xxxxxxxx/xxxxxxxx.zip&quot;
<br />cdekiyerix=&quot;C:\xxxxxx\xxxxxx.zip&quot;
</p><p>do ftpdosyaal with ftpx,adix,sifrex,ftpdekidosyax,cdekiyerix
</p><p>Wait &quot;Dosyalar Alındı. Yükleme Yapılıyor.&quot; window at 10,41 nowait
</p><p>SET SAFETY ON
<br />SET cursor on
</p><p>Wait &quot;Yükleme İşlemi Tamamlandı.&quot; window at 10,41 timeout 5
<br />Wait clear 
<br />****
<br />function ftpdosyaal
<br />LParameter furl, fuser, fpwd, fdosya1, fdosya2
<br />* furl : Bağlantı yapılacak ftp adresi. Örnek: <a href="ftp://ftp.okul.com">ftp.okul.com</a> *
<br />* fuser : Kullanıcı adı. Örnek: okulyonetimi *
<br />* fpwd : Şifre. Örnek: 1453 *
<br />* fdosya1 : FTP &#039;deki dosya yeri ve adı *
<br />* fdosya2 : Bilgisayardaki dosya yeri ve adı *
</p><p>#Define ERROR_INTERNET_EXTENDED_ERROR 12003
<br />#Define ERROR_NO_MORE_FILES 18
<br />#Define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200
<br />#Define FORMAT_MESSAGE_FROM_SYSTEM 0x00001000
<br />#Define INTERNET_OPEN_TYPE_PRECONFIG 0
<br />#Define INTERNET_SERVICE_FTP 1
<br />#Define GENERIC_READ 0x80000000
<br />#Define INTERNET_DEFAULT_FTP_PORT 21 &amp;&amp; FTP serverlar için default değer.
</p><p>#Define MESAJ_KUTUSU 2 &amp;&amp; 0 Gösterme, 1 Messagebox, 2 Wait Window Nowait
<br />#Define TRANSFER_MODU 2 &amp;&amp; 1 ASCII, 2 BINARY
</p><p>* Parametreler kontrol eddiliyor.
<br />If Type(&quot;furl&quot;) # &quot;C&quot;
<br />furl=&quot;&quot;
<br />Else
<br />furl=AllTrim(furl)
<br />Endif
</p><p>If Type(&quot;fuser&quot;) # &quot;C&quot;
<br />fuser=&quot;&quot;
<br />Else
<br />fuser=AllTrim(fuser)
<br />Endif
</p><p>If Type(&quot;fpwd&quot;) # &quot;C&quot;
<br />fpwd=&quot;&quot;
<br />Else
<br />fpwd=AllTrim(fpwd)
<br />Endif
</p><p>If Type(&quot;fdosya1&quot;) # &quot;C&quot;
<br />fdosya1=&quot;&quot;
<br />Else
<br />fdosya1=AllTrim(fdosya1)
<br />Endif
</p><p>If Type(&quot;fdosya2&quot;) # &quot;C&quot;
<br />fdosya2=&quot;&quot;
<br />Else
<br />fdosya2=AllTrim(fdosya2)
<br />Endif
</p><p>*Active X ler Yükleniyor
<br />Declare integer InternetConnect in &quot;wininet.dll&quot; ;
<br />integer hInternetSession, string @ sServerName, integer nServerPort, ;
<br />string @ sUsername, string @ sPassword, integer dwService, ;
<br />integer dwFlags, integer dwContext
</p><p>Declare integer InternetOpen in &quot;wininet.dll&quot; ;
<br />string @ sAgent, integer dwAccessType, string @ sProxyName, ;
<br />string @ sProxyBypass, integer dwFlags
</p><p>Declare integer InternetCloseHandle in &quot;wininet.dll&quot; integer hInet
</p><p>Declare integer InternetWriteFile in &quot;wininet.dll&quot; ;
<br />integer hFile, string @ sBuffer, integer lNumBytesToWite, ;
<br />integer @ dwNumberOfBytesWritten
</p><p>Declare short InternetReadFile in &quot;wininet.dll&quot; ;
<br />integer hFile, string @ lpBuffer, integer dwNumberOfBytesToRead, ;
<br />integer @lpdwNumberOfBytesRead
</p><p>Declare integer FtpOpenFile in &quot;wininet.dll&quot; ;
<br />integer hFtpSession, string @ sFileName, integer AccessType, ;
<br />integer Flags, integer Context
</p><p>Declare integer FtpGetFileSize in &quot;wininet.dll&quot; ;
<br />integer hFile, integer @lpdwFileSizeHigh
</p><p>Declare short FtpGetFile in &quot;wininet.dll&quot; ;
<br />integer hFtpSession, string @ lpszRemoteFile, string @ lpszNewFile, ;
<br />short fFailIfExists, integer dwFlagsAndAttributes, integer dwFlags, ;
<br />integer dwContext
</p><p>Declare short InternetGetLastResponseInfo in &quot;wininet.dll&quot; ;
<br />integer @ lpdwError, string @ lpszErrorBuffer, integer @ lpdwErrorBufferLength
</p><p>Declare integer FormatMessage in &quot;kernel32&quot; ;
<br />integer dwFlags, string @ lpSource, integer dwMessageId, ;
<br />integer dwLanguageId, string @ lpBuffer, integer nSize, ;
<br />string @ Arguments
</p><p>Declare integer GetLastError in win32API
</p><p>* Test Bağlantı yapılıyor.
<br />Public hOpen, dwSemantic, hConnection
<br />hOpen = InternetOpen(&quot;My Test&quot;, INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0)
<br />If hOpen = 0
<br />Messagebox(&quot;İnternet Başlatılamıyor. İnternet Bağlantılarınızı Kontrol Ediniz.&quot;, 48, &quot;Uyarı&quot;)
<br />Return
<br />Endif
<br />dwSemantic = 0
<br />hConnection = 0
</p><p>*Bağlantı kuruluyor.
<br />If Empty(furl)
<br />Messagebox(&quot;URL Adresinizi Kontrol Ediniz. Örnek : <a href="ftp://ftp.okul.com">ftp.okul.com</a>&quot;, 48, &quot;Uyarı&quot;)
<br />Return
<br />Endif
</p><p>If Empty(fuser)
<br />Messagebox(&quot;Kullanıcı Adı Bilgisini Kontrol Ediniz. Örnek : okulyonetimi&quot;, 48, &quot;Uyarı&quot;)
<br />Return
<br />Endif
</p><p>If Empty(fpwd)
<br />Messagebox(&quot;Şifre Bilgisini Kontrol Ediniz. Örnek : 12345&quot;, 48, &quot;Uyarı&quot;)
<br />Return
<br />Endif
</p><p>If hConnection # 0
<br />InternetCloseHandle(hConnection)
<br />Endif
</p><p>hConnection = InternetConnect(hOpen, furl, INTERNET_DEFAULT_FTP_PORT, fuser, fpwd, ;
<br />INTERNET_SERVICE_FTP, dwSemantic, 0)
</p><p>If hConnection = 0
<br />=FtpResponse(&#039;Server FTP bağlantısı sağlanamıyor.&#039;)
<br />Else
<br />=FtpResponse(&#039;Bağlantı kuruldu.&#039;)
<br />Endif
</p><p>*Dosya Alınıyor.
<br />If Empty(fdosya1)
<br />&nbsp; &nbsp;Messagebox(&quot;FTP &#039;deki Dosya Yeri Ve Adını Belirtmelisiniz. Örnek: db/okul.mdb&quot;, 48, &quot;Uyarı&quot;)
<br />Return
<br />Endif
</p><p>If Empty(fdosya2)
<br />&nbsp; &nbsp;Messagebox(&quot;Bilgisayardaki Dosya Yeri Ve Adını Belirtmelisiniz. Örnek: c:\data\okul.mdb&quot;, 48, &quot;Uyarı&quot;)
<br />Return
<br />Endif
</p><p>hFile = FtpOpenFile(hConnection, fdosya1, GENERIC_READ, TRANSFER_MODU, 0)
<br />If hFile = 0
<br />&nbsp; &nbsp;=FTPResponse(&quot;FTP Sunucusunda Dosya Açılamıyor.&quot;)
<br />&nbsp; &nbsp;Return
<br />Endif
</p><p>lpdwFileSizeHigh = 0
<br />lnSize = FtpGetFileSize(hFile, lpdwFileSizeHigh)
<br />lnSize = lnSize + lpdwFileSizeHigh * (0xFFFFFFFF+1)
<br />hOut = FCreate(fdosya2)
<br />lnBytesWritten = 0
<br />Do While lnBytesWritten &lt; lnSize
<br />&nbsp; &nbsp;lpdwNumberOfBytesRead = 0
<br />&nbsp; &nbsp;lcRead = space(100)
<br />&nbsp; &nbsp;If InternetReadFile(hFile, @lcRead, 100, @lpdwNumberOfBytesRead) = 0
<br />&nbsp; &nbsp; &nbsp; =FTPResponse(&quot;FTP Sunucunuzdaki Dosya Okunamıyor.&quot;)
<br />&nbsp; &nbsp; &nbsp; Return
<br />&nbsp; &nbsp;Endif
<br />&nbsp; &nbsp;lnBytesWritten = lnBytesWritten + FWrite(hOut,lcRead,lpdwNumberOfBytesRead)
<br />Enddo
<br />=FClose(hOut)
<br />InternetCloseHandle(hFile)
<br />=FTPResponse(&#039;Dosya Alma İşlemi Tamamlandı&#039;)
</p><p>Release hOpen, dwSemantic, hConnection
<br />Clear Dlls
<br />Inkey(2)
<br />Wait clear 
<br />Return 
<br />********************
<br />*FTP Hata mesajları
<br />********************
<br />Procedure FTPRESPONSE
<br />Lparameters tcMsg
<br />local szString, dwTemp,buflen,lcMessage, lnError
<br />szString = space(2048)
<br />dwTemp = 0
<br />buflen = 2048
<br />lnError = GetLastError()
<br />If !InList(lnError,0,ERROR_NO_MORE_FILES)
<br />lcMessage = ErrorInfo(lnError)
<br />Else
<br />If InternetGetLastResponseInfo(@dwTemp, @szString, @buflen) = 0 and buflen &gt; 2048
<br />szString = Space(buflen)
<br />InternetGetLastResponseInfo(@dwTemp, @szString, @buflen)
<br />Endif
<br />lcMessage = SubStr(szString, 1, buflen)
<br />Endif
<br />Do Case
<br />Case MESAJ_KUTUSU = 1
<br />*Messagebox(tcMsg+Chr(13)+lcMessage, 48, &quot;Uyarı&quot;)
<br />Messagebox(tcmsg, 48, &quot;Uyarı&quot;)
<br />Case MESAJ_KUTUSU = 2
<br />*Wait Window tcMsg+Chr(13)+lcMessage NoWait
<br />*Wait Window tcmsg NoWait timeout 5
<br />Wait tcmsg window at 10,41 NoWait timeout 5
<br />EndCase
<br />Return 
<br />********************
<br />*Hata kodlarının tespiti
<br />********************
<br />Procedure ERRORINFO
<br />LParameters dwError
<br />Local szString, dwTemp, buflen, szErrorMessage,dwRet, Arguments
<br />szString = space(2048)
<br />dwTemp = 0
<br />buflen = 2048
<br />If (dwError = ERROR_INTERNET_EXTENDED_ERROR)
<br />If InternetGetLastResponseInfo(@dwTemp, @szString, @buflen) # 0
<br />Return SubStr(szString, 1, buflen)
<br />Else
<br />szString = Space(buflen)
<br />InternetGetLastResponseInfo(@dwTemp, @szString, @buflen)
<br />Return SubStr(szString, 1, buflen)
<br />Endif 
<br />Else
<br />lnRet = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM+FORMAT_MESSAGE_IGNORE_INSERTS, ;
<br />0, dwError, 0, @szString, 2048, 0)
<br />if lnRet # 0 
<br />szErrorMessage = &quot;Error code: &quot; + ;
<br />TransForm(dwError) + &quot; Message: &quot; + SubStr(szString, 1, lnRet)
<br />Return szErrorMessage
<br />Endif
<br />EndIf
</p><p>Return &#039;&#039;
<br />********************</p>]]></content>
			<author>
				<name><![CDATA[smentes]]></name>
				<uri>http://www.fox4um.com/user/7/</uri>
			</author>
			<updated>2007-02-05T15:24:22Z</updated>
			<id>http://www.fox4um.com/post/1222/#p1222</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: İnternetten dosya indirmek]]></title>
			<link rel="alternate" href="http://www.fox4um.com/post/1221/#p1221"/>
			<content type="html"><![CDATA[<p>var tabii , eski bir yontem hazir elime gecti onu ornekliyorum burada
</p><p>asagidaki bir custom class kodu 
</p><p>kullanilisi
</p><p>class ı form üzerine surukleyip bırakıyorsun , form uzerine bir label kontrolu koyuyorsun
</p><p>* label caption 
</p><p><a href="http://www.espor.com/aa.zip">www.espor.com/aa.zip</a>
</p><p>* label click event
</p><p>&amp;&amp; e-mail linki
<br />&amp;&amp;IF !EMPTY(This.Tag) AND TYPE(&#039;ThisForm.Webexplorer1&#039;) = &#039;O&#039;
<br />&amp;&amp;&nbsp; &nbsp; ThisForm.Webexplorer1.SendMail(This.Tag)
<br />&amp;&amp; ENDIF&nbsp; &nbsp; 
</p><p>IF !EMPTY(This.Tag) AND TYPE(&#039;ThisForm.Webexplorer1&#039;) = &#039;O&#039;
<br />&nbsp; &nbsp; ThisForm.Webexplorer1.Showpage(This.Tag)
<br />ENDIF&nbsp; &nbsp; 
</p><p>* label tag 
</p><p><a href="http://www.espor.com/aa.zip">www.espor.com/aa.zip</a>
</p><p>* label tooltiptext &amp;&amp;kullanmayada bilirsin
</p><p>=this.tag
</p>
<br /><div class="codebox"><div class="head">Visual Fox Pro</div><table class="visualfoxpro fxcode"><tbody><tr class="li1"><td class="ln"><pre class="de1">1
<br />2
<br />3
<br />4
<br />5
<br />6
<br />7
<br />8
<br />9
<br />10
<br />11
<br />12
<br />13
<br />14
<br />15
<br />16
<br />17
<br />18
<br />19
<br />20
<br />21
<br />22
<br />23
<br />24
<br />25
<br />26
<br />27
<br />28
<br />29
<br />30
<br />31
<br />32
<br />33
<br />34
<br />35
<br />36
<br />37
<br />38
<br />39
<br />40
<br />41
<br />42
<br />43
<br />44
<br />45
<br />46
<br />47
<br />48
<br />49
<br />50
<br />51
<br />52
<br />53
<br />54
<br />55
<br />56
<br />57
<br />58
<br />59
<br />60
<br />61
<br />62
<br />63
<br />64
<br />65
<br />66
<br />67
<br />68
<br />69
<br />70
<br />71
<br />72
<br />73
<br />74
<br />75
<br />76
<br />77
<br />78
<br />79
<br />80
<br />81
<br />82
<br />83
<br />84
<br />85
<br />86
<br />87
<br />88
<br />89
<br />90
<br />91
<br />92
<br />93
<br />94
<br />95
<br />96
<br />97
<br />98
<br />99
<br />100
<br />101
<br />102
<br />103
<br />104
<br />105
<br />106
<br />107
<br />108
<br />109
<br />110
<br />111
<br />112
<br />113
<br />114
<br />115
<br />116
<br />117
<br />118
<br />119
<br />120
<br />121
<br />122
<br />123
<br />124
<br /></pre></td><td class="de1"><pre class="de1"><span class="sy0">**************************************************</span>
<br /><span class="sy0">*--</span> <span class="kw3">Class</span><span class="sy0">:</span> &nbsp; &nbsp; &nbsp; &nbsp;webexplorer <span class="br0">&#40;</span>d<span class="sy0">:</span>\soykan\mysoftware\emin_elk\lib\webexplorer<span class="sy0">.</span><span class="me1">vcx</span><span class="br0">&#41;</span>
<br /><span class="sy0">*--</span> <span class="kw4">ParentClass</span><span class="sy0">:</span> &nbsp;<span class="kw4">custom</span>
<br /><span class="sy0">*--</span> <span class="kw3">BaseClass</span><span class="sy0">:</span> &nbsp; &nbsp;<span class="kw4">custom</span>
<br /><span class="sy0">*--</span> <span class="kw3">Time</span> Stamp<span class="sy0">:</span> &nbsp; 07<span class="sy0">/</span><span class="nu0">26</span><span class="sy0">/</span><span class="nu0">99</span> 04<span class="sy0">:</span><span class="nu0">48</span><span class="sy0">:</span>02 PM
<br /><span class="sy0">*--</span> <span class="kw1">Call</span> Internet Explorer<span class="sy0">,</span> send e<span class="sy0">-</span><span class="kw2">mail</span>
<br /><span class="sy0">*</span>
<br /><span class="kw1">#INCLUDE</span> <span class="st0">&quot;c:<span class="es0">\p</span>rogram files<span class="es0">\m</span>icrosoft visual studio<span class="es0">\v</span>fp98<span class="es0">\f</span>oxpro.h&quot;</span>
<br /><span class="sy0">*</span>
<br /><span class="kw1">DEFINE</span> <span class="kw3">CLASS</span> webexplorer <span class="kw2">AS</span> <span class="kw4">custom</span>
<br />&nbsp;
<br />&nbsp;
<br />&nbsp; &nbsp; <span class="kw1">PROTECTED</span> nlasterr
<br />&nbsp; &nbsp; nlasterr <span class="sy0">=</span> <span class="nu0">0</span>
<br />&nbsp; &nbsp; <span class="kw4">Name</span> <span class="sy0">=</span> <span class="st0">&quot;webexplorer&quot;</span>
<br />&nbsp; &nbsp; <span class="kw1">PROTECTED</span> oexplorer
<br />&nbsp; &nbsp; <span class="kw1">PROTECTED</span> bnotsupport
<br />&nbsp;
<br />&nbsp;
<br />&nbsp; &nbsp; <span class="kw1">PROCEDURE</span> showpage
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">LPARAMETERS</span> tcURL
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">IF</span> <span class="kw2">This</span><span class="sy0">.</span><span class="me1">bNotSupport</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">RETURN</span> <span class="sy0">.</span><span class="kw2">F</span><span class="sy0">.</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDIF</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">IF</span> <span class="kw2">VARTYPE</span><span class="br0">&#40;</span>tcURL<span class="br0">&#41;</span> # 'C' <span class="kw3">OR</span> <span class="kw4">EMPTY</span><span class="br0">&#40;</span>tcURL<span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">RETURN</span> <span class="sy0">.</span><span class="kw2">F</span><span class="sy0">.</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDIF</span>
<br />&nbsp;
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">IF</span> <span class="kw2">VARTYPE</span><span class="br0">&#40;</span><span class="kw2">This</span><span class="sy0">.</span><span class="me1">oExplorer</span><span class="br0">&#41;</span> # 'O' <span class="kw3">OR</span> <span class="kw1">ISNULL</span><span class="br0">&#40;</span><span class="kw2">This</span><span class="sy0">.</span><span class="me1">oExplorer</span><span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">This</span><span class="sy0">.</span><span class="me1">nLastErr</span> <span class="sy0">=</span> <span class="nu0">0</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">This</span><span class="sy0">.</span><span class="me1">oExplorer</span> <span class="sy0">=</span> <span class="kw1">GetObject</span><span class="br0">&#40;</span><span class="sy0">,</span>'InternetExplorer<span class="sy0">.</span><span class="kw3">Application</span>'<span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">IF</span> <span class="kw2">VARTYPE</span><span class="br0">&#40;</span><span class="kw2">This</span><span class="sy0">.</span><span class="me1">oExplorer</span><span class="br0">&#41;</span> # 'O' <span class="kw3">OR</span> <span class="kw1">ISNULL</span><span class="br0">&#40;</span><span class="kw2">This</span><span class="sy0">.</span><span class="me1">oExplorer</span><span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">This</span><span class="sy0">.</span><span class="me1">oExplorer</span> <span class="sy0">=</span> <span class="kw1">CreateObject</span><span class="br0">&#40;</span>'InternetExplorer<span class="sy0">.</span><span class="kw3">Application</span>'<span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDIF</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">IF</span> <span class="kw2">VARTYPE</span><span class="br0">&#40;</span><span class="kw2">This</span><span class="sy0">.</span><span class="me1">oExplorer</span><span class="br0">&#41;</span> # 'O' <span class="kw3">OR</span> <span class="kw1">ISNULL</span><span class="br0">&#40;</span><span class="kw2">This</span><span class="sy0">.</span><span class="me1">oExplorer</span><span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">This</span><span class="sy0">.</span><span class="me1">bNotSupport</span> <span class="sy0">=</span> <span class="sy0">.</span><span class="kw3">T</span><span class="sy0">.</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">RETURN</span> <span class="sy0">.</span><span class="kw2">F</span><span class="sy0">.</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDIF</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDIF</span>
<br />&nbsp;
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">This</span><span class="sy0">.</span><span class="me1">nLastErr</span> <span class="sy0">=</span> <span class="nu0">0</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">WITH</span> <span class="kw2">This</span><span class="sy0">.</span><span class="me1">oExplorer</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">.</span><span class="me1">Navigate</span><span class="br0">&#40;</span>tcURL<span class="sy0">,,</span><span class="st0">&quot;_self&quot;</span><span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">WITH</span> <span class="kw2">This</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">IF</span> <span class="sy0">.</span><span class="me1">nLastErr</span> <span class="sy0">=</span> <span class="nu0">1426</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">.</span><span class="me1">nLastErr</span> <span class="sy0">=</span> <span class="nu0">0</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">.</span><span class="me1">oExplorer</span> <span class="sy0">=</span> <span class="kw3">NULL</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">RETURN</span> <span class="sy0">.</span><span class="me1">ShowPage</span><span class="br0">&#40;</span>tcURL<span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDIF</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDWITH</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">IF</span> <span class="sy0">!.</span><span class="kw4">Visible</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">.</span><span class="kw4">Visible</span> <span class="sy0">=</span> <span class="sy0">.</span><span class="kw3">T</span><span class="sy0">.</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDIF</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetForegroundWindow<span class="br0">&#40;</span><span class="sy0">.</span><span class="kw4">HWND</span><span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDWITH</span>
<br />&nbsp;
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">RETURN</span> <span class="sy0">.</span><span class="kw3">T</span><span class="sy0">.</span>
<br />&nbsp; &nbsp; <span class="kw1">ENDPROC</span>
<br />&nbsp;
<br />&nbsp;
<br />&nbsp; &nbsp; <span class="kw1">PROCEDURE</span> sendmail
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">#DEFINE</span> SW_SHOWNORMAL &nbsp; <span class="nu0">1</span>
<br />&nbsp;
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">LPARAMETERS</span> tcAddress
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">IF</span> <span class="kw2">VARTYPE</span><span class="br0">&#40;</span>tcAddress<span class="br0">&#41;</span> # 'C' <span class="kw3">OR</span> <span class="kw4">EMPTY</span><span class="br0">&#40;</span>tcAddress<span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">RETURN</span> <span class="sy0">.</span><span class="kw2">F</span><span class="sy0">.</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDIF</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">LOCAL</span> lhWnd<span class="sy0">,</span> lnRetVal<span class="sy0">,</span> lcAddress
<br />&nbsp; &nbsp; &nbsp; &nbsp; lhWnd <span class="sy0">=</span> FindWindow<span class="br0">&#40;</span><span class="kw3">NULL</span><span class="sy0">,</span> <span class="kw2">_SCREEN</span><span class="sy0">.</span><span class="kw3">Caption</span><span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; lcAddress <span class="sy0">=</span> <span class="kw1">ALLTRIM</span><span class="br0">&#40;</span>tcAddress<span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">IF</span> <span class="kw1">ATC</span><span class="br0">&#40;</span><span class="st0">&quot;mailto:&quot;</span><span class="sy0">,</span> <span class="kw2">LOWER</span><span class="br0">&#40;</span>lcAddress<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">=</span> <span class="nu0">0</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lcAddress <span class="sy0">=</span> <span class="st0">&quot;mailto:&quot;</span><span class="sy0">+</span>lcAddress
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDIF</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; lnRetVal <span class="sy0">=</span> ShellExecute<span class="br0">&#40;</span>lhWnd<span class="sy0">,</span> <span class="kw3">NULL</span><span class="sy0">,</span> lcAddress<span class="sy0">,</span> <span class="kw3">NULL</span><span class="sy0">,</span> <span class="kw3">NULL</span><span class="sy0">,</span> SW_SHOWNORMAL<span class="br0">&#41;</span>
<br />&nbsp; &nbsp; <span class="kw1">ENDPROC</span>
<br />&nbsp;
<br />&nbsp;
<br />&nbsp; &nbsp; <span class="kw1">PROCEDURE</span> <span class="kw3">Destroy</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">This</span><span class="sy0">.</span><span class="me1">oExplorer</span> <span class="sy0">=</span> <span class="kw3">NULL</span>
<br />&nbsp; &nbsp; <span class="kw1">ENDPROC</span>
<br />&nbsp;
<br />&nbsp;
<br />&nbsp; &nbsp; <span class="kw1">PROCEDURE</span> <span class="kw3">Init</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">DECLARE</span> <span class="kw2">INTEGER</span> SetForegroundWindow <span class="kw2">IN</span> Win32API <span class="sy0">;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">LONG</span> <span class="kw4">hWnd</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">DECLARE</span> <span class="kw2">LONG</span> FindWindow <span class="kw2">IN</span> Win32API <span class="sy0">;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">STRING</span> lpClassName<span class="sy0">;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">,</span><span class="kw3">STRING</span> lpWindowName
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">DECLARE</span> <span class="kw2">INTEGER</span> ShellExecute <span class="kw2">IN</span> shell32 <span class="sy0">;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">LONG</span> <span class="kw4">hwnd</span><span class="sy0">;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">,</span><span class="kw3">STRING</span> lpOperation<span class="sy0">;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">,</span><span class="kw3">STRING</span> lpFile<span class="sy0">;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">,</span><span class="kw3">STRING</span> lpParameters<span class="sy0">;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">,</span><span class="kw3">STRING</span> lpDirectory<span class="sy0">;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">,</span><span class="kw2">INTEGER</span> nShowCmd
<br />&nbsp; &nbsp; <span class="kw1">ENDPROC</span>
<br />&nbsp;
<br />&nbsp;
<br />&nbsp; &nbsp; <span class="kw1">PROCEDURE</span> <span class="kw3">Error</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">LPARAMETERS</span> nError<span class="sy0">,</span> cMethod<span class="sy0">,</span> nLine
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">IF</span> <span class="kw2">VARTYPE</span><span class="br0">&#40;</span>nError<span class="br0">&#41;</span> # '<span class="kw2">N</span>'
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nError <span class="sy0">=</span> <span class="nu0">0</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDIF</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">DO</span> <span class="kw1">CASE</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">CASE</span> nerror <span class="sy0">=</span> <span class="nu0">1733</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">NODEFAULT</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">ACTIVATE</span> <span class="kw3">SCREEN</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">?</span><span class="kw1">CHR</span><span class="br0">&#40;</span><span class="nu0">7</span><span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">MessageBox</span><span class="br0">&#40;</span><span class="st0">&quot;Æàëü, íî íà Âàøåé ìàøèíå íåò ïîääåğæêè Èíòåğíåò.&quot;</span><span class="sy0">,</span> <span class="nu0">16</span><span class="sy0">,</span> <span class="kw2">This</span><span class="sy0">.</span><span class="kw4">Name</span><span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">RETURN</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">CASE</span> nError <span class="sy0">=</span> <span class="nu0">1426</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">This</span><span class="sy0">.</span><span class="me1">nLastErr</span> <span class="sy0">=</span> nError
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">NODEFAULT</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">RETURN</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">OTHERWISE</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">RETURN</span> <span class="kw1">DODEFAULT</span><span class="br0">&#40;</span>nError<span class="sy0">,</span> cMethod<span class="sy0">,</span> nLine<span class="br0">&#41;</span>
<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ENDCASE</span>
<br />&nbsp; &nbsp; <span class="kw1">ENDPROC</span>
<br />&nbsp;
<br />&nbsp;
<br /><span class="kw1">ENDDEFINE</span>
<br /><span class="sy0">*</span>
<br /><span class="sy0">*--</span> <span class="kw1">EndDefine</span><span class="sy0">:</span> webexplorer
<br /><span class="sy0">**************************************************</span></pre></td></tr></tbody></table></div>]]></content>
			<author>
				<name><![CDATA[soykanozcelik]]></name>
				<uri>http://www.fox4um.com/user/4/</uri>
			</author>
			<updated>2007-02-05T14:18:08Z</updated>
			<id>http://www.fox4um.com/post/1221/#p1221</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: İnternetten dosya indirmek]]></title>
			<link rel="alternate" href="http://www.fox4um.com/post/1220/#p1220"/>
			<content type="html"><![CDATA[<p>Soykan çok teşekkür ederim.
<br />Ancak FTP kullanmadan da örneğin <a href="http://www.espor.com.tr/aa.zip">http://www.espor.com.tr/aa.zip</a> isimli dosyayı hard diskte istediğim bir yere download etmenin bir yolu varmı?</p>]]></content>
			<author>
				<name><![CDATA[espor]]></name>
				<uri>http://www.fox4um.com/user/48/</uri>
			</author>
			<updated>2007-02-05T12:49:21Z</updated>
			<id>http://www.fox4um.com/post/1220/#p1220</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: İnternetten dosya indirmek]]></title>
			<link rel="alternate" href="http://www.fox4um.com/post/1219/#p1219"/>
			<content type="html"><![CDATA[<p>selam Bilal,
</p><p>FTP get ile indirebilirsin
</p><div class="codebox"><div class="head">Visual Fox Pro</div><table class="visualfoxpro fxcode"><tbody><tr class="li1"><td class="ln"><pre class="de1">1
<br />2
<br />3
<br />4
<br />5
<br />6
<br />7
<br />8
<br />9
<br />10
<br />11
<br />12
<br />13
<br />14
<br />15
<br />16
<br />17
<br />18
<br />19
<br />20
<br />21
<br />22
<br />23
<br />24
<br />25
<br />26
<br />27
<br />28
<br />29
<br />30
<br />31
<br />32
<br />33
<br />34
<br />35
<br />36
<br />37
<br />38
<br />39
<br />40
<br />41
<br />42
<br />43
<br />44
<br />45
<br />46
<br />47
<br />48
<br />49
<br />50
<br />51
<br />52
<br />53
<br />54
<br />55
<br />56
<br />57
<br />58
<br />59
<br />60
<br />61
<br />62
<br />63
<br />64
<br />65
<br />66
<br />67
<br />68
<br />69
<br />70
<br />71
<br />72
<br />73
<br />74
<br />75
<br />76
<br />77
<br />78
<br />79
<br />80
<br />81
<br />82
<br />83
<br />84
<br />85
<br />86
<br />87
<br />88
<br />89
<br />90
<br />91
<br />92
<br />93
<br />94
<br />95
<br />96
<br />97
<br />98
<br />99
<br />100
<br />101
<br />102
<br />103
<br />104
<br /></pre></td><td class="de1"><pre class="de1"><span class="sy0">**********************************************************************************</span>
<br /><span class="sy0">*...</span> <span class="me1">FTPGet</span><span class="sy0">.</span><span class="me1">PRG</span> <span class="sy0">...*</span>
<br />&nbsp;
<br /><span class="kw1">PARAMETERS</span> lcHost<span class="sy0">,</span> lcUser<span class="sy0">,</span> lcPwd<span class="sy0">,</span> lcRemoteFile<span class="sy0">,</span> lcNewFile<span class="sy0">,</span> lnXFerType &nbsp; &nbsp; 
<br />&nbsp;
<br /><span class="sy0">*.................................................................................</span>
<br /><span class="sy0">*:</span> &nbsp; Usage<span class="sy0">:</span> <span class="kw1">DO</span> ftpget <span class="kw1">WITH</span> <span class="sy0">;</span>
<br /><span class="sy0">*:</span> &nbsp; &nbsp; &nbsp; &nbsp; '<span class="br0">&#91;</span>url<span class="sy0">=</span>ftp<span class="sy0">:</span><span class="co1">//ftp.host]ftp.host[/url]', 'name', 'password', 'source.file', 'target.file'[, 1 | 2]</span>
<br /><span class="sy0">*:</span>
<br /><span class="sy0">*:</span> &nbsp;<span class="kw3">Where</span><span class="sy0">:</span> &nbsp;lcHost &nbsp; &nbsp; &nbsp; <span class="sy0">=</span> Host computer IP address <span class="kw3">or</span> <span class="kw4">name</span>
<br /><span class="sy0">*:</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lcUser &nbsp; &nbsp; &nbsp; <span class="sy0">=</span> user <span class="kw4">name</span> <span class="sy0">-</span> anonymous may be <span class="kw2">used</span>
<br /><span class="sy0">*:</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lcPwd &nbsp; &nbsp; &nbsp; &nbsp;<span class="sy0">=</span> <span class="kw3">password</span>
<br /><span class="sy0">*:</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lcRemoteFile <span class="sy0">=</span> source <span class="kw2">file</span> <span class="kw4">name</span>
<br /><span class="sy0">*:</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lcNewFile &nbsp; &nbsp;<span class="sy0">=</span> <span class="kw2">target</span> <span class="kw2">file</span> <span class="kw4">name</span>
<br /><span class="sy0">*:</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lnXFerType &nbsp; <span class="sy0">=</span> <span class="nu0">1</span> <span class="br0">&#40;</span><span class="kw3">default</span><span class="br0">&#41;</span> <span class="kw1">for</span> <span class="kw2">ascii</span><span class="sy0">,</span> <span class="nu0">2</span> <span class="kw1">for</span> binary
<br /><span class="sy0">*.................................................................................</span>
<br />&nbsp;
<br /><span class="sy0">*...</span><span class="kw2">set</span> up API calls
<br /><span class="kw1">DECLARE</span> <span class="kw2">INTEGER</span> InternetOpen <span class="kw2">IN</span> wininet<span class="sy0">;</span>
<br />&nbsp; &nbsp;<span class="kw3">STRING</span> sAgent<span class="sy0">,</span> <span class="kw2">INTEGER</span> lAccessType<span class="sy0">,</span> <span class="kw3">STRING</span> sProxyName<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw3">STRING</span> sProxyBypass<span class="sy0">,</span> <span class="kw3">STRING</span> &nbsp;lFlags
<br />&nbsp;
<br /><span class="kw1">DECLARE</span> <span class="kw2">INTEGER</span> InternetCloseHandle <span class="kw2">IN</span> wininet <span class="kw2">INTEGER</span> hInet
<br />&nbsp;
<br /><span class="kw1">DECLARE</span> <span class="kw2">INTEGER</span> InternetConnect <span class="kw2">IN</span> wininet<span class="sy0">.</span><span class="kw1">DLL</span><span class="sy0">;</span>
<br />&nbsp; &nbsp;<span class="kw2">INTEGER</span> hInternetSession<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw3">STRING</span> &nbsp;lcHost<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw2">INTEGER</span> nServerPort<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw3">STRING</span> &nbsp;lcUser<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw3">STRING</span> &nbsp;lcPassword<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw2">INTEGER</span> lService<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw2">INTEGER</span> lFlags<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw2">INTEGER</span> lContext
<br />&nbsp;
<br /><span class="kw1">DECLARE</span> <span class="kw2">INTEGER</span> FtpGetFile <span class="kw2">IN</span> wininet<span class="sy0">;</span>
<br />&nbsp; &nbsp;<span class="kw2">INTEGER</span> hftpSession<span class="sy0">,</span> <span class="sy0">;</span>
<br />&nbsp; &nbsp;<span class="kw3">STRING</span> &nbsp;lcRemoteFile<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw3">STRING</span> &nbsp;lcNewFile<span class="sy0">,</span> <span class="sy0">;</span>
<br />&nbsp; &nbsp;<span class="kw2">INTEGER</span> fFailIfExists<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw2">INTEGER</span> dwFlagsAndAttributes<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="kw2">INTEGER</span> dwFlags<span class="sy0">,</span> <span class="sy0">;</span>
<br />&nbsp; &nbsp;<span class="kw2">INTEGER</span> dwContext
<br />&nbsp;
<br />lcHost &nbsp; &nbsp; &nbsp; <span class="sy0">=</span> <span class="kw1">ALLTRIM</span><span class="br0">&#40;</span>lcHost<span class="br0">&#41;</span> 
<br />lcUser &nbsp; &nbsp; &nbsp; <span class="sy0">=</span> <span class="kw1">ALLTRIM</span><span class="br0">&#40;</span>lcUser<span class="br0">&#41;</span>
<br />lcPwd &nbsp; &nbsp; &nbsp; &nbsp;<span class="sy0">=</span> <span class="kw1">ALLTRIM</span><span class="br0">&#40;</span>lcPwd<span class="br0">&#41;</span>
<br />lcRemoteFile <span class="sy0">=</span> <span class="kw1">ALLTRIM</span><span class="br0">&#40;</span>lcRemoteFile<span class="br0">&#41;</span>
<br />lcNewFile &nbsp; &nbsp;<span class="sy0">=</span> <span class="kw1">ALLTRIM</span><span class="br0">&#40;</span>lcNewFile<span class="br0">&#41;</span>
<br />&nbsp;
<br />sAgent <span class="sy0">=</span> <span class="st0">&quot;vfp&quot;</span>
<br />&nbsp;
<br />sProxyName <span class="sy0">=</span> <span class="kw1">CHR</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span> &nbsp; &nbsp; <span class="sy0">&amp;&amp;...</span> <span class="me1">no</span> proxy
<br />sProxyBypass <span class="sy0">=</span> <span class="kw1">CHR</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span> &nbsp; <span class="sy0">&amp;&amp;...</span> <span class="me1">nothing</span> <span class="kw3">to</span> bypass
<br />lFlags <span class="sy0">=</span> <span class="nu0">0</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sy0">&amp;&amp;...</span> <span class="me1">no</span> flags <span class="kw2">used</span>
<br />&nbsp;
<br /><span class="sy0">*...</span> <span class="me1">initialize</span> <span class="kw1">access</span> <span class="kw3">to</span> Inet functions
<br />hOpen <span class="sy0">=</span> InternetOpen <span class="br0">&#40;</span>sAgent<span class="sy0">,</span> <span class="nu0">1</span><span class="sy0">,;</span>
<br />&nbsp; &nbsp;sProxyName<span class="sy0">,</span> sProxyBypass<span class="sy0">,</span> lFlags<span class="br0">&#41;</span>
<br />&nbsp;
<br /><span class="kw1">IF</span> hOpen <span class="sy0">=</span> <span class="nu0">0</span>
<br />&nbsp; &nbsp;<span class="kw2">WAIT</span> WINDOW &nbsp;<span class="st0">&quot;Unable to get access to WinInet.Dll&quot;</span> <span class="kw3">TIMEOUT</span> <span class="nu0">2</span>
<br />&nbsp; &nbsp;<span class="kw2">RETURN</span>
<br /><span class="kw1">ENDIF</span>
<br />&nbsp;
<br /><span class="sy0">*...</span> <span class="me1">The</span> first '<span class="nu0">0</span>' says <span class="kw2">use</span> the <span class="kw3">default</span> port<span class="sy0">,</span> usually 21<span class="sy0">.</span>
<br /><span class="me1">hftpSession</span> <span class="sy0">=</span> InternetConnect <span class="br0">&#40;</span>hOpen<span class="sy0">,</span> lcHost<span class="sy0">,;</span>
<br />&nbsp; &nbsp;<span class="nu0">0</span><span class="sy0">,</span> lcUser<span class="sy0">,</span> lcPwd<span class="sy0">,</span> <span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="nu0">0</span><span class="br0">&#41;</span> &nbsp; <span class="sy0">&amp;&amp;...</span> <span class="nu0">1</span> <span class="sy0">=</span> ftp protocol
<br />&nbsp;
<br /><span class="kw1">IF</span> hftpSession <span class="sy0">=</span> <span class="nu0">0</span>
<br />&nbsp; &nbsp;<span class="sy0">*...</span> <span class="kw1">close</span> <span class="kw1">access</span> <span class="kw3">to</span> Inet functions <span class="kw2">and</span> <span class="kw1">exit</span>
<br />&nbsp; &nbsp;<span class="sy0">=</span> InternetCloseHandle <span class="br0">&#40;</span>hOpen<span class="br0">&#41;</span>
<br />&nbsp; &nbsp;<span class="kw2">WAIT</span> WINDOW <span class="st0">&quot;Unable to connect to &quot;</span> <span class="sy0">+</span> lcHost <span class="sy0">+</span> '<span class="sy0">.</span>' <span class="kw3">TIMEOUT</span> <span class="nu0">2</span>
<br />&nbsp; &nbsp;<span class="kw2">RETURN</span>
<br /><span class="kw1">ELSE</span>
<br />&nbsp; &nbsp;<span class="kw2">WAIT</span> WINDOW <span class="st0">&quot;Connected to &quot;</span> <span class="sy0">+</span> lcHost <span class="sy0">+</span> <span class="st0">&quot; as: [&quot;</span> <span class="sy0">+</span> lcUser <span class="sy0">+</span> <span class="st0">&quot;]&quot;</span> &nbsp;<span class="kw3">TIMEOUT</span> <span class="nu0">1</span>
<br /><span class="kw1">ENDIF</span>
<br />&nbsp;
<br /><span class="sy0">*...</span> <span class="nu0">0</span> <span class="kw3">to</span> automatically <span class="kw3">overwrite</span> <span class="kw2">file</span>
<br /><span class="sy0">*...</span> <span class="nu0">1</span> <span class="kw3">to</span> fail <span class="kw1">if</span> <span class="kw2">file</span> already <span class="kw2">exists</span>
<br />fFailIfExists &nbsp;<span class="sy0">=</span> <span class="nu0">0</span> &nbsp;
<br />dwContext &nbsp; &nbsp; &nbsp;<span class="sy0">=</span> <span class="nu0">0</span> &nbsp;<span class="sy0">&amp;&amp;...</span> <span class="kw2">used</span> <span class="kw1">for</span> callback
<br />&nbsp;
<br /><span class="kw2">WAIT</span> WINDOW 'Transferring ' <span class="sy0">+</span> lcRemoteFile <span class="sy0">+</span> ' <span class="kw3">to</span> ' <span class="sy0">+</span> lcNewFile <span class="sy0">+</span> '<span class="sy0">...</span>' <span class="kw3">NOWAIT</span> 
<br />lnResult <span class="sy0">=</span> FtpGetFile <span class="br0">&#40;</span>hftpSession<span class="sy0">,</span> lcRemoteFile<span class="sy0">,</span> lcNewFile<span class="sy0">,;</span>
<br />&nbsp; &nbsp;fFailIfExists<span class="sy0">,</span> <span class="nu0">128</span><span class="sy0">,</span> lnXFerType<span class="sy0">,;</span>
<br />&nbsp; &nbsp;dwContext<span class="br0">&#41;</span>
<br />&nbsp;
<br /><span class="sy0">*...</span> <span class="nu0">128</span> <span class="sy0">=</span> <span class="kw1">#define</span> FILE_ATTRIBUTE_NORMAL &nbsp; &nbsp; 0x00000080 
<br /><span class="sy0">*...</span> <span class="me1">See</span> CreateFile <span class="kw1">for</span> other <span class="kw2">attributes</span>
<br />&nbsp;
<br /><span class="sy0">*</span> <span class="kw1">close</span> handles
<br /><span class="sy0">=</span> InternetCloseHandle <span class="br0">&#40;</span>hftpSession<span class="br0">&#41;</span>
<br /><span class="sy0">=</span> InternetCloseHandle <span class="br0">&#40;</span>hOpen<span class="br0">&#41;</span>
<br />&nbsp;
<br /><span class="kw1">IF</span> lnResult <span class="sy0">=</span> <span class="nu0">1</span>
<br />&nbsp; &nbsp;<span class="sy0">*...</span> <span class="me1">successful</span> download<span class="sy0">,</span> <span class="kw1">do</span> what you want here
<br />&nbsp; &nbsp;<span class="kw2">WAIT</span> WINDOW '<span class="kw1">Completed</span><span class="sy0">.</span>' <span class="kw3">TIMEOUT</span> <span class="nu0">1</span>
<br />&nbsp; &nbsp;<span class="sy0">*</span> MODI <span class="kw2">FILE</span> <span class="br0">&#40;</span>lcNewFile<span class="br0">&#41;</span>
<br /><span class="kw1">ELSE</span>
<br />&nbsp; &nbsp;<span class="kw2">WAIT</span> WINDOW &nbsp;<span class="st0">&quot;Unable to download selected file&quot;</span> <span class="kw3">TIMEOUT</span> <span class="nu0">2</span>
<br /><span class="kw1">ENDIF</span>
<br />&nbsp;
<br /><span class="kw2">RETURN</span>
<br /><span class="sy0">***</span> <span class="kw1">End</span> <span class="kw3">of</span> ftpGet<span class="sy0">.</span><span class="me1">PRG</span> <span class="sy0">*************************************************************</span></pre></td></tr></tbody></table></div>]]></content>
			<author>
				<name><![CDATA[soykanozcelik]]></name>
				<uri>http://www.fox4um.com/user/4/</uri>
			</author>
			<updated>2007-02-05T11:32:16Z</updated>
			<id>http://www.fox4um.com/post/1219/#p1219</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[İnternetten dosya indirmek]]></title>
			<link rel="alternate" href="http://www.fox4um.com/post/1218/#p1218"/>
			<content type="html"><![CDATA[<p>Merhaba.
<br />Belli bir url deki dosyayı bilgisayarda sitediğimiz bir klasöre vfp içinden kullanıcıya bulaşmadan download edebilirmiyiz?
<br />Teşekkürler.</p>]]></content>
			<author>
				<name><![CDATA[espor]]></name>
				<uri>http://www.fox4um.com/user/48/</uri>
			</author>
			<updated>2007-02-05T09:36:50Z</updated>
			<id>http://www.fox4um.com/post/1218/#p1218</id>
		</entry>
</feed>

