Results 1 to 6 of 6

Thread: .URL attributes?

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2003
    Location
    South Yorkshire, England
    Posts
    52

    .URL attributes?

    does anybody know how I would extract the URL from the files saved in the IE favourites list?

    The .URL files IE saves it as just seems to have the html code for that site. I would like to be able to get the address for that site...

    any ideas welcome
    Is the answer 42?
    -----BEGIN GEEK CODE BLOCK-----
    Version: 3.1
    GCS/O dpu(-)@ s++:+ a-->? C+++>--@ UL>B++++ P+>++++ L+(--) E--- W++>+++ N
    o? K- w+++>+++++$ O--->---- M->-- V? PS+ PE Y? PGP--- t+(-) 5? X-(++) R*
    tv++>! b+ DI+++>++++>+++++ D++ G>+++ e*>+++++ h!(*)>++ r%>$ x+>$
    ------END GEEK CODE BLOCK------

  2. #2
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    The ".URL" is essentially an INI file, so the INI file manipulation APIs will retrieve/set the data.
    VB Code:
    1. Option Explicit
    2. Private Declare Function GetPrivateProfileString Lib "kernel32" _
    3. Alias "GetPrivateProfileStringA" _
    4. (ByVal lpApplicationName As String, _
    5. ByVal lpKeyName As Any, _
    6. ByVal lpDefault As String, _
    7. ByVal lpReturnedString As String, _
    8. ByVal nSize As Long, _
    9. ByVal lpFileName As String) As Long
    10.  
    11. Private Sub Form_Load()
    12.  
    13. Dim File As String, Str As String * 255
    14.  
    15.  
    16. File = "D:\Documents and Settings\MeIMyself\Favorites\KJ\InstallShield.URL"
    17.  
    18. Call GetPrivateProfileString("InternetShortcut", "URL", "", Str, 255, File)
    19. MsgBox Str
    20.  
    21. End Sub
    HTH

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2003
    Location
    South Yorkshire, England
    Posts
    52
    thanks a lot KayJat, but is the only way to do it with API?
    Is the answer 42?
    -----BEGIN GEEK CODE BLOCK-----
    Version: 3.1
    GCS/O dpu(-)@ s++:+ a-->? C+++>--@ UL>B++++ P+>++++ L+(--) E--- W++>+++ N
    o? K- w+++>+++++$ O--->---- M->-- V? PS+ PE Y? PGP--- t+(-) 5? X-(++) R*
    tv++>! b+ DI+++>++++>+++++ D++ G>+++ e*>+++++ h!(*)>++ r%>$ x+>$
    ------END GEEK CODE BLOCK------

  4. #4
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    Well...You could open up the ".URL" file as plain text (view it in Notepad to get to know the general layput) and parse out the "[SECTION_NAME]" followed by "KEYNAME=" and finally by the Value of that Key.

    API's are easier to use, IMO

    Regards

    KayJay

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2003
    Location
    South Yorkshire, England
    Posts
    52
    I can remember when I first mentioned API's to my tutor, he told me to stay away from them until I have a much more solid base.. and arn't api's kinda cheating?

    Thanks a lot though KayJay
    Is the answer 42?
    -----BEGIN GEEK CODE BLOCK-----
    Version: 3.1
    GCS/O dpu(-)@ s++:+ a-->? C+++>--@ UL>B++++ P+>++++ L+(--) E--- W++>+++ N
    o? K- w+++>+++++$ O--->---- M->-- V? PS+ PE Y? PGP--- t+(-) 5? X-(++) R*
    tv++>! b+ DI+++>++++>+++++ D++ G>+++ e*>+++++ h!(*)>++ r%>$ x+>$
    ------END GEEK CODE BLOCK------

  6. #6
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    APIs aren't cheating. They're just a quicker way to get what you're doing done. Besides, that's why the functions are there - so you don't have to reinvent the [slower] wheel.

    Another way you could do this is by using VB's file functions.
    Please rate my post.

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