尝试从远程服务器删除文件:遇到错误:远程服务器返回错误:(404)Not Found

时间:2015-07-05 05:09:47

标签: asp.net vb.net http ftp

我正在使用此代码删除文件

    Protected Sub DeleteFTP(strFTPFilePath As String, strUserName As String, strPassword As String)

    Dim requestFileDelete As HttpWebRequest = HttpWebRequest.Create(strFTPFilePath)
    requestFileDelete.Credentials = New NetworkCredential(strUserName, strPassword)
    requestFileDelete.Method = WebRequestMethods.Http.Get

    Dim responseFileDelete As HttpWebResponse = requestFileDelete.GetResponse()


     End Sub

这一行: Dim responseFileDelete As HttpWebResponse = requestFileDelete.GetResponse() 产生错误。

1 个答案:

答案 0 :(得分:0)

酷。 ..我得到了解决方案。 用Ftp替换HttpWebRequest