当前位置:首页 » 文件传输 » CLSSMEftp
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

CLSSMEftp

发布时间: 2022-05-21 16:15:20

㈠ linux只安装vsftpd就能使用ftp命令

linux不需要安装vxftpd也可以使用ftp命令(FTP客户端)。

在大多发行版都有打包,请到各大发行版的ftp列表中得到,或者在发行版的安装盘中也能得到。lftp是一个命令行式的ftp客户端。对中文支持较好。如果您在linux 的text模式下,要安装zhcon或者cce之类的。

安装:

1、RPM包管理的系统,请到

http://freshrpms.net
http;//rpmfind.net 上查找lftp的最新包,可以用

#rpm -ivh name.rpm
#rpm -Uvh name.rpm 这是升级之用

2、源码包安装举例:lftp-3.2.0.tar.bz2

#tar zxvf lftp-3.2.0.tar.bz2
#cd lftp-3.2.0
#./configure
#make
#make install

3.调用方法:

lftp ftp://用户名:密码@地址

比如:
[beinan@S01~]$lftp ftp://[email protected]
口令:
lftp [email protected]:~>
lftp [email protected]:~>ls

-rw-r--r-- 1 1000 100 44387 May 18 10:04 xvmain.jpg
-rw-r--r-- 1 1000 100 202643 May 18 09:45 xxx.jpeg
-rw-r--r-- 1 1000 100 0 May 20 10:01 鲨鱼的故事.txt

二、使用方法:

0.简单的用法:lcd 切换本地目录,比如 lcd /opt
get 取回一个文件,put 向ftp服务器传文件;

1、获得帮助:

代码:

lftp [email protected]:~> help
!<shell-command>(commands)
alias [<name> [<value>]]anon
bookmark [SUBCMD] cache [SUBCMD]
cat [-b] <files>cd <rdir>
chmod [OPTS] mode file... close [-a]
[re]cls [opts] [path/][pattern] debug [<level>|off] [-o <file>]
[options] <dirs> exit [<code>|bg]
get [OPTS] <rfile> [-o <lfile>] glob [OPTS] <cmd> <args>
help [<cmd>]history -w file|-r file|-c|-l [cnt]
jobs [-v] kill all|<job_no>
lcd <ldir>lftp [OPTS] <site>
ls [<args>] mget [OPTS] <files>
mirror [OPTS] [remote [local]]mkdir [-p] <dirs>
mole name [args]more <files>
mput [OPTS] <files> mrm <files>
mv <file1> <file2>[re]nlist [<args>]
open [OPTS] <site>pget [OPTS] <rfile> [-o <lfile>]
put [OPTS] <lfile> [-o <rfile>] pwd [-p]
queue [OPTS] [<cmd>]quote <cmd>
repeat [delay] [command]rm [-r] [-f] <files>
rmdir [-f] <dirs> scache [<session_no>]
set [OPT] [<var> [<val>]] site <site_cmd>
source <file> user <user|URL> [<pass>]
version wait [<jobno>]
zcat <files>zmore <files>

如果针对lftp的每个命令的帮助,应该是:

lftp [email protected]:~> help 命令

比如

代码:
lftp [email protected]:~> help get

用法: get [OPTS] <rfile> [-o <lfile>]

Retrieve remote file <rfile> and store it to local file <lfile>.
-o <lfile> specifies local file name (default - basename of rfile)
-ccontinue, reget
-Edelete remote files after successful transfer
-ause ascii mode (binary is the default)
-O <base> specifies base directory or URL where files should be placed

简介:gftp基于gtk的ftp客户端,大家用的也比较多吧,支持中文目录。如果您的gftp不能支持中文,请升级版本。

# Written in C and has a text interface and a GTK+ 1.2/2.x interface
# Supports the FTP, FTPS (control connection only), HTTP, HTTPS, SSH and FSP protocols
# FTP and HTTP proxy server support
# Supports FXP file transfers (transferring files between 2 remote servers via FTP)
# Supports UNIX, EPLF, Novell, MacOS, VMS, MVS and NT (DOS) style directory listings
# Bookmarks menu to allow you to quickly connect to remote sites

