Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我喜欢在我的 FTP 服务器上获取当前的目录。我知道我可以切换目录idFtp1.ChangeDir('MyDirectory); 但是我如何检查我是否已经进入这个目录?
idFtp1.ChangeDir('MyDirectory);
使用TIdFTP.RetrieveCurrentDir,它返回一个字符串,表示服务器上当前工作目录(当前目录)的名称:
TIdFTP.RetrieveCurrentDir
ServerDir := IdFtp1.RetrieveCurrentDir; // Do whatever with ServerDir to see if you need to change to a different one