本文整理汇总了C#中ErrorInfo.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorInfo.GetType方法的具体用法?C# ErrorInfo.GetType怎么用?C# ErrorInfo.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorInfo
的用法示例。
在下文中一共展示了ErrorInfo.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Append
public override void Append(ErrorInfo errorInfo)
{
Assembly assembly = errorInfo.GetType().Assembly;
var pairs = new Dictionary<string, string>();
pairs.Add("Date", DateTime.Now.ToString());
pairs.Add("Culture", CultureInfo.CurrentCulture.Name);
#if !SILVERLIGHT
pairs.Add("User", string.Format(CultureInfo.InvariantCulture, @"{0}\{1}", Environment.UserDomainName, Environment.UserName).Trim('\\'));
pairs.Add("Machine Name", Environment.MachineName);
pairs.Add("App Start Time", Process.GetCurrentProcess().StartTime.ToLocalTime().ToString(CultureInfo.InvariantCulture));
pairs.Add("App Up Time", (DateTime.Now - Process.GetCurrentProcess().StartTime.ToLocalTime()).ToString());
pairs.Add("Worker process", GetWorkerProcess());
pairs.Add("AppDomain", AppDomainDetail(AppDomain.CurrentDomain));
pairs.Add("Deployment", (assembly.GlobalAssemblyCache) ? "GAC" : "bin");
#endif
pairs.Add("Thread Id", Thread.CurrentThread.ManagedThreadId.ToString(CultureInfo.InvariantCulture));
pairs.Add("Full Name", new AssemblyName(assembly.FullName).FullName);
pairs.Add("Operating System Version", Environment.OSVersion.ToString());
pairs.Add("Common Language Runtime Version", Environment.Version.ToString());
pairs.Add("Elmah.Everywhere Version", new AssemblyName(typeof(Diagnostics.ExceptionHandler).Assembly.FullName).Version.ToString());
errorInfo.AddDetail(this.Name, pairs);
}