ftp 汉字编码问题
我用以下代码来获取ftp服务器的文件目录
while (true)
{
int iBytes = socketData.Receive(buffer, buffer.Length, 0);
strMsg += System.Text.Encoding.UTF8.GetString(buffer, 0, iBytes);
if (iBytes < buffer.Length)
{
break;
}
}
char[] seperator = { '\n' };
string[] strsFileList = strMsg.Split(seperator);
可以正确显示文件目录。
但使用 下载命令是就有问题了,不是说找不到文件就是卡死。
SendCommand("RETR " + strRemoteFileName);
这个问题很是郁闷啊!哪位高手指教指教,小弟感激不尽。