FF Lesezeichen auslesen

    • VB6

      FF Lesezeichen auslesen

      Viellt. kann das ja jmd gebrauchen. (Leicht zu .NET umwandelbar)

      Quellcode

      1. Option Explicit
      2. Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
      3. Private Sub Form_Load()
      4. Text1.Text = FirefoxBM
      5. End Sub
      6. Private Function FirefoxBM() As String
      7. Dim fPath As String
      8. Dim sPath As String
      9. Dim sLen As Long
      10. Dim fData As String
      11. Dim sFiles As String
      12. Dim sFile As String
      13. Dim oSplit() As String
      14. On Error GoTo fail:
      15. fPath = Environ$("APPDATA") & "\Mozilla\Firefox\profiles.ini"
      16. sPath = Space(&HFF)
      17. sLen = GetPrivateProfileString("Profile0", "Path", vbNullString, sPath, &HFF, fPath)
      18. sPath = Left$(fPath, Len(fPath) - 12) & Left$(sPath, sLen) & "\bookmarkbackups\"
      19. sPath = Replace(sPath, "/", "\")
      20. If DirExists(sPath) = False Then GoTo fail
      21. sFiles = Dir(sPath & "*.json")
      22. While Len(sFiles) > 0
      23. sFile = sFiles
      24. sFiles = Dir
      25. Wend
      26. Dim F As Integer
      27. F = FreeFile
      28. Open sPath & sFile For Binary As #F
      29. fData = String(LOF(F), vbNullChar)
      30. Get #F, , fData
      31. Close #F
      32. oSplit = Split(fData, Chr(34) & "uri" & Chr(34) & ":" & Chr(34))
      33. For sLen = 0 To UBound(oSplit)
      34. fData = Left(oSplit(sLen), InStr(oSplit(sLen), """") - 1) & vbNewLine
      35. If InStr(fData, "http") > 0 Then FirefoxBM = FirefoxBM & fData
      36. Next sLen
      37. Exit Function
      38. fail:
      39. FirefoxBM = "Error"
      40. End Function
      41. Private Function DirExists(ByVal DirectoryName As String) As Boolean
      42. On Error Resume Next
      43. DirExists = CBool(GetAttr(DirectoryName) And vbDirectory)
      44. On Error GoTo 0
      45. End Function


      funktioniert mit momentan neuester FF version
      Für ein Mindestmaß an Rechtschreibung, Interpunktion und Majuskeln!