ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Net functions
  • 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
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/22/2022

Send a report | Local help