Results 1 to 7 of 7

Thread: [RESOLVED] INET get local file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    150

    Resolved [RESOLVED] INET get local file

    Im trying to get a webpage on my Hard Drive. I have tried

    VB Code:
    1. sHtml = Inet1.OpenURL("file:///c:\My Files\Web.htm")

    but it does not work!

    sHTML ends up containing nothing

  2. #2
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Re: INET get local file

    what happens if you remove the file:/// portion?

    are you trying to view the source, or view the actual page?

    if you're trying to get the source, why can't you just open the file for input?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    150

    Re: INET get local file

    I could open it for input but that would mean I would have to add more code. If possible I want to just use this (as it normally downloads from a webpage.). If I remove the file:/// it says Error: address malformed!

  4. #4
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Re: INET get local file

    Doesn't using the inet control make your executable bigger anyway? For the sake of 3 lines of code ->

    VB Code:
    1. Open "X" For Input As #1
    2. sHtml = Input(LOF(1), 1)
    3. Close #1

    Perhaps try /'s instead of \'s in the address - if you still want to persist with the inet control

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    150

    Re: INET get local file

    Well I will still like to see if i can use it. but if it does not work I will use the Open for input

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    150

    Re: INET get local file

    I also have another reason for using it as it appears to add another return chacter to my lines compared to INET which means I would have to change some of my code to make it work

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    150

    Re: INET get local file

    I have been told that it is not possible to open a local file with INET unless I'm using a Web server app.

    Thanks

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