using System;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Text;
namespace System.IO
{
/// The exception that is thrown when an attempt to access a file that does not exist on disk fails.
/// 2
// Token: 0x020001B8 RID: 440
[ComVisible(true)]
[Serializable]
public class FileNotFoundException : IOException
{
/// Initializes a new instance of the class with its message string set to a system-supplied message and its HRESULT set to COR_E_FILENOTFOUND.
// Token: 0x0600168E RID: 5774 RVA: 0x00056B00 File Offset: 0x00054D00
public FileNotFoundException()
: base(Locale.GetText("Unable to find the specified file."))
{
base.HResult = -2146232799;
}
/// Initializes a new instance of the class with its message string set to and its HRESULT set to COR_E_FILENOTFOUND.
/// A description of the error. The content of is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
// Token: 0x0600168F RID: 5775 RVA: 0x00056B20 File Offset: 0x00054D20
public FileNotFoundException(string message)
: base(message)
{
base.HResult = -2146232799;
}
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
/// A description of the error. The content of is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
/// The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception.
// Token: 0x06001690 RID: 5776 RVA: 0x00056B34 File Offset: 0x00054D34
public FileNotFoundException(string message, Exception innerException)
: base(message, innerException)
{
base.HResult = -2146232799;
}
/// Initializes a new instance of the class with its message string set to , specifying the file name that cannot be found, and its HRESULT set to COR_E_FILENOTFOUND.
/// A description of the error. The content of is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
/// The full name of the file with the invalid image.
// Token: 0x06001691 RID: 5777 RVA: 0x00056B4C File Offset: 0x00054D4C
public FileNotFoundException(string message, string fileName)
: base(message)
{
base.HResult = -2146232799;
this.fileName = fileName;
}
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
/// The error message that explains the reason for the exception.
/// The full name of the file with the invalid image.
/// The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception.
// Token: 0x06001692 RID: 5778 RVA: 0x00056B68 File Offset: 0x00054D68
public FileNotFoundException(string message, string fileName, Exception innerException)
: base(message, innerException)
{
base.HResult = -2146232799;
this.fileName = fileName;
}
/// Initializes a new instance of the class with the specified serialization and context information.
/// An object that holds the serialized object data about the exception being thrown.
/// An object that contains contextual information about the source or destination.
// Token: 0x06001693 RID: 5779 RVA: 0x00056B84 File Offset: 0x00054D84
protected FileNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
this.fileName = info.GetString("FileNotFound_FileName");
this.fusionLog = info.GetString("FileNotFound_FusionLog");
}
/// Gets the name of the file that cannot be found.
/// A containing the name of the file, or null if no file name was passed to the constructor for this instance.
/// 2
// Token: 0x170003F5 RID: 1013
// (get) Token: 0x06001694 RID: 5780 RVA: 0x00056BBC File Offset: 0x00054DBC
public string FileName
{
get
{
return this.fileName;
}
}
/// Gets the log file that describes why loading of an assembly failed.
/// A String containing errors reported by the assembly cache.
/// The caller does not have the required permission.
/// 2
///
///
///
// Token: 0x170003F6 RID: 1014
// (get) Token: 0x06001695 RID: 5781 RVA: 0x00056BC4 File Offset: 0x00054DC4
public string FusionLog
{
get
{
return this.fusionLog;
}
}
/// Gets the error message that explains the reason for the exception.
/// A string containing the error message.
/// 2
// Token: 0x170003F7 RID: 1015
// (get) Token: 0x06001696 RID: 5782 RVA: 0x00056BCC File Offset: 0x00054DCC
public override string Message
{
get
{
if (this.message == null && this.fileName != null)
{
return string.Format(CultureInfo.CurrentCulture, "Could not load file or assembly '{0}' or one of its dependencies. The system cannot find the file specified.", new object[] { this.fileName });
}
return this.message;
}
}
/// Sets the object with the file name and additional exception information.
/// The object that holds the serialized object data about the exception being thrown.
/// The object that contains contextual information about the source or destination.
/// 2
///
///
///
///
// Token: 0x06001697 RID: 5783 RVA: 0x00056C18 File Offset: 0x00054E18
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("FileNotFound_FileName", this.fileName);
info.AddValue("FileNotFound_FusionLog", this.fusionLog);
}
/// Returns the fully qualified name of this exception and possibly the error message, the name of the inner exception, and the stack trace.
/// A string containing the fully qualified name of this exception and possibly the error message, the name of the inner exception, and the stack trace.
/// 2
///
///
///
// Token: 0x06001698 RID: 5784 RVA: 0x00056C50 File Offset: 0x00054E50
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder(this.GetType().FullName);
stringBuilder.AppendFormat(": {0}", this.Message);
if (this.fileName != null && this.fileName.Length > 0)
{
stringBuilder.Append(Environment.NewLine);
stringBuilder.AppendFormat("File name: '{0}'", this.fileName);
}
if (this.InnerException != null)
{
stringBuilder.AppendFormat(" ---> {0}", this.InnerException);
}
if (this.StackTrace != null)
{
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(this.StackTrace);
}
return stringBuilder.ToString();
}
// Token: 0x0400067A RID: 1658
private const int Result = -2146232799;
// Token: 0x0400067B RID: 1659
private string fileName;
// Token: 0x0400067C RID: 1660
private string fusionLog;
}
}