Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado por: J. Elihu en Abril 02, 2022, 10:41:09 pm
-
NokilonServer
Es un Servidor FTP Creado en VB6, de fácil uso y configuración, con soporte para múltiples conexiones, transferencia de archivos mayores de 2GB, soporta conexiones en IPv4 e IPv6. Con la finalidad de ahorrar recursos en la memoria, se ha separado el proyecto en dos partes: Servidor e Interfaz. El programa servidor se ejecuta en segundo plano, la interfaz permite la configuración del servidor (Puerto, Velocidad de transferencia, usuarios) y permite visualizar los comandos enviados por el cliente y las respuestas enviadas por el servidor, también permite visualizar las transferencias realizadas y los usuarios conectados. La interfaz se comunica con el programa servidor a través de mensajes DDE. La idea de crear este servidor fue para transferir archivos entre la computadora y el teléfono Android, con la aplicación ESFileExplorer en una red local.
Para la base de datos requiere de SQLite3 y J3cnn.dll (Envoltorio personalizado de SQLite3 para VB6).
(https://raw.githubusercontent.com/JosueElihu/NokilonServer/main/server/res/nk-server1.jpg)
(https://raw.githubusercontent.com/JosueElihu/NokilonServer/main/server/res/nk-server0.jpg)
El servidor se ejecuta en segundo plano, y muestra un icono en el área de notificaciones, para acceder a la interfaz del servidor, haga doble clic sobre el icono, o clic derecho para desplegar el menú de opciones.
(https://raw.githubusercontent.com/JosueElihu/NokilonServer/main/server/res/nk-server2.jpg)
para acceder a la interfaz desde VB6 debe ejecutar el proyecto Servidor y el proyecto Interfaz.
Enlace: https://github.com/JosueElihu/NokilonServer (https://github.com/JosueElihu/NokilonServer)
-
13:59:32 - [xxdoc] TYPE I
13:59:32 - [xxdoc] 200 Type set to I
13:59:32 - [xxdoc] SIZE /
13:59:35 - [xxdoc] 550 File not found ------why
13:59:35 - [xxdoc] CWD /
13:59:35 - [xxdoc] 250 CWD successful
13:59:35 - [xxdoc] PASV
13:59:35 - [xxdoc] 227 Entering Passive Mode (192,168,166,210,7,208)
13:59:35 - [xxdoc] LIST -l
13:59:37 - [xxdoc] 450 Invalid file name or path
13:59:37 - [xxdoc] QUIT
13:59:37 - [xxdoc] 221 Goodbye
-
i add the path is folder. name temp
i used like ftp://127.0.0.1:21/temp
-
If LenB(Args) Then
Select Case Args
Case "-a .", "-a": Args = vbNullString
Case Else
If Left$(Args, 3) = "-a " Then Args = Right$(Args, Len(Args) - 3)
Args = Replace$(Args, "\", "")
Args = mvParseLocalPath(Args)
If Not PathExist(Args) Then
Send "450 Invalid file name or path"
If SOCKET_DATA Then RemoveSH SOCKET_DATA
Exit Sub
End If
End Select
debug.print
Args="-l" so this may be error.
2.
Public Sub PutIcon32Bit(ByVal hWnd As Long, ResIcon As Variant)
Dim hicon As Long
hicon = LoadImage(App.hInstance, ResIcon, 1, 32 * mdpi_, 32 * mdpi_, &H8000& Or &H1000)
If hicon Then DestroyIcon SendMessage(hWnd, &H80, 1, ByVal hicon)
hicon = LoadImage(App.hInstance, ResIcon, 1, 16 * mdpi_, 16 * mdpi_, &H8000& Or &H1000)
If hicon Then DestroyIcon SendMessage(hWnd, &H80, 0, ByVal hicon)
' Const ICON_BIG As Long = 1
' Const ICON_SMALL As Long = 0
' Const WM_SETICON As Long = &H80
' hIcon = LoadIcon(App.hInstance, ResIcon)
' Call SendMessage(hWnd, &H80, 1, ByVal hIcon)
' Call SendMessage(hWnd, &H80, 0, ByVal hIcon)
' Call DestroyIcon(hIcon)
End Sub
may be ?
in my win10 hicon will=0 then
show black icon
3.i konw must used ftp client to test .not used ie or Chrome test
4.
With CDS
.lData = SEND_DATA
Dim arrData() As Byte
arrData = StrConv(data, vbFromUnicode)
'.lSize = LenB(data)
'.lPtr = StrPtr(data)
.lSize = UBound(arrData) + 1
.lPtr = VarPtr(arrData(0))
End With
Case WM_COPYDATA
Dim CDS As COPYDATASTRUCT
Dim sReply As String
Call CopyMemory(CDS, ByVal lParam, Len(CDS))
Dim arrBuffer() As Byte
Call CopyMemory(CDS, ByVal lParam, Len(CDS))
ReDim arrBuffer(CDS.lSize - 1)
Call CopyMemory(arrBuffer(0), ByVal CDS.lPtr, CDS.lSize)
tmp = StrConv(arrBuffer(), vbUnicode)
'tmp = String(CDS.lSize, 0)
'Call CopyMemory(VarPtr(tmpA(0)), ByVal CDS.lPtr, CDS.lSize)
'tmp = StrConv(tmpA, vbFromUnicode)
Select Case CDS.lData
Case SEND_DATA
RaiseEvent Arrival(tmp, wParam, hWinText(wParam), sReply)
If Len(sReply) Then
Dim arrData() As Byte
arrData = StrConv(sReply, vbFromUnicode)
CDS.lData = REPLY_DATA
'.lSize = LenB(data)
'.lPtr = StrPtr(data)
CDS.lSize = UBound(arrData) + 1
CDS.lPtr = VarPtr(arrData(0))
'CDS.lData = REPLY_DATA
'CDS.lSize = LenB(sReply)
'CDS.lPtr = StrPtr(sReply)
If SendMessage(wParam, WM_COPYDATA, m_hwnd, CDS) = READED_REPLY Then lReturn = READ_CONTENT
End If
Case REPLY_DATA
m_StrData = tmp
lReturn = READED_REPLY
End Select
-
hi xxdoc
1. it's because the server takes the LIST command argument (-l) as an invalid argument, a little tweaking will fix that:
If LenB(Args) Then
Select Case LCase(Args)
Case "-a .", "-a", "-l": Args = vbNullString
Case Else
If Left$(Args, 3) = "-a " Then Args = Right$(Args, Len(Args) - 3)
If Left$(Args, 2) = "-l" Then Args = Right$(Args, Len(Args) - 2)
Args = Replace$(Args, "\", "")
Args = mvParseLocalPath(Args)
If Not PathExist(Args) Then
Send "450 Invalid file name or path"
If SOCKET_DATA Then RemoveSH SOCKET_DATA
Exit Sub
End If
End Select
End If
2. hIcon=0 because the icon has not been added in the resource file, I usually add the icon after compiling the project.
3. Yes, an FTP client is needed, some browsers no longer support FTP
4. I didn't understand what you want to do, send a byte array by DDE? I use the cDDE class to pass information from the server program to the interface, to show information about connections, commands, transfers
-
Your code is very good. Just a little complicated for me, especially with winsock api.thanks
-
Muy buen trabajo Elihu, excelente como siempre!