查看: 1252|回复: 4
|
C#.NET 里的问题 Exception Handling
[复制链接]
|
|
问题在这里: " The type initializer for 'Signal.Signalclass' threw an exception "
System.TypeInitializationException was unhandled
Message="The type initializer for 'Signal.Signalclass' threw an exception."
Source="Authentication Using Bio-Signal Processing"
TypeName="Signal.Signalclass"
StackTrace:
at Signal.Signalclass..ctor()
at Authentication_Using_Bio_Signal_Processing.frmSignal.bttnFilter_Click(Object sender, EventArgs e) in C:\Authentication Using Bio-Signal Processing\Authentication Using Bio-Signal Processing\frmSignal.cs:line 60
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Authentication_Using_Bio_Signal_Processing.Program.Main() in C:\Authentication Using Bio-Signal Processing\Authentication Using Bio-Signal Processing\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart() |
|
|
|
|
|
|
|
楼主 |
发表于 19-4-2006 12:06 AM
|
显示全部楼层
Signalclass SendSignal = new Signalclass(); <<----- Error 所在
SendSignal.mixingwithleorsignal2(x1, x2, x3); |
|
|
|
|
|
|
|
楼主 |
发表于 19-4-2006 12:31 AM
|
显示全部楼层
report 说是 TypeInitializationException.
请问什么是TypeInitializationException?
如何解决? |
|
|
|
|
|
|
|
发表于 19-4-2006 09:15 AM
|
显示全部楼层
原帖由 heng81 于 19-4-2006 12:31 AM 发表
report 说是 TypeInitializationException.
请问什么是TypeInitializationException?
如何解决?
你需要这样写:
try {
Signalclass SendSignal = new Signalclass();
} catch (TypeInitializationException ) {
// 当出现问题的, 应对的 code.
} |
|
|
|
|
|
|
|
楼主 |
发表于 19-4-2006 10:01 PM
|
显示全部楼层
|
|
|
|
|
|
| |
本周最热论坛帖子
|