Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
%Unicode = 1
#Include "Win32API.inc"
%IDC_Button = 500
Global hDlg as Dword
Function PBMain() As Long
Dialog New Pixels, 0, "FTP Test",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %IDC_Button,"Upload", 50,10,100,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If CB.Msg = %WM_Command AND CB.Ctl = %IDC_Button AND CB.Ctlmsg = %BN_Clicked Then
TCP Open "ftp" At "www.garybeene.com" As #1
'? UserName .. Password ... Target File Name (URL)
TCP Send #1 FileText("myfile.htm")
TCP Close #1
End If
End Function
Function FileText(fName$) As String 'returns all bytes in a file as a text string
Local temp$
If Isfalse(Isfile(fName$)) Then Exit Function
Open fName$ For Binary As #1
Get$ #1, Lof(1), temp$
Close #1
Function = temp$
End Function
'gbs_01304
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm