Jump to content
xisto Community
Sign in to follow this  
zachtk8702

[tutorial] Visual Basic 6 Downloading Images From A Webpage Downloading Images from a webpage

Recommended Posts

Here's how to grab an image off the internet easily. You'll need an Inet on your form to do this. You can always get rid of your string variables and substitute the actual strings:

Code:

Dim localFile As StringDim remoteFile As StringDim fNum As LongDim b() As ByteremoteFile = "https://www.salesforce.com/products/platform/overview/ = "C:\image.jpg"      fNum = FreeFileb() = Inet1.OpenURL(remoteFile, icByteArray)Open localFile For Binary As #fNumPut #fNum, , b()Close #fNumMsgBox "Done"

Hope this helps.
Notice from jlhaslip:
added code bbcode

Share this post


Link to post
Share on other sites

oooo I love VB. I dont have there latest version but I think I have 6. I have made tons of programs for various things in it that I have released to the public. I know most of that stuff but some stuff I havnt seen before. Nice tut. :D

Share this post


Link to post
Share on other sites

Good tutorial! This code can do a lot more than download images, it can download any file type that you want, too. I haven't written in VB for a while, but shouldn't freefile have a set of parenthesises? Good job!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.