VB.net Projekt funktioniert nicht

  • VB.NET

Es gibt 21 Antworten in diesem Thema. Der letzte Beitrag () ist von TheGameSiders.

    VB.net Projekt funktioniert nicht

    Hi.

    Ich habe ein Projekt gefunden was mich an sich sehr interessiert.
    Dieses hier ist es:

    Klick

    Das wurde in VB.net gemacht.

    In VB 2010 konnte ich es auch problemlos konvertieren.

    Dannach ist aber bei jedem der Projekte (Sind mehrere in der zip) sind 0 Fehler, aber 102 Warnungen.

    Ich kann das Programm ohne Fehler starten, und auch den Server (Anhang) starten.

    Leider kann ich mich mit FileZilla trotzdem nicht verbinden.

    Warum?

    Hab dann mal die anderen Projekte getestet, und die gingen auch nicht..

    Hab das FTP Projekt mal hochgeladen.

    Die anderen sind alle im Link oben.

    Danke für Hilfe!

    Mfg. TGS
    Dateien
    • ftp_server.rar

      (116,8 kB, 101 mal heruntergeladen, zuletzt: )
    Warnung 1 Die TConnection-Variable wird übergeben, bevor ihr ein Wert zugewiesen wird. Zur Laufzeit kann eine Nullverweisausnahme auftreten. Stellen Sie sicher, dass die Struktur oder alle Verweismember vor der Verwendung initialisiert werden. C:\Users\Asus\Desktop\ftp_server\ftp_server\BaseServer.vb 414 32 WindowsApplication1


    Das ist alles was ich an Fehlern finde :)

    EDIT: Sorry 102 Fehler Uppps
    :D Ein Programm sollte nicht nur Hand und Fuß, sondern auch Herz und Hirn haben. (Michael Anton) :D

    MFG Jörg ;)

    Muss jeder vermeintliche Programmierer ne Signatur haben ??
    So hab jetzt mal einen richtigen Pfad beim FTP Projekt eingegeben.
    Bei FileZilla komm ich nun soweit:

    Spoiler anzeigen
    Status: Verbinde mit 127.0.0.1:21...
    Status: Verbindung hergestellt, warte auf Willkommensnachricht...
    Antwort: 220 VB.Net FTP Server ready (Version 1.0).
    Befehl: USER anonymous
    Antwort: 331 Password required for anonymous.
    Befehl: PASS **************
    Antwort: 230 User anonymous logged in.
    Befehl: SYST
    Antwort: 215 UNIX Type: L8 VB.Net FTP Server
    Befehl: FEAT
    Antwort: 500 FEAT: command not understood.
    Status: Server does not support non-ASCII characters.
    Status: Verbunden
    Status: Empfange Verzeichnisinhalt...
    Befehl: PWD
    Antwort: 257 "\" is current directory.
    Befehl: TYPE I
    Antwort: 200 Type set to I.
    Befehl: PASV
    Fehler: Zeitüberschreitung der Verbindung
    Fehler: Verzeichnisinhalt konnte nicht empfangen werden


    In der Zeit steht bei VB:

    Spoiler anzeigen
    Sent to Client: 220 VB.Net FTP Server ready (Version 1.0).
    Eine Ausnahme (erste Chance) des Typs "System.InvalidOperationException" ist in System.Windows.Forms.dll aufgetreten.
    IN from Client: |USER=anonymous|
    Sent to Client: 331 Password required for anonymous.
    IN from Client: |PASS=anon@localhost|
    Sent to Client: 230 User anonymous logged in.
    IN from Client: |SYST=|
    Sent to Client: 215 UNIX Type: L8 VB.Net FTP Server
    IN from Client: |FEAT=|
    Sent to Client: 500 FEAT: command not understood.
    IN from Client: |PWD=|
    Sent to Client: 257 "\" is current directory.
    IN from Client: |TYPE=I|
    Sent to Client: 200 Type set to I.
    IN from Client: |PASV=|
    Eine Ausnahme (erste Chance) des Typs "System.InvalidOperationException" ist in System.Windows.Forms.dll aufgetreten.


    Kann man da was machen? Bzw. gibts so ein Projekt auch für vb 2010?

    Danke.

    Mfg. TGS
    Wo genau änder ich den?

    Ich sehe grade, dass der Macher alle Server in der BaseServer.vb Klasse hat.

    Der Abschnitt für FTP sieht unter anderem so aus:

    VB.NET-Quellcode

    1. 'FTP Server uses the file transfer protocol to transfer files (Port 21 Default)
    2. Public Class FTPServer
    3. Public Structure FTPClient
    4. Dim Username As String 'the clients username
    5. Dim Password As String 'the clients password
    6. Dim Authenticated As Boolean 'if the client has logged in
    7. Dim RootDirectory As String 'the starting directory for the client
    8. Dim CurrentDirectory As String 'the current directory the client is in
    9. Dim CurrentFile As String 'the current file the client is working with
    10. Dim LocalFile As String 'the local name of the current file
    11. Dim LocalFileOffset As Integer 'the starting position of the file
    12. Dim LocalDirectory As String 'the local name of the current directory
    13. Dim CurrentCommand As String 'the command the client last sent
    14. Dim CommandParams As String 'the parms the client sent with last comand
    15. Dim LastReponse As String 'the last response we sent the client
    16. Dim AllowAction As Boolean 'flag T/F to allow / deny the client action (reset per command)
    17. Dim Passive As Boolean 'T/F client is in passive mode
    18. Dim IP As String 'the IP of the client to connect to
    19. Dim Port As Integer 'the port of the client to connect to
    20. Dim FTPDataSocket_NORM As TcpClient() 'sock used to connect to client in normal mode
    21. Dim FTPDataSocket_PASV As TcpListener 'socket used to listen for client in passive mode
    22. End Structure
    23. Public Structure FTPResponseCodes
    24. Const msgDftBanner = "220 Server von Weiss nicht."
    25. Const msgTooMuchClients = "421 Too many users connected."
    26. Const msgCmdUnknown = "500 %s: command not understood."
    27. Const msgLoginFailed = "530 Login incorrect."
    28. Const msgNotLogged = "530 Please login with USER and PASS."
    29. Const msgNoUser = "503 Login with USER first."
    30. Const msgLogged = "230 User %s logged in."
    31. Const msgPassRequired = "331 Password required for %s."
    32. Const msgCWDSuccess = "250 CWD command successful. %s is current directory."
    33. Const msgCWDFailed = "501 CWD failed. %s"
    34. Const msgPWDSuccess = "257 %s is current directory."
    35. Const msgQuit = "221 Goodbye."
    36. Const msgPortSuccess = "200 Port command successful."
    37. Const msgPortFailed = "501 Invalid PORT command."
    38. Const msgStorDisabled = "500 Cannot STOR."
    39. Const msgStorSuccess = "150 Opening data connection for %s."
    40. Const msgStorFailed = "501 Cannot STOR. %s"
    41. Const msgStorAborted = "426 Connection closed %s."
    42. Const msgStorOk = "226 File received ok"
    43. Const msgStorError = "426 Connection closed transfer aborted. Error #%d"
    44. Const msgRetrDisabled = "500 Cannot RETR."
    45. Const msgRetrSuccess = "150 Opening data connection for %s."
    46. Const msgRetrFailed = "501 Cannot RETR. %s"
    47. Const msgRetrAborted = "426 Connection closed %s."
    48. Const msgRetrOk = "226 File sent ok"
    49. Const msgRetrError = "426 Connection closed transfer aborted. Error #%d"
    50. Const msgSystem = "215 UNIX Type: L8 VB.Net FTP Server"
    51. Const msgDirOpen = "150 Opening data connection for directory list."
    52. Const msgDirFailed = "451 Failed: %s."
    53. Const msgTypeOk = "200 Type set to %s."
    54. Const msgTypeFailed = "500 TYPE %s: command not understood."
    55. Const msgDeleNotExists = "550 %s: no such file or directory."
    56. Const msgDeleOk = "250 File %s deleted."
    57. Const msgDeleFailed = "450 File %s cant be deleted."
    58. Const msgDeleSyntax = "501 Syntax error in parameter."
    59. Const msgDeleDisabled = "500 Cannot DELE."
    60. Const msgRnfrNotExists = "550 %s: no such file or directory."
    61. Const msgRnfrSyntax = "501 Syntax error is parameter."
    62. Const msgRnfrOk = "350 File exists, ready for destination name."
    63. Const msgRntoNotExists = "550 %s: no such file or directory."
    64. Const msgRntoAlready = "553 %s: file already exists."
    65. Const msgRntoOk = "250 File %s renamed to %d."
    66. Const msgRntoFailed = "450 File %s cant be renamed."
    67. Const msgRntoSyntax = "501 Syntax error in parameter."
    68. Const msgMkdOk = "257 %s: directory created."
    69. Const msgMkdAlready = "550 %s: file or directory already exists."
    70. Const msgMkdFailed = "550 %s: cant create directory."
    71. Const msgMkdSyntax = "501 Syntax error in parameter."
    72. Const msgRmdOk = "250 %s: directory removed."
    73. Const msgRmdNotExists = "550 %s: no such directory."
    74. Const msgRmdFailed = "550 %s: cant remove directory."
    75. Const msgRmdSyntax = "501 Syntax error in parameter."
    76. Const msgNoopOk = "200 Ok. Parameter was %s."
    77. Const msgAborOk = "225 ABOR command successful."
    78. Const msgPasvLocal = "227 Entering Passive Mode (127,0,0,1,%d,%d)."
    79. Const msgPasvRemote = "227 Entering Passive Mode (%d,%d,%d,%d,%d,%d)."
    80. Const msgPasvExcept = "500 PASV exception: %s."
    81. Const msgSizeOk = "213 %d"
    82. Const msgSizeFailed = "550 Command failed: %s."
    83. Const msgSizeSyntax = "501 Syntax error in parameter."
    84. Const msgRestOk = "350 REST supported. Ready to resume at byte offset %d."
    85. Const msgRestZero = "501 Required byte offset parameter bad or missing."
    86. Const msgRestFailed = "501 Syntax error in parameter: %s."
    87. Const msgAppeFailed = "550 APPE failed."
    88. Const msgAppeSuccess = "150 Opening data connection for %s (append)."
    89. Const msgAppeDisabled = "500 Cannot APPE."
    90. Const msgAppeAborted = "426 Connection closed %s."
    91. Const msgAppeOk = "226 File received ok"
    92. Const msgAppeError = "426 Connection closed transfer aborted. Error #%d"
    93. Const msgAppeReady = "150 APPE supported. Ready to append file %s at offset %d."
    94. Const msgStruOk = "200 Ok. STRU parameter %s ignored."
    95. Const msgSendComplete = "226 Transfer complete"
    96. Const msgSendFailed = "501 Transfer Failed"
    97. Const msgSendDirStart = "150 Opening ASCII mode data connection for %s."
    98. Dim iInstance As Integer
    99. End Structure
    100. Public WithEvents cServer As New BaseServer()
    101. Public Event StatusUpdate(ByVal sStatus As String)
    102. Public Event DataReceived(ByVal sender As UserConnection, ByVal Data As String)
    103. Public Event ClientConnected(ByVal sender As UserConnection)
    104. Public Event ClientDisConnected(ByVal sender As UserConnection)
    105. Public Event ClientLogin(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'after client sends USER and PASS
    106. Public Event ClientLogout(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'when client quits
    107. Public Event ClientAction(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'called on any action
    108. Public Event Client_CWD(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'change current directory
    109. Public Event Client_CDUP(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'go up one directory
    110. Public Event Client_MKD(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'make a directory
    111. Public Event Client_NLST(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'short dir list
    112. Public Event Client_REST(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'restart the file position
    113. Public Event Client_DELE(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'client wants to delete a file
    114. Public Event Client_RETR(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'download a file
    115. Public Event Client_STOR(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'upload a file
    116. Public Event Client_RMD(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'delete a directory
    117. Public Event Client_RNFR(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'rename file from
    118. Public Event Client_RNTO(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'rename file to
    119. Public Event Client_PORT(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'client sends us the connection info
    120. Public Event Client_PASV(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'client enters a passive state
    121. Public Event Client_LIST(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'client wants info on a file or dir
    122. Public Event Client_HELP(ByVal sender As UserConnection, ByRef TFTPClient As FTPClient) 'client wants a list of allowed commands
    123. Private Sub cServer_ClientConnected(ByVal sender As UserConnection) Handles cServer.ClientConnected
    124. RaiseEvent ClientConnected(sender)
    125. Dim aFTPSTRUCT As FTPClient
    126. Dim sFTPResponse As FTPResponseCodes
    127. aFTPSTRUCT.AllowAction = True
    128. aFTPSTRUCT.CurrentCommand = "/"
    129. sender.sExtraValues = aFTPSTRUCT
    130. SendFTPResponse(sender, sFTPResponse.msgDftBanner)
    131. End Sub
    132. Private Sub cServer_ClientDisConnected(ByVal sender As UserConnection) Handles cServer.ClientDisConnected
    133. RaiseEvent ClientDisConnected(sender)
    134. End Sub


    Ich weiss nicht ob das alles war, weil es seeehr viel Code ist.. Und ich hab nur 15.000 Zeichen.
    Auf jeden Fall ist dort sehr viel grün, z.B. oben alles was nach

    VB.NET-Quellcode

    1. Const
    steht.

    Danke.

    Mfg. TGS
    Port 21 ist für FTP evtl wird er ja geblockt von der Firewall -- ändern würde ich da nix

    Edit Alles was Grün ist -- ist nur Kommentar :)
    :D Ein Programm sollte nicht nur Hand und Fuß, sondern auch Herz und Hirn haben. (Michael Anton) :D

    MFG Jörg ;)

    Muss jeder vermeintliche Programmierer ne Signatur haben ??
    Also soll das hier so sein?:

    VB.NET-Quellcode

    1. Public Structure FTPResponseCodes
    2. Const msgDftBanner = "220 TGS Server Creator Host."
    3. Const msgTooMuchClients = "421 Too many users connected."
    4. Const msgCmdUnknown = "500 %s: command not understood."
    5. Const msgLoginFailed = "530 Login incorrect."
    6. Const msgNotLogged = "530 Please login with USER and PASS."
    7. Const msgNoUser = "503 Login with USER first."
    8. Const msgLogged = "230 User %s logged in."
    9. Const msgPassRequired = "331 Password required for %s."
    10. Const msgCWDSuccess = "250 CWD command successful. %s is current directory."
    11. Const msgCWDFailed = "501 CWD failed. %s"
    12. Const msgPWDSuccess = "257 %s is current directory."
    13. Const msgQuit = "221 Goodbye."
    14. Const msgPortSuccess = "200 Port command successful."
    15. Const msgPortFailed = "501 Invalid PORT command."
    16. Const msgStorDisabled = "500 Cannot STOR."
    17. Const msgStorSuccess = "150 Opening data connection for %s."
    18. Const msgStorFailed = "501 Cannot STOR. %s"
    19. Const msgStorAborted = "426 Connection closed %s."
    20. Const msgStorOk = "226 File received ok"
    21. Const msgStorError = "426 Connection closed transfer aborted. Error #%d"
    22. Const msgRetrDisabled = "500 Cannot RETR."
    23. Const msgRetrSuccess = "150 Opening data connection for %s."
    24. Const msgRetrFailed = "501 Cannot RETR. %s"
    25. Const msgRetrAborted = "426 Connection closed %s."
    26. Const msgRetrOk = "226 File sent ok"
    27. Const msgRetrError = "426 Connection closed transfer aborted. Error #%d"
    28. Const msgSystem = "215 UNIX Type: L8 VB.Net FTP Server"
    29. Const msgDirOpen = "150 Opening data connection for directory list."
    30. Const msgDirFailed = "451 Failed: %s."
    31. Const msgTypeOk = "200 Type set to %s."
    32. Const msgTypeFailed = "500 TYPE %s: command not understood."
    33. Const msgDeleNotExists = "550 %s: no such file or directory."
    34. Const msgDeleOk = "250 File %s deleted."
    35. Const msgDeleFailed = "450 File %s cant be deleted."
    36. Const msgDeleSyntax = "501 Syntax error in parameter."
    37. Const msgDeleDisabled = "500 Cannot DELE."
    38. Const msgRnfrNotExists = "550 %s: no such file or directory."
    39. Const msgRnfrSyntax = "501 Syntax error is parameter."
    40. Const msgRnfrOk = "350 File exists, ready for destination name."
    41. Const msgRntoNotExists = "550 %s: no such file or directory."
    42. Const msgRntoAlready = "553 %s: file already exists."
    43. Const msgRntoOk = "250 File %s renamed to %d."
    44. Const msgRntoFailed = "450 File %s cant be renamed."
    45. Const msgRntoSyntax = "501 Syntax error in parameter."
    46. Const msgMkdOk = "257 %s: directory created."
    47. Const msgMkdAlready = "550 %s: file or directory already exists."
    48. Const msgMkdFailed = "550 %s: cant create directory."
    49. Const msgMkdSyntax = "501 Syntax error in parameter."
    50. Const msgRmdOk = "250 %s: directory removed."
    51. Const msgRmdNotExists = "550 %s: no such directory."
    52. Const msgRmdFailed = "550 %s: cant remove directory."
    53. Const msgRmdSyntax = "501 Syntax error in parameter."
    54. Const msgNoopOk = "200 Ok. Parameter was %s."
    55. Const msgAborOk = "225 ABOR command successful."
    56. Const msgPasvLocal = "227 Entering Passive Mode (127,0,0,1,%d,%d)."
    57. Const msgPasvRemote = "227 Entering Passive Mode (%d,%d,%d,%d,%d,%d)."
    58. Const msgPasvExcept = "500 PASV exception: %s."
    59. Const msgSizeOk = "213 %d"
    60. Const msgSizeFailed = "550 Command failed: %s."
    61. Const msgSizeSyntax = "501 Syntax error in parameter."
    62. Const msgRestOk = "350 REST supported. Ready to resume at byte offset %d."
    63. Const msgRestZero = "501 Required byte offset parameter bad or missing."
    64. Const msgRestFailed = "501 Syntax error in parameter: %s."
    65. Const msgAppeFailed = "550 APPE failed."
    66. Const msgAppeSuccess = "150 Opening data connection for %s (append)."
    67. Const msgAppeDisabled = "500 Cannot APPE."
    68. Const msgAppeAborted = "426 Connection closed %s."
    69. Const msgAppeOk = "226 File received ok"
    70. Const msgAppeError = "426 Connection closed transfer aborted. Error #%d"
    71. Const msgAppeReady = "150 APPE supported. Ready to append file %s at offset %d."
    72. Const msgStruOk = "200 Ok. STRU parameter %s ignored."
    73. Const msgSendComplete = "226 Transfer complete"
    74. Const msgSendFailed = "501 Transfer Failed"
    75. Const msgSendDirStart = "150 Opening ASCII mode data connection for %s."
    76. Dim iInstance As Integer
    77. End Structure


    Nach Const das Wort ist grün unterstrichen und da steht:
    Variabledeklaration ohne As-Klausel . Typ "Object" wird angenommen.



    EDIT:
    Habs mit

    VB.NET-Quellcode

    1. As Object
    wegbekommen die grünen Unterstreichungen aber ich kann mich immernoch nicht verbinden..
    Hab ich, jetzt sinds 96 Warnungen noch und ich kann mich immernoch nicht verbinden.
    Hab vorhin noch editiert aber ich schreibs nochmal:

    Habs mit

    VB.NET-Quellcode

    1. As Object

    wegbekommen die grünen Unterstreichungen aber ich kann mich immernoch nicht verbinden..

    Ich hänge immernoch bei

    Befehl: TYPE I
    Antwort: 200 Type set to I.
    Befehl: PASV
    Fehler: Verbindung vom Server geschlossen
    Fehler: Verzeichnisinhalt konnte nicht empfangen werden


    In FileZilla.


    Danke.

    Mfg. TGS


    EDIT:
    Danke Netlogger ich schaus mir mal an :)
    Hab ich jetzt gemacht. geht immernoch nicht!
    Das Projekt hat mitlerweile 0 Fehler und Warnungen, aber geht immernoch nicht..

    Habs nochmal hochgeladen.

    Hoffe jemand kann helfen sonst muss ich es vergessen..

    Mfg. TGS
    Dateien
    • ftp_server.rar

      (119,64 kB, 98 mal heruntergeladen, zuletzt: )

    TheGameSiders schrieb:

    Hab ich ja.


    EDIT:
    Kann mal jemand versuchen auf den FTP Server zu kommen?

    IP:
    87.151.100.254

    Ich lese grade, dass es bei manchen im lokalen Netz nicht geht, die den gleichen Fehler haben..

    Danke!



    Wie soll das gehen ohne Passwort oder Nutzername ?? :huh:
    :D Ein Programm sollte nicht nur Hand und Fuß, sondern auch Herz und Hirn haben. (Michael Anton) :D

    MFG Jörg ;)

    Muss jeder vermeintliche Programmierer ne Signatur haben ??
    So dank Artentus komme ich bei FileZilla weiter:

    Status: Verbinde mit 127.0.0.1:21...
    Status: Verbindung hergestellt, warte auf Willkommensnachricht...
    Antwort: 220 Servername.
    Befehl: USER anonymous
    Antwort: 331 Password required for anonymous.
    Befehl: PASS **************
    Antwort: 230 User anonymous logged in.
    Befehl: SYST
    Antwort: 215 UNIX Type: L8 VB.Net FTP Server
    Befehl: FEAT
    Antwort: 500 FEAT: command not understood.
    Status: Server does not support non-ASCII characters.
    Status: Verbunden
    Status: Empfange Verzeichnisinhalt...
    Befehl: PWD
    Antwort: 257 "\" is current directory.
    Befehl: TYPE I
    Antwort: 200 Type set to I.
    Befehl: PORT 127,0,0,1,203,88
    Fehler: Zeitüberschreitung der Verbindung
    Fehler: Verzeichnisinhalt konnte nicht empfangen werden


    Wieder der Fehler, aber weiter.

    Der Server unterstützt kein Passive xtts02.

    Mfg. TGS