下载安装:

在各大发行版中,都有gftp的打包,可以用各发行版自带的工具来安装。我只说源码包安装:

源码包安装,通用于所有发行版,举例说明:gftp-2.0.18.tar.bz2

代码:
[root@S01ftp]#ls -lh

总用量 1.4M

-rw-r--r--1 root root 1.4M 2005-05-21 09:18 gftp-2.0.18.tar.bz2
[root@S01ftp]#tar jxvf gftp-2.0.18.tar.bz2
[[email protected]]#./configure
[[email protected]]#make
[[email protected]]#make install

注:因为gftp依赖gtk,如果不能make过去,您应该指定PKG_CONFIG_PATH

[[email protected]]# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

调用:

代码:

[[email protected]]#gftp

㈡ FTP常用命令有哪些

FTP命令是Internet用户使用最频繁的命令之一,不论是在DOS还是UNIX操作系统下使用FTP,都会遇到大量的FTP内部命令。熟悉并灵活应用FTP的内部命令,可以大大方便使用者,并收到事半功倍之效。

FTP的命令行格式为:ftp -v -d -i -n -g [主机名],其中

-v显示远程服务器的所有响应信息;

-n限制ftp的自动登录,即不使用;

.n etrc文件;

-d使用调试方式;

-g取消全局文件名。

ftp使用的内部命令如下(中括号表示可选项):

1.![cmd[args]]:在本地机中执行交互shell,exit回到ftp环境,如:!ls*.zip.

2.$ macro-ame[args]:执行宏定义macro-name.

3.account[password]:提供登录远程系统成功后访问系统资源所需的补充口令。

4.append local-file[remote-file]:将本地文件追加到远程系统主机,若未指定远程系统文件名,则使用本地文件名。

5.ascii:使用ascii类型传输方式。

6.bell:每个命令执行完毕后计算机响铃一次。

7.bin:使用二进制文件传输方式。

8.bye:退出ftp会话过程。

9.case:在使用mget时,将远程主机文件名中的大写转为小写字母。

10.cd remote-dir:进入远程主机目录。

11.cp:进入远程主机目录的父目录。

12.chmod mode file-name:将远程主机文件file-name的存取方式设置为mode,如:chmod 777 a.out。

13.close:中断与远程服务器的ftp会话(与open对应)。

14.cr:使用asscii方式传输文件时,将回车换行转换为回行。

15.delete remote-file:删除远程主机文件。

16.debug[debug-value]:设置调试方式,显示发送至远程主机的每条命令,如:deb up 3,若设为0,表示取消debug。

17.dir[remote-dir][local-file]:显示远程主机目录,并将结果存入本地文件local-file。

18.disconnection:同close。

19.form format:将文件传输方式设置为format,缺省为file方式。

20.get remote-file[local-file]:将远程主机的文件remote-file传至本地硬盘的local-file。

21.glob:设置mdelete,mget,mput的文件名扩展,缺省时不扩展文件名,同命令行的-g参数。

