2021年3月2日星期二

How to show FTP server list in ListBox using MFC

I want to make an FTP server client using MFC.

Server connection has been successful.

How do I print a list of FTP server files and diretory in the list box??

Any advice would be appreciated with a simple example.

CInternetSession m_Session;  CFtpConnection* m_pConnection;  CFtpFileFind* m_pFileFind;  CListBox m_List;  CString m_strIP, m_strID, m_strPass;    void CMFC_FTPDlg::ConnectFTP()  {      GetDlgItemText(IDC_EDIT_IP, m_strIP);      GetDlgItemText(IDC_EDIT_ID, m_strID);      GetDlgItemText(IDC_EDIT_PASS, m_strPass);      m_nPort = GetDlgItemInt(IDC_EDIT_PORT);            m_pConnection = m_Session.GetFtpConnection(m_strIP, m_strID, m_strPass, m_nPort);            if(!m_pConnection)      {          AfxMessageBox("ERROR : Disconnected!!");          m_pConnection = NULL;          m_bContinue = FALSE;          return;      }      else      {          AfxMessageBox("Connected!!");          m_bContinue = TRUE;      }  }    void CMFC_FTPDlg::ShowList()  {      int nResult;      nResult = m_pConnection->SetCurrentDirectory("test");  }  
https://stackoverflow.com/questions/66450393/how-to-show-ftp-server-list-in-listbox-using-mfc March 03, 2021 at 11:34AM

没有评论:

发表评论