我想知道的是
文件下载下来以后放在哪?
我们怎么指定目录?
谢谢!
在你程序默认的目录下
有人说VFP不行了,我想说,你连VFP十分之一的功能都不会用,你怎么知道VFP不行?本人拒绝回答学生的问题我回答问题一般情况下只提供思路不提供代码,请理解
这VFP的DLL还不跟PRG一个样(有点脱裤子放P),搞什么2句BUILD就是DLL了.
Parameters Inter_Url,LocalFile
Declare Integer InternetOpen In wininet;
STRING sAgent, Integer lAccessType, String sProxyName,;
STRING sProxyBypass, String lFlags
Declare Integer InternetOpenUrl In wininet;
INTEGER hInternet,;
STRING lpszUrl,;
STRING lpszHeaders,;
INTEGER dwHeadersLength,;
INTEGER dwFlags,;
INTEGER dwContext
Declare Integer InternetReadFile In wininet;
INTEGER hFile,;
STRING @ lpBuffer,;
INTEGER dwNumberOfBytesToRead,;
INTEGER @ lpdwNumberOfBytesRead
Declare Integer InternetCloseHandle In wininet Integer hInet
Url_Open = InternetOpen(Inter_Url, 1, Chr(0), Chr(0), 0) &&本地初始化
If Url_Open=0
Clear Dlls
Retu -1 &&'本地初始化失败'
Endif
Url_Session = InternetOpenUrl (Url_Open, Inter_Url, "", 2, 16, 0)
If Url_Session=0
= InternetCloseHandle(Url_Open)
Clear Dlls
Retu -2 &&'网址不能打开'
Endif
Url_Fopen = Fcreate (LocalFile)
If (Url_Fopen = -1)
= InternetCloseHandle(Url_Session)
= InternetCloseHandle(Url_Open)
Clear Dlls
Return -3 &&'指定的目标档无效'
Endif
Url_SizeSum = 0
Url_ReadBuffer = Repli(Chr(0), 4096)
Do While .T.
Url_ReadBye = 0
If InternetReadFile (Url_Session, @Url_ReadBuffer, 4096, @Url_ReadBye) = 1
If Url_ReadBye = 0
Exit
Else
= Fwrite (Url_Fopen, Url_ReadBuffer, Url_ReadBye)
Endif
Url_SizeSum = Url_SizeSum + Url_ReadBye
If Url_SizeSum>1024^2
thisform.labUrlsize.Caption ='正在接收 '+allt(str(Url_SizeSum/1024^2,10,3))+'M……'
INKEY(0.001)
Else
thisform.labUrlsize.Caption ='正在接收 '+allt(str(Url_SizeSum/1024 ))+'K……'
INKEY(0.001)
Endif
Else
Exit
Endif
Enddo
= Fclose (Url_Fopen)
= InternetCloseHandle(Url_Session)
= InternetCloseHandle(Url_Open)
Clear Dlls
Return Url_SizeSum