こんにちは、次のコードがあります。
ftpRequest = (FtpWebRequest)WebRequest.Create(host + remoteFile);
/* Log in to the FTP Server with the User Name and Password Provided */
if (withDomain)
{
ftpRequest.Credentials = new NetworkCredential(user.Normalize(), pass.Normalize(), dom.Normalize());
}
else
{
ftpRequest.Credentials = new NetworkCredential(user.Normalize(), pass.Normalize());
}
ftpRequest.UseBinary = true;
ftpRequest.UsePassive = true;
ftpRequest.KeepAlive = true;
ftpRequest.Method = WebRequestMethods.Ftp.UploadFile;
/* Establish Return Communication with the FTP Server */
ftpStream = ftpRequest.GetRequestStream();
ドメインが提供されていない場合にのみエラーが発生します。つまり、ユーザー名とパスワードのみが提供されている場合にのみエラーが発生します。ただし、Dreamweaver やその他の FTP クライアント ツールでは、同じユーザー名とパスワードが正常に機能します。