Jul 26, 2008

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

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > VB Programming

free web hosting

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

zachtk8702
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:
CODE

Dim localFile As String
Dim remoteFile As String
Dim fNum As Long
Dim b() As Byte

remoteFile = "http://www.site.com/image.jpg"
localFile = "C:\image.jpg"
  
  
fNum = FreeFile

b() = Inet1.OpenURL(remoteFile, icByteArray)

Open localFile For Binary As #fNum
Put #fNum, , b()
Close #fNum

MsgBox "Done"


Hope this helps.
Notice from jlhaslip:
added code bbcode

 

 

 


Reply

maddog39
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. biggrin.gif

Reply

ghostrider
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!

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : visual, basic, 6, downloading, images, webpage, downloading, images, webpage

  1. Mysql In Visual Basic
    Mysql in visual basic (5)
  2. Beginning Visual Basic
    (4)
    CAn anyone give me a guide on VB? I've decided to learn it and I need something to work with....
    thanks ....
  3. My Guidewriter
    Simple Visual Basic program to aid in making guides (3)
    I wrote this about 3 months ago for a different forum (Runescape Forums, one I'm currently a
    G-Mod of. ) and I figured I'd share it with you. All it is, is a text editor with built in
    buttons and menus for adding BBCodes. For example, if you wanted to make something bold, you type
    what you want, highlight it, find bold in the text menu and click it. The nicest thing is, you
    can save, and you don't have to worry about a forum failing after taking hours to write a guide.
    I highly suggest you try it if you write guides often, the members on RsForums really lo....
  4. Some Visual Basic 6.0 Uncompleted Projects
    (2)
    hi friends, i have some good complete and incomplete projects in visual basic 6.0. and now i
    want to sale them for some credit points. 100 credit points only....
  5. Visual Basic And Internet Transmission
    is it possible to encrypt a http request? (2)
    I've used VB before which is why im asking this in the VB forum and not any other forum because
    i know with any other language other than PHP i have no chance so i dont actually know if this is
    possible with VB WHat i want to do is change a HTTP request that is sent to a server so that a web
    filter cannot understand it and block the request. Before anyone says that i shouldnt do that its
    hacking etc...its not...im only doing it to see if it can be done. if i wanted to get around a
    filter i wouldnt bother making my own tool I'd use someone else (skript kiddy-ish ....
  6. Visual Basic 6
    (5)
    Well currently I have the working model edition for Visual Basic 6.0 which won't allow me to
    make .exe files. I was looking into buying the Learning Edition but I can't find it cheap or in
    stock anywhere. I want to try and find it for under $100 used or new. If anyone has it, and
    would like to make the .exe file for me if I send you the files that would be great, or if anyone
    could help me find it for cheap.....
  7. Visual Basic Express Edition Beta
    How does it work? (2)
    Hey, I'm using (sorta) Visual Basic Express Edition Beta 2 (long name, eh?), but I can't
    find any good tutorials on it; all of them are for visual basic.net... Is this the same thing? I
    don't think so, and if I'm right, where can I go to get help for it?....
  8. Visual Basic 6.0 Help Needed
    Adding lines to a textbox without delete (13)
    I need help with Visual Basic 6.0 and adding lines to a textbox without deleting any previous
    lines.. I've gotten as far as finding a way to add the lines, but it deletes the prevous entree.
    Help is appreciated!....
  9. Parsing A List In A Webpage Help
    Need Webpage Parsing Help (1)
    Hey I want to parse a list in a webpage.......Im not too hot with parsing overall but I figured this
    would be the best place to ask for help..... For example if the HTML was CODE <tr>
    <td>1</td><td><A target="_self" href=#><font
    color=#ff0000>Number1</font></a><td><font face=verdana
    size=2>IDNUMBER1</td> <td><A target="_self" href=#><font
    color=#ff0000>Number2</font></a><td><font face=verdana
    size=2>61506....
  10. Free Copy Of Visual Studio.net Pro
    STUDENTS ONLY (11)
    Visit THE SPOKE for your free copy of Visual Studio.NET.....
  11. [tutorial] Visual Basic 6 Minimize To Tray
    Minimize to Tray (4)
    This example will "minimize" your program to the system tray when you click on a button, and restore
    it when you click the system tray icon. For this example you'll need: 1 Form - Form1 1 button -
    Command1 Add a Module to your project, and ad this code: CODE ' Create an Icon in System
    Tray Needs Public Type NOTIFYICONDATA cbSize As Long hwnd As Long uId As Long uFlags As Long
    uCallBackMessage As Long hIcon As Long szTip As String * 64 End Type Public Const NIM_ADD = &H0
    Public Const NIM_MODIFY = &H1 Public Const NIM_DELETE = &H2 Public Const WM_MOUSEMOVE ....
  12. [tutorial] Visual Basic 6 Removing List Duplicates
    Removing List Duplicates (2)
    Removing duplicates from lists is something that you'll have to put up with if you're, say,
    parsing names off Outwar. Many delete-duplicate for...next loops are very slow, especially when you
    have thousands of names to loop through several thousand times for each name on the list. This
    function that I made is, in my opinion, the best and quickest way to do it without too many annoying
    and slow for loops (good for lists 1k +). It compares lstA to lstB. Anything that is in both lists
    is added to lstC. To change it so that anything that isn't in both lists is ....

    1. Looking for visual, basic, 6, downloading, images, webpage, downloading, images, webpage

Searching Video's for visual, basic, 6, downloading, images, webpage, downloading, images, webpage
advertisement



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



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE