在线等!!!怎样用代码删除ftp下的文件?解决就结贴!

Caps77 2004-06-21 08:54:28
我有一个ftp类,登录,上传,下载功能都有,可是不能删除,请教大侠怎么删除ftp下的文件。解决就结贴!
...全文
140 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
CsdnRob 2004-07-02
  • 打赏
  • 举报
回复
Oracle中的方案就等同于SQL Server中的数据库,你可以这样理解。 你好先建立一个用户,然后在这个用户里建表,你就可以看到你的方案,也就是你说的SQL Server中的数据库
Caps77 2004-06-22
  • 打赏
  • 举报
回复
我现在要用向ftp服务器发送命令的方式进行ftp操作,删除文件的命令是DELE,但该命令只能删除文件,而不能删除文件夹!我想删除文件夹该咋办?
beijingshizi 2004-06-22
  • 打赏
  • 举报
回复
RMDIR
beijingshizi 2004-06-21
  • 打赏
  • 举报
回复
Remove 啊。 系统提供
gracezhu 2004-06-21
  • 打赏
  • 举报
回复
Steps in a Typical FTP Client Application to Delete a File
Home | Overview | How Do I

The following table shows the steps you might perform in a typical FTP client application that deletes a file.

Your goal Actions you take Effects
Begin an FTP session. Create a CInternetSession object. Initializes WinInet and connects to server.
Connect to an FTP server. UseCInternetSession::
GetFtpConnection. Returns aCFtpConnection object.
Check to make sure you’re in the right directory on the FTP server. UseCFtpConnection::
GetCurrentDirectory orCFtpConnection::
GetCurrentDirectoryAsURL. Returns the name or URL of the directory you are currently connected to on the server, depending on the member function selected.
Change to a new FTP directory on the server. UseCFtpConnection::
SetCurrentDirectory. Changes the directory you are currently connected to on the server.
Find the first file in the FTP directory. UseCFtpFileFind::FindFile. Finds the first file. Returns FALSE if no files are found.
Find the next file in the FTP directory. UseCFtpFileFind::
FindNextFile. Finds the next file. Returns FALSE if the file is not found.
Delete the file found by FindFile or FindNextFile. UseCFtpConnection::Remove, using the file name returned by FindFile or FindNextFile. Deletes the file on the server for reading or writing.
Handle exceptions. Use theCInternetException class. Handles all common Internet exception types.
End the FTP session. Dispose of theCInternetSession object. Automatically cleans up open file handles and connections.
bluebohe 2004-06-21
  • 打赏
  • 举报
回复
CFtpConnection::Remove
BOOL Remove( LPCTSTR pstrFileName );

Return Value

Nonzero if successful; otherwise 0. If the call fails, the Win32 functionGetLastError may be called to determine the cause of the error.

Parameters

pstrFileName

A pointer to a string containing the file name to remove.

Remarks

Call this member function to delete the specified file from the connected server.

The pstrFileName parameter can be either a partially qualified filename relative to the current directory or fully qualified. A backslash (\) or forward slash (/) can be used as the directory separator for either name. The Remove function translates the directory name separators to the appropriate characters before they are used.

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