System.IO.FileLoadException.ToString C# (CSharp) Méthode

ToString() public méthode

public ToString ( ) : String
Résultat String
        public override String ToString()
        {
            String s = GetType().FullName + ": " + Message;

            if (_fileName != null && _fileName.Length != 0)
                s += Environment.NewLine + String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("IO.FileName_Name"), _fileName);
            
            if (InnerException != null)
                s = s + " ---> " + InnerException.ToString();

            if (StackTrace != null)
                s += Environment.NewLine + StackTrace;

            try
            {
                if(FusionLog!=null)
                {
                    if (s==null)
                        s=" ";
                    s+=Environment.NewLine;
                    s+=Environment.NewLine;
                    s+=FusionLog;
                }
            }
            catch(SecurityException)
            {
            
            }

            return s;
        }

Usage Example

		public void NoRestriction ()
		{
			FileLoadException fle = new FileLoadException ("message", "filename",
				new FileLoadException ("inner message", "inner filename"));

			Assert.AreEqual ("message", fle.Message, "Message");
			Assert.AreEqual ("filename", fle.FileName, "FileName");
			Assert.IsNull (fle.FusionLog, "FusionLog");
			Assert.IsNotNull (fle.ToString (), "ToString");
		}
All Usage Examples Of System.IO.FileLoadException::ToString