佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1251|回复: 4

C#.NET 里的问题 Exception Handling

[复制链接]
发表于 18-4-2006 11:51 PM | 显示全部楼层 |阅读模式
问题在这里:   " 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()
回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 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 | 显示全部楼层
谢谢你了 goatstudio ! 问题解决了.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 13-11-2024 08:23 PM , Processed in 0.450762 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表