$PBExportHeader$w_ftp2.srw
forward
global type w_ftp2 from window
end type
type sle_2 from singlelineedit within w_ftp2
end type
type cb_5 from commandbutton within w_ftp2
end type
type cb_4 from commandbutton within w_ftp2
end type
type cb_3 from commandbutton within w_ftp2
end type
type cb_2 from commandbutton within w_ftp2
end type
type sle_1 from singlelineedit within w_ftp2
end type
type dw_1 from datawindow within w_ftp2
end type
type st_1 from statictext within w_ftp2
end type
type mle_1 from multilineedit within w_ftp2
end type
type cb_1 from commandbutton within w_ftp2
end type
end forward
global type w_ftp2 from window
integer width = 3168
integer height = 1760
boolean titlebar = true
string title = "Untitled"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
sle_2 sle_2
cb_5 cb_5
cb_4 cb_4
cb_3 cb_3
cb_2 cb_2
sle_1 sle_1
dw_1 dw_1
st_1 st_1
mle_1 mle_1
cb_1 cb_1
end type
global w_ftp2 w_ftp2
type variables
nvo_ftp dd
n_cst_fileio fileio
long key_order,key_order1
end variables
on w_ftp2.create
this.sle_2=create sle_2
this.cb_5=create cb_5
this.cb_4=create cb_4
this.cb_3=create cb_3
this.cb_2=create cb_2
this.sle_1=create sle_1
this.dw_1=create dw_1
this.st_1=create st_1
this.mle_1=create mle_1
this.cb_1=create cb_1
this.Control[]={this.sle_2,&
this.cb_5,&
this.cb_4,&
this.cb_3,&
this.cb_2,&
this.sle_1,&
this.dw_1,&
this.st_1,&
this.mle_1,&
this.cb_1}
end on
on w_ftp2.destroy
destroy(this.sle_2)
destroy(this.cb_5)
destroy(this.cb_4)
destroy(this.cb_3)
destroy(this.cb_2)
destroy(this.sle_1)
destroy(this.dw_1)
destroy(this.st_1)
destroy(this.mle_1)
destroy(this.cb_1)
end on
event open;dd=create nvo_ftp
fileio=create n_cst_fileio
end event
type sle_2 from singlelineedit within w_ftp2
integer x = 128
integer y = 36
integer width = 800
integer height = 104
integer taborder = 10
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
string text = "D:\pic\aaa.txt"
borderstyle. borderstyle. = stylelowered!
end type
type cb_5 from commandbutton within w_ftp2
integer x = 965
integer y = 36
integer width = 457
integer height = 128
integer taborder = 10
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "none"
end type
event clicked;string ls_localfile,ls_remotefile
unsignedlong ll_dwcontext
ls_localfile=trim(sle_2.text)
ls_remotefile="aaa111.txt"
ll_dwcontext=0
if not dd.of_ftpputfile(ls_localfile,ls_remotefile,2,ll_dwcontext) then
messagebox("error","error")
else
messagebox("OK","OK")
end if
end event
type cb_4 from commandbutton within w_ftp2
integer x = 731
integer y = 192
integer width = 457
integer height = 128
integer taborder = 30
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "set"
end type
event clicked;string ls_Directory
ls_Directory=trim(sle_1.text)
//if not dd.of_ftpsetcurrentdir(ls_Directory) then
// messagebox("",ls_Directory)
dd.of_ftpcreatedir(ls_Directory)
// messagebox("",ls_Directory)
//end if
// dd.of_getftpdirectorycontents(ls_Directory,dw_1)
end event
type cb_3 from commandbutton within w_ftp2
integer x = 2382
integer y = 176
integer width = 457
integer height = 128
integer taborder = 30
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "putfile"
end type
type cb_2 from commandbutton within w_ftp2
integer x = 1861
integer y = 176
integer width = 457
integer height = 128
integer taborder = 20
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "getfile"
end type
type sle_1 from singlelineedit within w_ftp2
integer x = 201
integer y = 192
integer width = 457
integer height = 112
integer taborder = 20
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
string text = "/bb"
borderstyle. borderstyle. = stylelowered!
end type
type dw_1 from datawindow within w_ftp2
integer x = 1426
integer y = 396
integer width = 1541
integer height = 880
integer taborder = 30
string title = "none"
string dataobject = "d_fileinfo"
boolean livescroll = true
borderstyle. borderstyle. = stylelowered!
end type
type st_1 from statictext within w_ftp2
boolean visible = false
integer x = 338
integer y = 276
integer width = 457
integer height = 72
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "none"
boolean focusrectangle = false
end type
type mle_1 from multilineedit within w_ftp2
integer x = 160
integer y = 380
integer width = 1138
integer height = 848
integer taborder = 20
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
string text = "none"
borderstyle. borderstyle. = stylelowered!
end type
type cb_1 from commandbutton within w_ftp2
integer x = 1339
integer y = 176
integer width = 457
integer height = 128
integer taborder = 10
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "connect"
end type
event clicked;string a,aa,curdir
string ls_server,ls_user,ls_pwd,ls_Directory
long flags=0
ulong context=0
ls_server="10.25.83.17"
ls_user="test"
ls_pwd="hjtOK123!"
dd.of_ftpdisconnect( )
dd.of_disconnect( )
if dd.of_internetopen(1,a,aa,flags) then
dd.of_set_connectioninfo(ls_server,'kent',ls_user,ls_pwd,dd.internet_flag_passive,21)
if dd.of_setmle(mle_1) and dd.of_connect() then //连接
ls_Directory=trim(sle_1.text)
dd.of_ftpsetcurrentdir(ls_Directory)
dd.of_getftpdirectorycontents(ls_Directory,dw_1)
// messagebox("",ls_Directory)
// setserdir()
else
messagebox('失败','无法连接升级服务器!')
halt
end if
else
close(parent)
end if
end event
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/75527/viewspace-749840/
,如需转载,请注明出处,否则将追究法律责任。