1. 程式人生 > >利用PBFunc在Powerbuilder中進行FTP操作

利用PBFunc在Powerbuilder中進行FTP操作

sharp uil 服務器 builder not gin 方法 targe string

PBFunc.dll包含了FTP的操作,使用FTP時主要需要以下步驟:

1.調用of_Login函數登錄Ftp服務器

2.調用FTP的各種方法

3.Ftp操作完畢後調用of_LoginOut方法進行註銷

代碼如下:

n_pbfunc_ftp lnv_ftp
IF Not lnv_ftp.of_Login("192.168.68.21",21,"ftpuser","123456") Then
	MessageBox("提示","連接FTP服務器失敗")
	return
End IF
long ll_files
string ls_files[]
ll_files = lnv_ftp.of_dir("/testdir/",ls_files)//獲取文件列表
lnv_ftp.of_downloadfile("/testdir/I_20170626_00000001.dat","D:\I_20170626_00000001.dat")//下載文件
lnv_ftp.of_uploadFile("D:\comtemp.txt","/testdir/comtemp.txt")//上傳文件

lnv_ftp.of_LoginOut()///註銷

  代碼下載:http://files.cnblogs.com/files/wangxianjin/PBFuncLib170722%E6%9C%89%E5%BC%B9%E7%AA%97%E5%8F%A3%E7%89%88.rar

利用PBFunc在Powerbuilder中進行FTP操作