代码如下:
procedure TForm1.connectFTP();
var
arraystr : ArrayString;begin
setlength(arraystr,9);
if not idftp1.Connected thenarraystr := readServerinfo();
IdFTP1.Host := arraystr[0];
idftp1.Port:= strtoint(arraystr[1]);
idftp1.Username := arraystr[2];
idftp1.Password := arraystr[3];
ftpip:=arraystr[0];
if arraystr[8] = 'isUseProxy=true' then
begin
showmessage('使用代理访问ftp server'); idftp1.IOHandler:=IdIOHandlerSocket1;
IdIOHandlerSocket1.SocksInfo:=IdSocksInfo1;
IdSocksInfo1.Version:=svSocks5;
IdSocksInfo1.Host:=arraystr[4];
IdSocksInfo1.Port:=strtoint(arraystr[5]);
IdSocksInfo1.Username:=arraystr[6];
IdSocksInfo1.Password:=arraystr[7]; {
idftp1.ProxySettings.Host:=arraystr[4];
idftp1.ProxySettings.Port:=strtoint(arraystr[5]);
idftp1.ProxySettings.UserName:=arraystr[6];
idftp1.ProxySettings.Password:=arraystr[7]; idftp1.ProxySettings.ProxyType:=fpcmHttpProxyWithFtp;
//idftp1.SendCmd()
}
end
else
begin
idftp1.IOHandler:=nil;
end;
try
//idftp1.Passive := true;
idftp1.Connect(true);
except
showmessage('连接ftp失败');
end; end;程序报错:
EIdSocksAuthMethodError with message 'Invalid socks authentication method'
请问是什么原因连接不上?有没有兄弟有用idftp成功连接代理的例子?
procedure TForm1.connectFTP();
var
arraystr : ArrayString;begin
setlength(arraystr,9);
if not idftp1.Connected thenarraystr := readServerinfo();
IdFTP1.Host := arraystr[0];
idftp1.Port:= strtoint(arraystr[1]);
idftp1.Username := arraystr[2];
idftp1.Password := arraystr[3];
ftpip:=arraystr[0];
if arraystr[8] = 'isUseProxy=true' then
begin
showmessage('使用代理访问ftp server'); idftp1.IOHandler:=IdIOHandlerSocket1;
IdIOHandlerSocket1.SocksInfo:=IdSocksInfo1;
IdSocksInfo1.Version:=svSocks5;
IdSocksInfo1.Host:=arraystr[4];
IdSocksInfo1.Port:=strtoint(arraystr[5]);
IdSocksInfo1.Username:=arraystr[6];
IdSocksInfo1.Password:=arraystr[7]; {
idftp1.ProxySettings.Host:=arraystr[4];
idftp1.ProxySettings.Port:=strtoint(arraystr[5]);
idftp1.ProxySettings.UserName:=arraystr[6];
idftp1.ProxySettings.Password:=arraystr[7]; idftp1.ProxySettings.ProxyType:=fpcmHttpProxyWithFtp;
//idftp1.SendCmd()
}
end
else
begin
idftp1.IOHandler:=nil;
end;
try
//idftp1.Passive := true;
idftp1.Connect(true);
except
showmessage('连接ftp失败');
end; end;程序报错:
EIdSocksAuthMethodError with message 'Invalid socks authentication method'
请问是什么原因连接不上?有没有兄弟有用idftp成功连接代理的例子?
解决方案 »
- 将两个字节的byte转为整形类型
- 怎样使程序只能运行一个实例
- 用Delphi当开发工具的疑问
- 为何在窗体继承中,在被继承窗全中声明的PUBLIC 变值并在被继承窗体赋值后,在继承窗体中访问是为空。
- 求delphi中,能复制文件的代码
- 请问哪里有MSChart和ClientSocket控件下载
- 在DELPHI的RichTextEdit控件中,怎样实现插入图片的功能。
- 三层中,如何在多线程中同时访问数据库
- 问简单的数据类型转换的问题,各位帮帮忙.
- delphi 调用MTS服务器中用vb6编写的dll的问题
- 用ShellExecute打开某个程序怎么得不到他的窗口句柄?进来帮忙看看
- 图片合并问题,急!!!!!!
Indy的Socks代理支持验证方法的
Socks需要密码验证时:
Authentication:=saUsernamePassword
不需要时:
Authentication:=saNoAuthentication
小弟初用delphi一周,望大家赐教.