例外が同じクラスからのものである場合、それがログイン情報例外であるか、接続が失われた例外であるかを確認する方法は?
private bool checkFileExists(string absoluteRemoteLocation)
{
try
{
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(absoluteRemoteLocation);
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Timeout = timeOut;
request.Credentials = new NetworkCredential(this.username, this.password);
request.GetResponse();
return true;
}
catch(Exception e) //i want to check here
{
var g = e.ToString();
return false;
}
}