码迷,mamicode.com
首页 > 其他好文 > 详细

异常的中英文对照

时间:2015-09-17 15:00:16      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:

在触发异常的地方添加一下代码,就会出现英文的异常

 Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
 Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;

 

 1.

Could not load type ‘ZITaker.Struct.StClientData‘ from assembly ‘ZITaker, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null‘ because it contains an object field at offset 10 that is incorrectly aligned or overlapped by a non-object field.

未能从程序集“ZITaker, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null”中加载类型“ZITaker.Struct.StClientData”,因为它在 10 偏移位置处包含一个对象字段,该字段已由一个非对象字段不正确地对齐或重叠。

使用这个导致的

[StructLayout(LayoutKind.Explicit)]

The precise position of each member of an object in unmanaged memory is explicitly controlled, subject to the setting of the System.Runtime.InteropServices.StructLayoutAttribute.Pack field.
Each member must use the System.Runtime.InteropServices.FieldOffsetAttribute to indicate the position of that field within the type.

 

2.

Attempted to perform an unauthorized operation.

尝试执行未经授权的操作。

异常的中英文对照

标签:

原文地址:http://www.cnblogs.com/chucklu/p/4816120.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!