Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Webbrowser - how to save image (jpg)
Message
De
19/06/2013 16:16:37
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01576604
Message ID:
01576734
Vues:
58
>>Hi !
>>After a long period...
>>
>>I'm using webbrowser for quite a while, but this is the first time I need to save an image (jpg) to disk.
>>I have this image in the webbrowser screen and I wonder how to programmatically save it to disk.
>>
>>Looking forward for any help.
>>Thanks
>>Dany
>
>You probably can adapt this to the webbrowser
>
>
Local lcFolderDest,Doc
>o = Createobject('internetexplorer.application')
>o.Navigate('www.microsoft.com')
>lcFolderDest = 'c:\temp\'
>Inkey(3)
>
>Doc = o.Document
>For Each element In Doc.images
>	DownloadPicture( lcFolderDest, element.src)
>	DoEvents
>Endfor
>Procedure DownloadPicture(tcDestDir,src)
>	Local loRequest, lcUrl, lcFilename
>	lcUrl =src
>	lcFilename = tcDestDir+justfname(src)
>
>	loRequest = Createobject('MsXml2.XmlHttp')
>	loRequest.Open("GET",lcUrl,.F.)
>	loRequest.Send()
>	Strtofile(loRequest.ResponseBody,lcFilename)
>Endproc
Mike,
Thanks!
I'll try and let you know.
Merci encore une fois !
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform