Results 1 to 4 of 4

Thread: Internet URLS

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    44

    Question

    How Can I Use A PictureBox Like This:
    Picture1.Picture = "http://www.tha-nolia.com/image1.jpg"?
    I Think I Might Dont Know The Answer To That One...

  2. #2
    Guest
    Why not just use a WebBrowser control?
    Code:
    WebBrowser1.Navigate "http://www.tha-nolia.com/image1.jpg"

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    44
    I Dont Want To Use The WebBrowser Control, I Want Some API Code.
    I Think I Might Dont Know The Answer To That One...

  4. #4
    Guest
    Use the URLDownloadToFile API function.


    Code:
    Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
        "URLDownloadToFileA" (ByVal pCaller As Long, _
        ByVal szURL As String, _
        ByVal szFileName As String, _
        ByVal dwReserved As Long, _
        ByVal lpfnCB As Long) As Long
    
    
    Private Function DownloadFile(URL As String, _
        LocalFilename As String) As Boolean
    
        Dim lngRetVal As Long
        
        lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
        
        If lngRetVal = 0 Then DownloadFile = True
    
    End Function
    
    
    Private Sub Command1_Click()
    
        Dim DF As Boolean
        DF = DownloadFile("http://www.tha-nolia.com/image1.jpg", "c:\image1.jpg")
        If DF = True Then
            Picture1.Picture = LoadPicture("c:\image1.jpg")
        End If
    
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width