I am using FTP to upload files from one server to another in my ASP.NET web application. However, when the FTP authentication fails, i.e. the username or password is wrong,
and then in my code where I use WebRequest
IIS will keep retrying the FTP connection even through the username or password is wrong.
After I stop the application pool and website, it still keeps retrying. I know there is a thread that keeps doing this, so I shut down the IIS service, then the retries stop.
The exception is:
System.Net.WebException: remote server can not log in!
在 System.Net.FtpWebRequest.SyncRequestCallback(Object obj)
在 System.Net.FtpWebRequest.RequestCallback(Object obj)
在 System.Net.CommandStream.InvokeRequestCallback(Object obj)
在 System.Net.CommandStream.Abort(Exception e)
在 System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage)
在 System.Net.FtpWebRequest.GetRequestStream()
在 CCMCMS.Web.Services.Ftp.UploadFile(String fullPath, String rootPath) 位置 C:\CCMCMS.Web\WCMS\Services\Ftp.cs:行? 249
Why does this happen?