AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones Net
  • Example: Sending a message from the client computer to the server
NetSendFile (Example)
Example: Sending a message from the client computer to the server
The following example is used to transfer a file from the client computer to the server and to manage the transfer progress on the client computer.
// - - Initialization code of "WIN_RPCClient" window
GLOBAL
Transfer_Completed is boolean = False
Transfer_InProgress is boolean = False
Event("ProgBar_Transfer", "WIN_RPCClient", "SendFile")
...
AConnection is int
AConnection = NetConnect("148.61.125.245", FTPServer, "GUEST", "")
...
// - - Button for sending the transfer
IF Transfer_InProgress = True THEN
Error("A file transfer is in progress")
ELSE
Transfer_Completed = False
Transfer_InProgress = True
IF NetSendFile(AConnection, "C:\autoexec.bat", ...
"C:\autoexec.cli", "SendFile", 10) = False THEN
Info("The transfer failed")
END
...
END
// - - ProgBar_Transfer procedure: managing the current transfer
PROCEDURE ProgBar_Transfer
Message("Transfer in progress")
ProgressBar(_EVE.wParam, _EVE.lParam)
IF _EVE.wParam = _EVE.lParam THEN
Transfer_InProgress = False
Transfer_Completed = True
Message("Transfer completed")
Info("Transfer completed")
END
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 22/07/2022

Señalar un error o enviar una sugerencia | Ayuda local