110,533
社区成员
发帖
与我相关
我的任务
分享
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException
+= new ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException
+= new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
CPC_Event_Data EventData = (CPC_Event_Data)Marshal.PtrToStructure(
new IntPtr(0x00000005), typeof(CPC_Event_Data));
<configuration>
<runtime>
<legacyCorruptedStateExceptionsPolicy enabled="true"/>
</runtime>
</confguration>
你可以试试。
[HandleProcessCorruptedStateExceptions]
[SecurityCritical]
void HandleCPPException()
{
try{
//do some native exception
}
catch(system.accessvioliationexception) //捕获cse类型的异常
{}
}