//获取当前账号下所有的文件及目录
void GetFileDir()
{
// TODO: 在此添加控件通知处理程序代码
sf::IpAddress address = "127.0.0.1";
sf::Ftp server;
sf::Ftp::Response connectResponse = server.connect(address);
if (!connectResponse.isOk())
{
//连接失败
} // Ask for user name and password
std::string user = "test", password = "5482";
// Login to the server
sf::Ftp::Response loginResponse = server.login(user, password);
if (!loginResponse.isOk())
{
//登录失败
}
sf::Ftp::DirectoryResponse response = server.getWorkingDirectory();
const string strMsg = response.getMessage(); sf::Ftp::ListingResponse response1 = server.getDirectoryListing();
const std::vector<std::string>& names = response1.getListing();
for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); ++it)
{
string strName = *it;
//utf8编码转为gb2312编码
string strZWValue = Coding::UTF8ToGB2312(strName);
int yy = 55;
} server.disconnect();
}