22.hash:每传输1024字节,显示一个hash符号(#)。

23.help[cmd]:显示ftp内部命令cmd的帮助信息,如:help get。

24.idle[seconds]:将远程服务器的休眠计时器设为[seconds]秒。

25.image:设置二进制传输方式(同binary)。

26.lcd[dir]:将本地工作目录切换至dir。

27.ls[remote-dir][local-file]:显示远程目录remote-dir,并存入本地文件local-file。

28.macdef macro-name:定义一个宏,遇到macdef下的空行时,宏定义结束。

29.mdelete[remote-file]:删除远程主机文件。

30.mdir remote-files local-file:与dir类似,但可指定多个远程文件,如:mdir *.o.*.zipoutfile

31.mget remote-files:传输多个远程文件。

32.mkdir dir-name:在远程主机中建一目录。

33.mls remote-file local-file:同nlist,但可指定多个文件名。

34.mode[modename]:将文件传输方式设置为modename,缺省为stream方式。

35.modtime file-name:显示远程主机文件的最后修改时间。

36.mput local-file:将多个文件传输至远程主机。

37.newer file-name:如果远程机中file-name的修改时间比本地硬盘同名文件的时间更近,则重传该文件。

38.nlist[remote-dir][local-file]:显示远程主机目录的文件清单,并存入本地硬盘的local-file。

39.nmap[inpattern outpattern]:设置文件名映射机制,使得文件传输时,文件中的某些字符相互转换,如:nmap $1.$2.$3[$1,$2].[$2,$3],则传输文件a1.a2.a3时,文件名变为a1,a2。该命令特别适用于远程主机为非UNIX机的情况。

40.ntrans[inchars[outchars]]:设置文件名字符的翻译机制,如ntrans 1R,则文件名LLL将变为RRR。

41.open host[port]:建立指定ftp服务器连接,可指定连接端口。

42.passive:进入被动传输方式。

43.prompt:设置多个文件传输时的交互提示。

44.proxy ftp-cmd:在次要控制连接中,执行一条ftp命令,该命令允许连接两个ftp服务器,以在两个服务器间传输文件。第一条ftp命令必须为open,以首先建立两个服务器间的连接。

45.put local-file[remote-file]:将本地文件local-file传送至远程主机。

46.pwd:显示远程主机的当前工作目录。

47.quit:同bye,退出ftp会话。

48.quote arg1,arg2...:将参数逐字发至远程ftp服务器,如:quote syst.

49.recv remote-file[local-file]:同get。

50.reget remote-file[local-file]:类似于get,但若local-file存在,则从上次传输中断处续传。

51.rhelp[cmd-name]:请求获得远程主机的帮助。

52.rstatus[file-name]:若未指定文件名,则显示远程主机的状态,否则显示文件状态。

53.rename[from][to]:更改远程主机文件名。

54.reset:清除回答队列。

55.restart marker:从指定的标志marker处,重新开始get或put,如:restart 130。

56.rmdir dir-name:删除远程主机目录。

57.runique:设置文件名唯一性存储,若文件存在,则在原文件后加后缀..1,.2等。

58.send local-file[remote-file]:同put。

59.sendport:设置PORT命令的使用。

60.site arg1,arg2...:将参数作为SITE命令逐字发送至远程ftp主机。

61.size file-name:显示远程主机文件大小,如:site idle 7200。

62.status:显示当前ftp状态。

63.struct[struct-name]:将文件传输结构设置为struct-name,缺省时使用stream结构。

64.sunique:将远程主机文件名存储设置为唯一(与runique对应)。

65.system:显示远程主机的操作系统类型。

66.tenex:将文件传输类型设置为TENEX机的所需的类型。

67.tick:设置传输时的字节计数器。

68.trace:设置包跟踪。

69.type[type-name]:设置文件传输类型为type-name,缺省为ascii,如:type binary,设置二进制传输方式。

70.umask[newmask]:将远程服务器的缺省umask设置为newmask,如:umask 3。

71.user user-name[password][account]:向远程主机表明自己的身份,需要口令时,必须输入口令,如:user anonymous my@email。

72.verbose:同命令行的-v参数,即设置详尽报告方式,ftp服务器的所有响应都将显示给用户,缺省为on.

73.?[cmd]:同help。

㈢ 如何在计算机上建立使用DOS命令通过FTP进行上传和下载

1、dos命令,是dos操作系统的命令,是一种面向磁盘的操作命令,主要包括目录操作类命令、磁盘操作类命令、文件操作类命令和其它命令。
2、常用命令:
(1)查看目录内容命令
dir
(2)指定可执行文件搜索目录
path
(3)创建目录命令
md
(4)打开指定目录命令
cd
(5)删除当前指定的子目录命令
rd
(6)改变当前盘符命令
c:
(7)文件复制命令

(8)显示文本文件内容命令
type
(9)更改文件名命令
ren
(10)删除文件命令
del
(11)清除屏幕命令
cls

㈣ 360杀毒系统盘下有一批处理重启后再生成,不知是什么意思,求大侠帮助!!!内容如下

朋友的这个问题可以使用360系统系统急救箱在安全模式下来进行急救修复。

㈤ chrome 访问vsftpd 不用ftp吗

linux不需要安装vxftpd也可以使用ftp命令(FTP客户端)。

在大多发行版都有打包,请到各大发行版的ftp列表中得到,或者在发行版的安装盘中也能得到。lftp是一个命令行式的ftp客户端。对中文支持较好。如果您在linux 的text模式下,要安装zhcon或者cce之类的。

安装:

1、RPM包管理的系统,请到

http://freshrpms.net
http;//rpmfind.net 上查找lftp的最新包,可以用

#rpm -ivh name.rpm
#rpm -Uvh name.rpm 这是升级之用

2、源码包安装举例:lftp-3.2.0.tar.bz2

#tar zxvf lftp-3.2.0.tar.bz2
#cd lftp-3.2.0
#./configure
#make
#make install

3.调用方法:

lftp ftp://用户名:密码@地址

比如:
[beinan@S01~]$lftp ftp://[email protected]
口令:
lftp [email protected]:~>
lftp [email protected]:~>ls

-rw-r--r-- 1 1000 100 44387 May 18 10:04 xvmain.jpg
-rw-r--r-- 1 1000 100 202643 May 18 09:45 xxx.jpeg
-rw-r--r-- 1 1000 100 0 May 20 10:01 鲨鱼的故事.txt

二、使用方法:

0.简单的用法:lcd 切换本地目录,比如 lcd /opt
get 取回一个文件,put 向ftp服务器传文件;

1、获得帮助:

代码:

lftp [email protected]:~> help
!<shell-command>(commands)
alias [<name> [<value>]]anon
bookmark [SUBCMD] cache [SUBCMD]
cat [-b] <files>cd <rdir>
chmod [OPTS] mode file... close [-a]
[re]cls [opts] [path/][pattern] debug [<level>|off] [-o <file>]
[options] <dirs> exit [<code>|bg]
get [OPTS] <rfile> [-o <lfile>] glob [OPTS] <cmd> <args>
help [<cmd>]history -w file|-r file|-c|-l [cnt]
jobs [-v] kill all|<job_no>
lcd <ldir>lftp [OPTS] <site>
ls [<args>] mget [OPTS] <files>
mirror [OPTS] [remote [local]]mkdir [-p] <dirs>
mole name [args]more <files>
mput [OPTS] <files> mrm <files>
mv <file1> <file2>[re]nlist [<args>]
open [OPTS] <site>pget [OPTS] <rfile> [-o <lfile>]
put [OPTS] <lfile> [-o <rfile>] pwd [-p]
queue [OPTS] [<cmd>]quote <cmd>
repeat [delay] [command]rm [-r] [-f] <files>
rmdir [-f] <dirs> scache [<session_no>]
set [OPT] [<var> [<val>]] site <site_cmd>
source <file> user <user|URL> [<pass>]
version wait [<jobno>]
zcat <files>zmore <files>

如果针对lftp的每个命令的帮助,应该是:

lftp [email protected]:~> help 命令

比如

代码:
lftp [email protected]:~> help get

用法: get [OPTS] <rfile> [-o <lfile>]

Retrieve remote file <rfile> and store it to local file <lfile>.
-o <lfile> specifies local file name (default - basename of rfile)
-ccontinue, reget
-Edelete remote files after successful transfer
-ause ascii mode (binary is the default)
-O <base> specifies base directory or URL where files should be placed

简介:gftp基于gtk的ftp客户端,大家用的也比较多吧,支持中文目录。如果您的gftp不能支持中文,请升级版本。

# Written in C and has a text interface and a GTK+ 1.2/2.x interface
# Supports the FTP, FTPS (control connection only), HTTP, HTTPS, SSH and FSP protocols
# FTP and HTTP proxy server support
# Supports FXP file transfers (transferring files between 2 remote servers via FTP)
# Supports UNIX, EPLF, Novell, MacOS, VMS, MVS and NT (DOS) style directory listings
# Bookmarks menu to allow you to quickly connect to remote sites

下载安装:

在各大发行版中,都有gftp的打包,可以用各发行版自带的工具来安装。我只说源码包安装:

源码包安装,通用于所有发行版,举例说明:gftp-2.0.18.tar.bz2

代码:
[root@S01ftp]#ls -lh

总用量 1.4M

-rw-r--r--1 root root 1.4M 2005-05-21 09:18 gftp-2.0.18.tar.bz2
[root@S01ftp]#tar jxvf gftp-2.0.18.tar.bz2
[[email protected]]#./configure
[[email protected]]#make
[[email protected]]#make install

注:因为gftp依赖gtk,如果不能make过去,您应该指定PKG_CONFIG_PATH

[[email protected]]# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

调用:

代码:

[[email protected]]#gftp

㈥ VB下如何将两个text框中的内容发送到指定的ftp空间高分急求。。。。。。

添加一个internet transfer 控件和一个按钮两个文本框,然后粘贴一下代码即可,不明白的网络HI我

Private Sub Command1_Click()
Dim UserName As String
Dim PassWord As String
Inet1.Cancel
Inet1.Protocol = icFTP
UserName = "target" 'FTP用户名,自己修改成需要的
PassWord = "vxTarget" 'FTP密码,自己修改成需要的
Dim Host As String
Host = "127.0.0.1" '主机地址,自己修改成需要的
Dim ph As String
ph = App.Path
If Right(ph, 1) <> "\" Then ph = ph & "\"
Open ph & "1.txt" For Output As #1
Print #1, Text1.Text;
Close #1
Open ph & "2.txt" For Output As #2
Print #2, Text2.Text;
Close #2
Me.Cls
Print "上传中,请等待"
Command1.Enabled = False
Inet1.Execute "ftp://" & UserName & ":" & PassWord & "@" & Host, "SEND """ & ph & "1.txt"" 1.txt"
While Inet1.StillExecuting = True
DoEvents '等待
Wend
Inet1.Execute "ftp://" & UserName & ":" & PassWord & "@" & Host, "SEND """ & ph & "2.txt"" 2.txt"
While Inet1.StillExecuting = True
DoEvents '等待
Wend
Kill ph & "1.txt"
Kill ph & "2.txt"
Command1.Enabled = True
MsgBox "完成"

End Sub

㈦ 我打开ftp窗口,输了很多命令,乱七八糟的,请问怎么清屏呢

quit
cls
再重新连接。

㈧ 开机后出现bat

简单一点吧
@echo off
set a=60
:
set /a a=a-1
ping -n 2 -w 500 127.1>nul
cls
echo 倒计时:%a%
if %a%==0 (shutdown.exe -s -t 1) else (goto :)

放在“开始”菜单\程序\启动 文件夹里

㈨ 批处理命令set及ftp组合使用的问题

set
num==
set
username==
set
message==
这三行是制定发送完毕后,三行数据为空~
也就是清空上面的数据
改成
set
num=,
但个等号的话,是必须赋值的

㈩ VB中使用FTP无法对本地文件进行操作,为什么

我重新给你一个

模块(ftp.cls)
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "FTP1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'******************
'download by http://www.NewXing.com
'*******************
Private Declare Function InternetOpen _
Lib "wininet.dll" _
Alias "InternetOpenA" (ByVal sAgent As String, _
ByVal lAccessType As Long, _
ByVal sProxyName As String, _
ByVal sProxyBypass As String, _
ByVal lFlags As Long) As Long
Private Declare Function InternetConnect _
Lib "wininet.dll" _
Alias "InternetConnectA" (ByVal hInternetSession As Long, _
ByVal sServerName As String, _
ByVal nServerPort As Integer, _
ByVal sUsername As String, _
ByVal sPassword As String, _
ByVal lService As Long, _
ByVal lFlags As Long, _
ByVal lContext As Long) As Long
Private Declare Function FtpGetFile _
Lib "wininet.dll" _
Alias "FtpGetFileA" (ByVal hFtpSession As Long, _
ByVal lpszRemoteFile As String, _
ByVal lpszNewFile As String, _
ByVal fFailIfExists As Boolean, _
ByVal dwFlagsAndAttributes As Long, _
ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean
Private Declare Function FtpPutFile _
Lib "wininet.dll" _
Alias "FtpPutFileA" (ByVal hFtpSession As Long, _
ByVal lpszLocalFile As String, _
ByVal lpszRemoteFile As String, _
ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean
Private Declare Function FtpDeleteFile _
Lib "wininet.dll" _
Alias "FtpDeleteFileA" (ByVal hFtpSession As Long, _
ByVal lpszFileName As String) As Boolean
Private Declare Function FtpRenameFile _
Lib "wininet.dll" _
Alias "FtpRenameFileA" (ByVal hFtpSession As Long, _
ByVal lpszExsiting As String, _
ByVal lpszNew As String) As Boolean
Private Declare Function InternetCloseHandle _
Lib "wininet.dll" (ByVal hInet As Long) As Integer
Private Declare Function FtpCreateDirectory _
Lib "wininet.dll" _
Alias "FtpCreateDirectoryA" (ByVal hFtpSession&, _
ByVal lpszDirectory$) As Boolean
Dim 连接状态 As Boolean
Dim 连接句柄 As Long
Public Function 连接服务器(ip As String, 端口 As Integer, 帐号 As String, 密码 As String) As Boolean
Dim 初始化 As Long
初始化 = InternetOpen(vbNullString, INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0&)
连接句柄 = InternetConnect(初始化, ip, 端口, 帐号, 密码, 1, 0, 0)
If 连接句柄 > 0 Then
连接状态 = True
Else
连接状态 = False
End If
连接服务器 = 连接状态
End Function

Public Function 上传文件(本地路径 As String, 远程路径 As String) As Boolean
If 连接状态 = True Then
上传文件 = FtpPutFile(连接句柄, 本地路径, 远程路径, 1, 0)
Else
MsgBox "请先确认连接"
End If
End Function

Public Function 下载文件(远程路径 As String, 本地路径 As String) As Boolean
If 连接状态 = True Then
下载文件 = FtpGetFile(连接句柄, 远程路径, 本地路径, False, &H80000000, &H0, 0)
Else
MsgBox "请先确认连接"
End If
End Function

Public Function 删除文件(远程路径 As String) As Boolean
If 连接状态 = True Then
删除文件 = FtpDeleteFile(连接句柄, 远程路径)
Else
MsgBox "请先确认连接"
End If
End Function

Public Function 创建目录(ByVal 路径 As String) As String
If 连接状态 = True Then
创建目录 = FtpCreateDirectory(连接句柄, 路径)
Else
MsgBox "请先确认连接"
End If
End Function

Public Function 文件改名(ByVal 原文件名 As String, ByVal 新文件名 As String)
If 连接状态 = True Then
ReturnVal& = FtpRenameFile(连接句柄, 原文件名, 新文件名)
Else
MsgBox "请先确认连接"
End If
End Function

窗口调用:
Dim Fffd As FTP1
Set Fffd = New FTP1
Call Fffd.连接服务器(IP地址, 21, "用户名", "密码")
Call Fffd.上传文件(Mid(文件名, 7))