未处理 System.Runtime.InteropServices.SEHException 。 5C

未处理 System.Runtime.InteropServices.SEHException
Message=外部组件发生异常。
Source=TD_Mgd_3.03_9
ErrorCode=-2147467259
StackTrace:
在 odUninitialize()
在 Teigha.Runtime.Services.UnInit()
在 Teigha.Runtime.Services.~Services()
在 Teigha.Runtime.Services.Dispose(Boolean )
在 Teigha.Runtime.Services.Dispose()
在 CableSystem.Form1.CADshow_FormClosing(Object sender, FormClosingEventArgs e) 位置 D:\Softwear\project\vs_day1\CAD_demo\test_1\CableSystem\CableSystem\Form1.cs:行号 38
在 System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
在 System.Windows.Forms.Form.WmClose(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException:

2个回答

FormClosing(窗口关闭)的时候有多线程没有结束或者有ole控件没有释放,具体要看你的程序。

FormClosing(窗口关闭)的时候,有线程没有结束或者正确释放,其中丢出了win32异常。具体要调试下,在窗体关闭以前,确认这些线程和activex控件都正确释放。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
未处理的“System.Runtime.InteropServices.SEHException”类型的异常出现
采用tcp/IP网络传输机制,有2个线程,其中线程A中有文件读取动作,有数据库插入,有向服务器端传输数据的动作;另外一个线程B中有文件读取动作,有向服务器传输数据工作,没有数据库操作。rnrn当我断掉网络的时候,会有机制另程序重新连接服务器,可是程序会死在插入数据库的函数中,而且每一次都死在数据库插入函数中,如果是win32 平台情况下,则提示的是:rn未处理的“System.Runtime.InteropServices.SEHException”类型的异常出现,rn如果是vc/mfc的平台下,则提示异常。rnrn但都是死在数据库插入函数中。rn有人遇到过这种情况吗??实在是不明白!rn
什么错误!急死==>未处理的“System.Runtime.InteropServices.SEHException”类型的异常出现在 system.windows.forms.dll 中
其他信息: 外部组件发生异常。rnrn
System.Runtime.InteropServices.SEHException异常,,,,郁闷死~~~
tryrn rn if (host.Length() == 0)rn return false;rn if (user.Length() == 0)rn return false;rn if (password.Length() == 0)rn return false;rn if (port == 0)rn port = 21;rn rn Host = host;rn Port = port;rn UserID = user;rn Password = password;rnrn pFtp->Host = Host;rn pFtp->Port = Port;rn pFtp->UserID = UserID;rn pFtp->Password = Password;rnrn pFtp->Connect();rnrn this->Connected = true;rnrn return this->Connected;rn catch(Exception &e)rn rn MessageBox(NULL, (e.Message + "[Host=" + Hostrn + " user=" + UserID + " password=" + Password).c_str(), "异常",rn MB_OK);rn return false;rnrn rnrnrn求助~~,以上代码用C#调用后总是出现System.Runtime.InteropServices.SEHException异常,异常信息为外部组件发生异常rnrn哪位老大救救偶啊~~~,偶想跳楼~
急等...... System.Runtime.InteropServices.SEHException in C#
在winform开发中用到splitter控件时,对其拖动时报出System.Runtime.InteropServices.SEHException (外部组件发生异常), 我想不明白的是,这本来就是MS提供的组件,怎么会报这样的错?waiting......
外部组件异常:System.Runtime.InteropServices.SEHException
未处理 System.Runtime.InteropServices.SEHExceptionrn HResult=-2147467259rn Message=外部组件发生异常。rn Source=Interop.TerraExplorerXrn ErrorCode=-2147467259rn StackTrace:rn 在 TerraExplorerX.ICreator61.CreateNewFeatureLayer(String layerName, LayerGeometryType LayerGeomType, String sConnectionString, Int32 lParentGroupID)rn 在 createNewFeatureLayer.Form1.createNewFeatureLayer_Click(Object sender, EventArgs e) 位置 D:\MyCode\createNewFeatureLayer\CreateNewFeatureLayer\Form1.cs:行号 73rn 在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)rn 在 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)rn 在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)rn 在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)rn 在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)rn 在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)rn 在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)rn 在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)rn 在 System.Windows.Forms.Control.WndProc(Message& m)rn 在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)rn 在 System.Windows.Forms.ToolStrip.WndProc(Message& m)rn 在 System.Windows.Forms.MenuStrip.WndProc(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)rn 在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)rn 在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)rn 在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)rn 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)rn 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)rn 在 System.Windows.Forms.Application.Run(Form mainForm)rn 在 createNewFeatureLayer.Program.Main() 位置 D:\MyCode\createNewFeatureLayer\CreateNewFeatureLayer\Program.cs:行号 19rn 在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)rn 在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)rn 在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()rn 在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)rn 在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)rn 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)rn 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)rn 在 System.Threading.ThreadHelper.ThreadStart()rn InnerException: rnrnrn在程序运行的时候弹出的,关键代码就一行,就是调用的组件的函数TerraExplorerX.ICreator61.CreateNewFeatureLayer(String layerName, LayerGeometryType LayerGeomType, String sConnectionString, Int32 lParentGroupID),但是弹出异常。在技术支持的机子上可以通过,在自己单位的机子上不可以。我自己感觉有两个方面,一可能是组件的License问题,软件破解的不完全;二这个函数会在C://用户下面创建文件可能是读写权限的问题。由于一直没找到解决办法,请老师分析下原因可能出在什么地方。谢谢!
“System.Runtime.InteropServices.SEHException”类型的异常的问题?
未处理的“System.Runtime.InteropServices.SEHException”类型的异常出现在 RSAFinish.exe 中。rnrn其他信息: 外部组件发生异常。rnrn[code=C/C++]string aaa = "%e4%b8%ad%e5%9b%bd%e4%ba%ba%e6%b0%91";rnrnstring c = "";rnrnrsa.DecodeChinese(&c, aaa);/*这个地方都进不去,在Win32控制台程序中正常*/[/code]rnrn其他函数在同一个文件中的都能正常执行。rnrn这是函数的声明:[code=C/C++]int DecodeChinese(string* des, string Str);[/code]rnrn在同一文件中有多个这样的函数,都能正常执行。rn[code=C/C++]int DeStrSection(string* DeStr, int d_size, string NotDeStr, int l, char* keyD, char* keyPub);rnrnint EnStrSection(string* EnStr, int d_size, string NotEnStr, int l, char* keyE, char* keyPub);[/code]rnrn我用的是VS2005。rnrn
System.Runtime.InteropServices.SEHException: 外部组件发生异常
程序运行时会偶尔冒出如题的异常,然后程序直接关闭rnrn以下是其中两次的错误信息输出:rnrn1、rn15:50:22> Program->Main()时错误:外部组件发生异常。rn详细堆栈内容 在 System.Drawing.SafeNativeMethods.Gdip.FindAtom(String rnrnlpString)rn 在 System.Drawing.SafeNativeMethods.Gdip.GdipDeleteMatrix(HandleRef rnrnmatrix)rn 在 System.Drawing.Drawing2D.Matrix.Dispose(Boolean disposing)rn 在 System.Drawing.Drawing2D.Matrix.Dispose()rn 在 System.Drawing.GraphicsContext..ctor(Graphics g)rn 在 System.Drawing.Graphics.Save()rn 在 System.Windows.Forms.PaintEventArgs.get_Graphics()rn 在 System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs rnrne, Rectangle rectangle, Region transparentRegion)rn 在 System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, rnrnRectangle rectangle, Color backColor, Point scrollOffset)rn 在 System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, rnrnRectangle rectangle)rn 在 System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)rn 在 System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs rnrne)rn 在 System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs rnrne, Rectangle rectangle, Region transparentRegion)rn 在 System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, rnrnRectangle rectangle, Color backColor, Point scrollOffset)rn 在 System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, rnrnRectangle rectangle)rn 在 System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)rn 在 System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs rnrne)rn 在 System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs rnrne, Rectangle rectangle, Region transparentRegion)rn 在 System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, rnrnRectangle rectangle, Color backColor, Point scrollOffset)rn 在 System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, rnrnRectangle rectangle)rn 在 System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)rn 在 DevComponents.DotNetBar.ButtonX.OnPaint(PaintEventArgs e)rn 在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, rnrnInt16 layer, Boolean disposeEventArgs)rn 在 System.Windows.Forms.Control.WmPaint(Message& m)rn 在 System.Windows.Forms.Control.WndProc(Message& m)rn 在 DevComponents.DotNetBar.PopupItemControl.WndProc(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)rn 在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 rnrnmsg, IntPtr wparam, IntPtr lparam)rn 在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)rn 在 rnrnSystem.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafernrnNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, rnrnInt32 reason, Int32 pvLoopData)rn 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInnerrnrn(Int32 reason, ApplicationContext context)rn 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 rnrnreason, ApplicationContext context)rn 在 System.Windows.Forms.Application.Run(Form mainForm)rn 在 CardServer.Program.Main() 位置 H:\高铁快卡通\SVN\src\客服系统rnrn\CardServer新版\CardServer\Program.cs:行号 28rn引起异常的对象:System.Drawingrnrn2、rn14:39:01> 在 System.Drawing.SafeNativeMethods.Gdip.GdipGetFontHeight(HandleRef font, HandleRef graphics, Single& size)rn 在 System.Drawing.Font.GetHeight(Graphics graphics)rn 在 System.Drawing.Font.GetHeight()rn 在 System.Drawing.Font.get_Height()rn 在 DevComponents.DotNetBar.Controls.TextBoxX.?()rn 在 DevComponents.DotNetBar.Controls.TextBoxX.InvalidateNonClient()rn 在 DevComponents.DotNetBar.Controls.TextBoxX.?(Object ?, EventArgs ?)rn 在 DevComponents.Editors.VisualItem.OnArrangeInvalid()rn 在 DevComponents.Editors.VisualItem.InvalidateArrange()rn 在 DevComponents.DotNetBar.Controls.TextBoxX.OnResize(EventArgs e)rn 在 System.Windows.Forms.Control.OnSizeChanged(EventArgs e)rn 在 System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)rn 在 System.Windows.Forms.Control.UpdateBounds()rn 在 System.Windows.Forms.Control.WmCreate(Message& m)rn 在 System.Windows.Forms.Control.WndProc(Message& m)rn 在 System.Windows.Forms.TextBoxBase.WndProc(Message& m)rn 在 System.Windows.Forms.TextBox.WndProc(Message& m)rn 在 DevComponents.DotNetBar.Controls.TextBoxX.WndProc(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)rn 在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)rn 在 System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)rn 在 System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)rn 在 System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)rn 在 System.Windows.Forms.Control.CreateHandle()rn 在 System.Windows.Forms.TextBoxBase.CreateHandle()rn 在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)rn 在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)rn 在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)rn 在 System.Windows.Forms.Control.CreateControl()rn 在 System.Windows.Forms.Control.WmShowWindow(Message& m)rn 在 System.Windows.Forms.Control.WndProc(Message& m)rn 在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)rn 在 System.Windows.Forms.ContainerControl.WndProc(Message& m)rn 在 System.Windows.Forms.Form.WmShowWindow(Message& m)rn 在 System.Windows.Forms.Form.WndProc(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)rn 在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)rn 在 System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)rn 在 System.Windows.Forms.Control.SetVisibleCore(Boolean value)rn 在 System.Windows.Forms.Form.SetVisibleCore(Boolean value)rn 在 System.Windows.Forms.Control.set_Visible(Boolean value)rn 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)rn 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)rn 在 System.Windows.Forms.Application.RunDialog(Form form)rn 在 System.Windows.Forms.Form.ShowDialog(IWin32Window owner)rn 在 System.Windows.Forms.Form.ShowDialog()rn 在 CardServer.GUI.FrmMain.btAddCancel_Click(Object sender, EventArgs e) 位置 H:\高铁快卡通\SVN\src\客服系统\CardServer新版\CardServer\GUI\FrmMain.cs:行号 1120rn 在 System.Windows.Forms.Control.OnClick(EventArgs e)rn 在 DevComponents.DotNetBar.ButtonX.PerformClick()rn 在 DevComponents.DotNetBar.ButtonX.ProcessMnemonic(Char charCode)rn 在 System.Windows.Forms.ContainerControl.ProcessMnemonic(Char charCode)rn 在 System.Windows.Forms.Form.ProcessMnemonic(Char charCode)rn 在 System.Windows.Forms.ContainerControl.ProcessDialogChar(Char charCode)rn 在 System.Windows.Forms.Form.ProcessDialogChar(Char charCode)rn 在 System.Windows.Forms.Control.ProcessDialogChar(Char charCode)rn 在 System.Windows.Forms.Control.ProcessDialogChar(Char charCode)rn 在 System.Windows.Forms.Control.ProcessDialogChar(Char charCode)rn 在 System.Windows.Forms.Control.ProcessDialogChar(Char charCode)rn 在 System.Windows.Forms.Control.PreProcessMessage(Message& msg)rn 在 System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)rn 在 System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)rn 在 System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)rn 在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)rn 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)rn 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)rn 在 System.Windows.Forms.Application.Run(Form mainForm)rn 在 CardServer.Program.Main() 位置 H:\高铁快卡通\SVN\src\客服系统\CardServer新版\CardServer\Program.cs:行号 28rnrn都是在System.Drawing.SafeNativeMethods.Gdip里的函数里报错 ,不知道这个是干吗用的?rnrn我使用的第三方控件只有DotNetBar,会是DotNetBar的BUG么?rnrn求助高手啊
异常详细信息: System.Runtime.InteropServices.SEHException: 外部组件发生异常。
前断时间还是好好的,今天怎就出这问题啦呢rn真的是愁眉苦站。。。rn谁能告诉我怎么办。
未处理的异常
在某一个项目中,一开始没出现这个错误,后来过了一年后,再运行这个程序的时候,总是报堆栈溢出的错误。经过好几天的折腾,配置环境,调整视频格式,终于发现,其实是有一行代码的内存过大,所以才会溢出,遇到此类问题的时候,一定要仔细排查整个项目中所有的和内存相关的代码。因为在这个项目中,在函数的第一句就报错了,误导了我们,让我们以为是opencv封装的函数的问题,其实是这个函数中的某一句话出现了问题。。。为...
未处理 System.Runtime.Remoting.RemotingException?
未处理 System.Runtime.Remoting.RemotingExceptionrn Message="无法加载类型“zhl.Person, Person, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”。"rn下面是Person类:rnnamespace zhlrnrn public class Person:MarshalByRefObjectrn rn private string m_name;rnrn public string Namern rn getrn rn return this.m_name;rn rn setrn rn this.m_name = value;rn rn rn public string SayHello()rn rn Console.WriteLine("Hello,my name is 0",m_name);rn return "Hi," + m_name;rn rn rnrn然后是客户端调用:rnrnrn rn rn rn rn rn rn rn rn rn rnrnrnusing System;rnusing System.Runtime.Remoting;rnrnnamespace zhlrnrn class ActiveClientrn rn static void Main(string[] args)rn rn RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);rnrn Person p = new Person();rn p.Name = "zhao hongliang";rn p.SayHello();rn Console.WriteLine("Press enter to exit.");rn Console.ReadLine();rn rn rnrnrn服务器端调用:rnrnrn rn rn rn rn rn rn rn rn rn rnrnrnusing System;rnusing System.Runtime.Remoting;rnrnnamespace zhlrnrn class ActiveServerrn rn static void Main(string[] args)rn rn RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);rn Console.WriteLine("Press enter to exit");rn Console.ReadLine();rn rn rnrn快疯掉了 找不到错误~!
未处理NullReferenceException
[code=csharp]public class Complexrn rn private double realPart, imaginaryPart;rn public double RealPartrn get return realPart; set rn public double ImaginaryPartrn get return imaginaryPart; set rn public Complex(double realPart, double imaginaryPart)rn //构造复数函数rn rn this.realPart = realPart; this.imaginaryPart = imaginaryPart;rn rn rn rn //复数取模值//rn rn public static Double Modulus(Complex z)rn rn double modular = new double();rn [color=#FF0000]modular=Math.Sqrt(z.realPart*z.realPart+z.imaginaryPart*z.imaginaryPart);[/color]rn return modular;rn rn public static Complex Conjugate(Complex z)rn //复数的共轭rn rn return new Complex(z.realPart, -z.imaginaryPart);rn rn //复数的加减乘除//rn private static Complex Add( Complex z1, Complex z2)rn rn return new Complex(z1.realPart+z2.realPart,z1.imaginaryPart+z2.imaginaryPart);rn rn private static Complex Subtract(Complex z1, Complex z2)rn rn return new Complex(z1.realPart-z2.realPart,z1.imaginaryPart-z2.imaginaryPart);rn rn private static Complex Multiply(Complex z1, Complex z2)rn rn Complex z=new Complex (0,0);rn z.realPart=z1.realPart*z2.realPart-z1.imaginaryPart*z2.imaginaryPart;rn z.imaginaryPart=z1.imaginaryPart*z2.realPart+z1.realPart*z2.imaginaryPart;rn return z;rn rn private static Complex Divide(Complex z1, Complex z2)rn rn Complex z=new Complex (0,0);rn z.realPart=(z1.realPart*z2.realPart+z1.imaginaryPart*z2.imaginaryPart)/Modulus(z2);rn z.imaginaryPart=z1.imaginaryPart*z2.realPart-z1.realPart*z2.imaginaryPart/Modulus(z2);rn return z;rn rn //加减乘除的重载//rn public static Complex operator +(Complex z1,Complex z2)rn rn return Add(z1,z2);rn rn public static Complex operator -(Complex z1, Complex z2)rn rn return Subtract(z1, z2);rn rn public static Complex operator *(Complex z1, Complex z2)rn rn return Multiply(z1, z2);rn rn public static Complex operator /(Complex z1, Complex z2)rn rn return Divide(z1, z2);rn rn //将复数转化成弧度表示形式//rn public double angle(Complex z1)rn rn if (z1.realPart == 0)rn rn if (z1.imaginaryPart > 0) return 90.0;rn else if (z1.imaginaryPart == 0) return 0.0;rn else return -90.0;rn rn else if (z1.realPart < 0)rn rn if (z1.imaginaryPart == 0) return 180d;rn else if (z1.imaginaryPart > 0) return Math.Atan(z1.imaginaryPart / z1.realPart) * 180d / Math.PI + 180d;rn else return Math.Atan(z1.imaginaryPart / z1.realPart) * 180d / Math.PI - 180d;rn rn else return Math.Atan(z1.imaginaryPart / z1.realPart) * 180 / Math.PI;rn rn [/code]rn红色字段报错rn[img=https://img-bbs.csdn.net/upload/201307/20/1374286472_182232.jpg][/img]
未处理SqlException
文件一:主要是进行数据库的链接rnclass Mymeansrn rn public static SqlConnection My_con;rn public static string Login_ID = "";rn public static string Login_Name = "";rn public static string M_str_sqlcon = "Data Source=.;Database=db_PWMS;User id=;Pwd= ";rn public static int Login_n = 0;rn public static string AllSql = "Select * From 职工基本信息";rn rnrn public static SqlConnection getcon()rn rn My_con = new SqlConnection(M_str_sqlcon);rn My_con.Open();rn return My_con;rn rnrn public void con_close()rn rn if (My_con.State == ConnectionState.Open)rn rn My_con.Close();rn My_con.Dispose();rn rn rnrn public SqlDataReader getcom(string SQLstr)rn rn getcon();rn SqlCommand My_com = My_con.CreateCommand();rn My_com.CommandText = SQLstr;rn SqlDataReader My_read = My_com.ExecuteReader();rn return My_read;rn rnrn public void getsqlcom(string SQLstr)rn rn getcon();rn SqlCommand SQLcom = new SqlCommand(SQLstr,My_con);rn SQLcom.ExecuteNonQuery();rn SQLcom.Dispose();rn con_close();rn rnrn public DataSet getDataSet(string SQLstr, string tableName)rn rn getcon();rn SqlDataAdapter SQLda = new SqlDataAdapter(SQLstr, My_con);rn DataSet My_DataSet = new DataSet();rn SQLda.Fill(My_DataSet, tableName);rn con_close();rn return My_DataSet;rn rnrnrnrn文件二:一些公共类的设计rnclass MyModulern rn PMS.Mymeans MyDataClass =new PMS.Mymeans();rn public static string ADDs="";rn public static string FindValue = "";rn public static string Address_ID="";rn public static string User_ID ="";rn public static string User_Name="";rnrn public void Show_Form(string FrmName, int n)rn rn if (n == 1)rn rn if (FrmName == "人事档案管理")rn rn PMS.F_MainFile FrmManFile = new F_MainFile();rn FrmManFile.Text = "人事档案管理";rn FrmManFile.ShowDialog();rn FrmManFile.Dispose();rn rnrn rn rnrn public void Clear_Control(Control.ControlCollection Con)rn rn foreach (Control C in Con)rn rn if (C.GetType().Name == "TextBox")rn if (((TextBox)C).Visible == true)rn ((TextBox)C).Clear();rn if (C.GetType().Name == "MaskedTextBox")rn if (((MaskedTextBox)C).Visible == true)rn ((MaskedTextBox)C).Clear();rn if (C.GetType().Name == "ComboBox")rn if (((ComboBox)C).Visible == true)rn ((ComboBox)C).Text="";rn if (C.GetType().Name == "PictureBox")rn if (((PictureBox)C).Visible == true)rn ((PictureBox)C).Text="";rnrn rn rnrn public string GetAutocoding(string TableName, string ID)rn rn SqlDataReader MyDR = MyDataClass.getcom("select max(" + ID + ")NID from " + TableName);rn int Num = 0;rn if (MyDR.HasRows)rn rn MyDR.Read();rn if (MyDR[0].ToString() == "")rn return "0001";rn Num = Convert.ToInt32(MyDR[0].ToString());rn ++Num;rn string s = string.Format("0:0000", Num);rn return s;rn rn elsern rn return "0001";rn rn rnrn public void Ena_Button(Button B1, Button B2, Button B3, Button B4, int n1, int n2, int n3, int n4)rn rn B1.Enabled = Convert.ToBoolean(n1);rn B2.Enabled = Convert.ToBoolean(n2);rn B3.Enabled = Convert.ToBoolean(n3);rn B4.Enabled = Convert.ToBoolean(n4);rn rn rnrnrn文件三:在窗口中单击“添加”按钮时,则首先会调用Clear_Control方法,将指定控件集下的控件进行清空,然后根据表名和ID字段调用GetAutocoding方法进行自动编号。rnrn public partial class F_MainFile : Formrn rn public F_MainFile()rn rn InitializeComponent();rn rnrn PMS.Mymeans MyDataClass = new PMS.Mymeans();rn PMS.MyModule MyMC = new PMS.MyModule();rn public static DataSet MyDS_Grid;rn public static string tem_Field = "";rn public static string tem_Value = "";rn public static string tem_ID = "";rn public static int hold_n = 0;rn public static byte[] imgBytesIn; //用来存储图片的二进制数rn public static int Ima_n = 0; //判断是否对图片进行了操作rn public static string Part_ID = ""; //存储数据表的ID信息rnrn private void Sut_Add_Click(object sender, EventArgs e)rn rn MyMC.Clear_Control(tabControl1.TabPages[0].Controls);rn S_0.Text = MyMC.GetAutocoding("职工基本信息", "职工编号");rn hold_n = 1;rn MyMC.Ena_Button(Sut_Add, Sut_Amend, Sut_Cancel, Sut_Save, 0, 0, 1, 1);rn groupBox5.Text = "当前正在添加信息";rn Img_Clear.Enabled = true;rn Img_Save.Enabled = true;rnrn rnrnrnrn文件四:数据库内容rn数据库名为db_PWMSrn其中的一个表,名为:职工基本信息rn此表内容为:rn列名 数据类型rn职工编号 varchar(5)rn职工姓名 varchar(20)rnrnrn进行调试rn当单击“添加”按钮时rn会出现以下错误:rn未处理SqlExceptionrn‘ ‘附件有语法错误rnrn此时错误的箭头会指向以下数据库链接语句的黄色处rn public SqlDataReader getcom(string SQLstr)rn rn getcon();rn SqlCommand My_com = My_con.CreateCommand();rn My_com.CommandText = SQLstr;rn SqlDataReader My_read = My_com.ExecuteReader();rn return My_read;rn rnrn如何去解决这个问题呢?rn
未处理 System.FormatException?
这句 fee_change_money = Convert.ToInt32(fee_real_money)-fee_f_money;rn未处理 System.FormatException rn什么问题呢?如何纠正啊?rnrn[code=C#]rn private void list_post_Click(object sender, EventArgs e)rn rnsd_all_money = (int)(Math.Floor(sd_all_money / 300) * 4);rnif(sd_all_money>9)rnrnsd_all_money = 9;rnrn rnrnstring fee_real_money;rnint card_id,class_card_fee,fee_free_all_money;rnrnrnprivate void fee_sum_end_Click(object sender, EventArgs e)rn rn rn fee_free_all_money = (int)(class_card_fee + sd_all_money);rn if (fee_free_all_money > 16)rn rn fee_free_all_money = 16;rn rnfee_f_money = ((int)(Math.Floor(fee_all_time)) * 4 + rn(int)((fee_all_time * 60) % 60 > 15 ? 1 : 0) * 4) - fee_free_all_money;rn if (fee_f_money > 0)rn rn tb_fee_in_money.Text = fee_f_money.ToString();rn rn elsern rn tb_fee_in_money.Text = "免费";rn rn if (class_card_fee + sd_all_money > 0)rn rn tb_fee_free_money.Text = (class_card_fee + sd_all_money).ToString();rn rn elsern rn tb_fee_free_money.Text = "无减免费用";rn rn fee_must_money = (fee_all_time) * 4;rn fee_nofree_money.Text = fee_must_money.ToString();rn fee_real_money = tb_s_money.Text;rn fee_change_money = Convert.ToInt32(fee_real_money)-fee_f_money;rn tb_b_money.Text = fee_change_money.ToString();rnrnrn rn[/code]rnrn
未处理 System.Data.SqlClient.SqlException
小弟调试网上下载的程序出了问题了 但是除了这个问题rn未处理 System.Data.SqlClient.SqlExceptionrn部分代码:rnusing System;rnusing System.Collections.Generic;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Text;rnusing System.Windows.Forms;rnusing System.Data.SqlClient;rnrnrnnamespace 实验室设备管理系统rnrn public partial class 登录 : Formrn rn public static string name;rn public static string password;rn public static string entry;rn public 登录()rn rn InitializeComponent();rn rnrn private void label2_Click(object sender, EventArgs e)rn rnrn rnrn private void 登录_Load(object sender, EventArgs e)rn rn rn rnrn private void button1_Click(object sender, EventArgs e)rn rn rn if (this.textBox1.Text == "" || this.textBox2.Text == "")rn MessageBox.Show("请输入用户名和密码");rn elsern rnrn SqlConnection con = new SqlConnection(); //创建连接rn con.ConnectionString = "server=(local);database=实验室设备;uid=sa;pwd=";rn con.Open();rn SqlCommand cmd = con.CreateCommand();rn cmd.CommandText ="select *from 登录";rn SqlDataReader dr = cmd.ExecuteReader();rn if (dr.Read())rn rn string power = dr[0].ToString();rn 主界面 main = new 主界面();rn main.Tag = this.FindForm();rn this.Visible = false;rn main.ShowDialog();rn this.Close();rnrn rnrn elsern rn MessageBox.Show("用户名或密码错误");rn rn con.Close();rnrn rn rnrn private void button2_Click(object sender, EventArgs e)rn rn this.Close();rn rnrn public void textBox1_TextChanged(object sender, EventArgs e)rn rn name = this.textBox1.Text;rn SqlConnection con = new SqlConnection(); //创建连接rn con.ConnectionString = "server=(local);database=实验室设备;uid=sa;pwd=";rn con.Open();rn SqlCommand cmd = con.CreateCommand();rn cmd.CommandText = "select 权限 from 登录 where 姓名='" + this.textBox1.Text + "'";rn SqlDataReader sqlread = cmd.ExecuteReader(CommandBehavior.CloseConnection);rn if (sqlread.Read())rn rn label4.Text = sqlread["权限"].ToString();rn entry =this.label4.Text.Trim();rn con.Close();rn rn rnrn public void textBox2_TextChanged(object sender, EventArgs e)rn rn password = this.textBox2.Text;rn rnrn private void label4_Click(object sender, EventArgs e)rn rnrn rnrn rnrn rn rnrn谁能帮我看看啊?
未处理 CrossThreadMessagingException
C# 回调函数时出错rnrnfrmMain.AlarmFunc = new IMOSSDK.SDKCallBackFunc(frmMain.AlarmCallBackFunc);rn ulRet = IMOSSDK.IMOS_RegCallBackPrcFunc(ref IMOSSDK.stLoginInfo.stUserLoginIDInfo, frmMain.AlarmFunc);rnrnrn public void AlarmCallBackFunc(ulong ulProcType, IntPtr pParam)rn rn //Update();rn tryrn rn if (this.InvokeRequired)rn rn IMOSSDK.SDKCallBackFunc me = new IMOSSDK.SDKCallBackFunc(AlarmCallBackFunc);rn this.BeginInvoke(me, ulProcType, pParam);rn return;rn rn elsern //showlog("告警");rn IMOS_SDK.SDK.AS_ALARMPUSH_UI_S pstAlarmPush;rnrn if (null == pParam)rn rn //logrn return;rn rnrn tryrn rn switch ((IMOS_SDK.SDK.tagCallBackProcType)ulProcType)rn rn case IMOS_SDK.SDK.tagCallBackProcType.PROC_TYPE_DEV_STATUS: //设备状态,对应结构 : AS_STAPUSH_UI_Srn break;rn case IMOS_SDK.SDK.tagCallBackProcType.PROC_TYPE_ALARM: //告警,对应结构 : AS_ALARMPUSH_UI_S rn //pstAlarmPush = (IMOS_SDK.SDK.AS_ALARMPUSH_UI_S)Marshal.PtrToStructure(pParam, typeof(IMOS_SDK.SDK.AS_ALARMPUSH_UI_S));rn //pstAlarmPush = (IMOS_SDK.SDK.AS_ALARMPUSH_UI_S)pParam;rn //AlarmDAL.AddAlarmLog(ref pstAlarmPush, this);rn break;rn default:rn break;rn rn rn catch (Exception ex)rn rn showlog(ex.Message);rn rn rn rn catch (Exception ex)rn rn MessageBox.Show(ex.Message);rn rnrn
未处理DBConcurrencyException
vs2005提示我:rn未处理DBConcurrencyExceptionrn违反并发性: UpdateCommand 影响了预期 1 条记录中的 0 条。rnrn问题代码(c#):da.Update(ds, "xuanke");rn我在dataGridView中修改数据源为主键的数据时出现这种错误的,但修改其他非主键值时没问题,请问诸位是哪儿的问题?
未处理IOException
我想打开form窗体时,显示上一次textbox里面的值!!简单的测试下,还是有错误.大家帮我看下rn未处理Ioexception ;rn文件“D:\My Documents\Visual Studio 2005\Projects\WindowsApplication85\WindowsApplication85\bin\Debug\fs.txt”正由另一进程使用,因此该进程无法访问该文件。rnrnrnform窗体上就就一个textbox.别的控件都没有!!代码如下rn[code=C#]using System;rnusing System.Collections.Generic;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Text;rnusing System.Windows.Forms;rnusing System.IO;rnusing System.Threading;rnnamespace WindowsApplication85rnrn public partial class Form1 : Formrn rn public Form1()rn rn InitializeComponent();rn rnrn private void Form1_Load(object sender, EventArgs e)rn rn FileStream fs = new FileStream("fs.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);rn StreamReader sr = new StreamReader(fs);rn this.textBox1.Text = sr.ReadToEnd();rn fs.Close();rn sr.Close();rn rnrn private void textBox1_TextChanged(object sender, EventArgs e)rn rn rn FileStream fs = new FileStream("fs.txt", FileMode.Truncate, FileAccess.ReadWrite);rn StreamWriter sw = new StreamWriter(fs);rn sw.Write(this.textBox1.Text, Encoding.Default);rn sw.Close();rn fs.Close();rn rn rn rn[/code]
未处理DIRECTORYNOTFOUNDEXCEPTION
如图:rn[img=https://img-bbs.csdn.net/upload/201311/17/1384671984_274681.png][/img]rnrn有关代码如下:rn[code=csharp]using System;rnusing System.Collections.Generic;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Text;rnusing System.Windows.Forms;rnusing System.IO;rnusing System.Collections;rnusing SHF_BT;rnusing SHF_DA;rnusing SHF_UI;rnrnrnnamespace MES64G08_111_UIrnrn public partial class uiMES64G08_111_CourseShow : SHF_UI.uiSHF_CourseBasern rn #region 局部变量rn private btSHFPage page;rn private btSHFPages pages;rn private btSHFUserLogin userLogin;rn private string path = Directory.GetCurrentDirectory() + "..\\..\\..\\..\\SHFDB\\Text\\";rnrn #endregionrnrn #region 构造函数rn public uiMES64G08_111_CourseShow()rn rn InitializeComponent();rn rn //从test调入时的构造函数rn public uiMES64G08_111_CourseShow(Form callForm, btSHFUserLogin callLog, btSHFPage callPage)rn : base(callForm, callLog)rn rn InitializeComponent();rn this.page = callPage;rn this.userLogin = callLog;rn pages = new btSHFPages();rn rn #endregionrnrn #region 窗口载入rn private void uiMES64G08_111_CourseShow_Load(object sender, EventArgs e)rn rnrn rn #endregionrnrn #region 在窗口中显示信息rn private void showInfo()//在窗口中显示教学信息rn rnrn string path1 = path + page.TextInfo;rn this.readFile(path1, this.richTextBox1);rn rn #endregionrnrn #region 读取文本文件的内容(文本文件编码方式:UTF-8)rn public void readFile(string path, RichTextBox richTextBox)rn rn richTextBox1.Clear();rn richTextBox1.SelectionAlignment = HorizontalAlignment.Left;rn richTextBox1.SelectionIndent = 20;rn richTextBox1.SelectionHangingIndent = -20;rn richTextBox1.Multiline = true;rn StreamReader din = File.OpenText(path);rn String str;rn ArrayList al = new ArrayList();rnrn while ((str = din.ReadLine()) != null)rn rn al.Add(str);rn rnrn foreach (string s in al)rn rn richTextBox1.SelectedText += s;rn richTextBox1.SelectedText += "\r\n";rn rn din.Close();rn rn #endregionrnrn #region 选择学习项目rnrn private void 卦型_Click(object sender, EventArgs e)rn rn page = pages.GetOne(2);rn showInfo();rn rnrn private void 来源_Click(object sender, EventArgs e)rn rn page = pages.GetOne(3);rn showInfo();rn rnrn private void 预示_Click(object sender, EventArgs e)rn rnrn rnrn private void 象彖_Click(object sender, EventArgs e)rn rn page = pages.GetOne(4);rn showInfo();rn rnrn private void 全卦内容_Click(object sender, EventArgs e)rn rnrn rnrn private void 含义_Click(object sender, EventArgs e)rn rn page = pages.GetOne(7);rn showInfo();rn rnrn private void 白话解释_Click(object sender, EventArgs e)rn rn page = pages.GetOne(6);rn showInfo();rn rnrn #endregionrn rnrn[/code]rn我把要读取的TXT文件也确实在路径下:rn[img=https://img-bbs.csdn.net/upload/201311/17/1384672139_77867.png][/img]rnrn所以这个报错是怎么回事..求大家帮助
未处理 Win32Exception
做的自动更新执行到rntryrn rn MessageBox.Show("检测到有新版本发布了,是否需要更新!", "信息提示", rnrnMessageBoxButtons.YesNo, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button3);rn System.Diagnostics.Process.Start("update.exe", GlobParams.baseURL); rn this.Dispose();rn this.Close();rn rn catch(Exception ex)rn rn Debug.Writeline("升级失败了,原因是:" + ex.Message);rn rn这句执行不下去出现异常 System.Diagnostics.Process.Start("update.exe", GlobParams.baseURL); rn
未处理的 "System.IndexOutOfRangeException"
未处理的 "System.IndexOutOfRangeException" rnrn这句:int fee_card_flag =(Int32)( rs_check["car_park_fee.car_flag"]); rncar_park_fee.car_flag是int型默认值是0不允许为空rnrnrn[code=C#]rn private void fee_in_card_id_TextChanged(object sender, EventArgs e)rn rn string fee_check_card;rn if (fee_in_card_id.Text.Length == 10)rn rn card_id = fee_in_card_id.Text;rn fee_check_card = "select * from car_park_fee left join car_park_templist on car_park_fee.car_fee_nums = car_park_templist.temp_card_num where rndatediff(d,car_park_fee.car_fee_start,getdate())= 0 and car_park_fee.car_fee_nums rn= '" + card_id + "'and rncar_park_templist.temp_card_num is null ";rn SqlConnection conn_check = new SqlConnection(fee_conn.sql_conn());rn SqlCommand command_check = new SqlCommand(fee_check_card, conn_check);rn tryrn rn conn_check.Open();rn rn catch(System.Exception sqler)rn rn MessageBox.Show("数据库连接错误!", sqler.Message, MessageBoxButtons.OK, rnMessageBoxIcon.Error);rn return;rn rn SqlDataReader rs_check = command_check.ExecuteReader();rn while (rs_check.Read())rn rn rn int fee_card_flag =(Int32)( rs_check["car_park_fee.car_flag"]);rnMessageBox.Show("此会员卡今天已经停过车了", fee_card_flag.ToString(), rnMessageBoxButtons.OK, MessageBoxIcon.Error);rn return;rn rn rs_check.Close();rn conn_check.Close();rn rn [/code]
未处理的异常???
在d3d编程的时候 最经常出现 未处理的异常 读取位置冲突 还是运行时候的错误 我调试起来很费劲rn麻烦问一下 这个错误一般的都怎么引起的??
未处理argumentoutofrangeexception
[img=https://img-bbs.csdn.net/upload/201706/02/1496382103_242838.jpg][/img]
未处理 System.IndexOutOfRangeException
[code=C#]rnusing System;rnusing System.Collections.Generic;rnusing System.Linq;rnusing System.Text;rnrnnamespace gaibianrnrn class Programrn rn public static void Main()rn rn //创建二维string类型数组rn int[] mm = new int[2] 3, 5 ;rn int[] nn = new int[2] 2, 3 ;rn string[,] zz = (string[,]) Array.CreateInstance(typeof (string ),mm,nn );rn for (int i=zz.GetLowerBound (0);i<=zz.GetUpperBound(0);i++)rn rn for (int j=zz.GetLowerBound (0);j <=zz.GetUpperBound (1);j++)rn rn int[] myIndicesArray = new int[2] i,j;rn [color=#FF0000] zz.SetValue(Convert .ToString (i)+j,myIndicesArray );[/color]rn rn rn //显示每一维的下限和上限rn Console.WriteLine("维数是\t 下限是\t 上限是\t");rn for (int i = 0; i < zz.Rank; i++)rn rn Console.WriteLine("0\t1\t2",i,zz .GetLowerBound (i ),zz .GetUpperBound (i));rn Console.WriteLine("\n 数组是:");rn for (int i = zz.GetLowerBound(0); i <= zz.GetUpperBound(0); i++)rn rn for (int j = zz.GetLowerBound(0); j <= zz.GetUpperBound(1); j++)rn rn Console.Write("0", zz[i, j]);rn rn Console.WriteLine();rn rn Console.ReadKey();rn rn rn rnrnrn[/code]
未处理的“System.StackOverflowException”
未处理的“System.StackOverflowException”类型的异常出现在 mscorlib.dll 中。rn1.rnerror code:rnrn HttpCookie cookies = Request.Cookies["QueryValue"];//未处理的“System.StackOverflowException”类型的异常出现在 mscorlib.dll 中。rnrnrn2.rn public string[] selfCookieValuern rn get rn rn HttpCookie cookies = Request.Cookies["QueryValue"];//未处理的“System.StackOverflowException”类型的异常出现在 mscorlib.dll 中。rn if (cookies.Values == null)rn rn int cookCount = 0;rn cookCount = cookies.Values.Count;rn string[] cookValues = new string[cookCount];rn for (int i = 0; i < cookCount; i++)rn rn cookValues[i] = HttpUtility.UrlDecode(cookies.Value[i].ToString().Trim());rn rn rnrn rn return selfCookieValue;rn rn rnrnrnthank you rnrnyarn
未处理nullReferenceException.
Partial Class _Defaultrn Inherits System.Web.UI.MobileControls.MobilePagern Dim fetion As New NullStudio.Fetion_SDK.FetionSDKrn Private Sub Command1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Command1.Clickrn fetion.AccountManager.FillUserIdAndPassword(Me.Txt_User.Text.ToString, Me.Txt_Password.Text.ToString, False)rn Me.Label3.Text = "正在登陆……"rn System.Threading.Thread.Sleep(500)rn Dim i As Shortrn i = fetion.AccountManager.Login()rn System.Threading.Thread.Sleep(500)rn If i = -1 Thenrn Me.Label3.Text = "已经登陆成功"rn End Ifrn ActiveForm = Form2rn End SubrnEnd Classrnrn错误:fetion.AccountManager.FillUserIdAndPassword(Me.Txt_User.Text.ToString, Me.Txt_Password.Text.ToString, False)提示用户代码未处理nullReferenceException.rn大虾们应该如何解决呢?rn
StackOverflowException未处理
[code=C#]namespace MySpacernrn public class Class_Tworn rn Class_One one = new Class_One();rn rnrnrnrnrnnamespace MySpacernrn public class Class_Onern rn Class_Two two = new Class_Two();rn rn[/code]rnrn我是一个项目不同的.cs文件里面,这样用的rn结果报错rnrn[color=#FF0000]StackOverflowException未处理[/color]rn请问怎么解决?
未处理OleDbException
[img=https://img-bbs.csdn.net/upload/201709/25/1506344528_609225.jpg][/img]rnc#往access中写入数据时,出现的问题,未处理OleDbException,“System.Data.OleDb.OleDbException”类型的未经处理的异常在 System.Data.dll 中发生 ,求大神解答
未处理 System.NullReferenceException
[code=VB.NET]rn '---save the video data into the Image global variable---rn Public Sub CaptureImage()rn Dim data As IDataObjectrn Dim bmap As Imagern Dim ms As New IO.MemoryStream()rnrn 'bmap = Nothingrnrnrn '---copy the image to the clipboard---rn SendMessage(hWnd, WM_CAP_EDIT_COPY, 0, 0)rnrn '---retrieve the image from clipboard and convert it rn ' to the bitmap formatrn data = Clipboard.GetDataObject()rn If data Is Nothing Then Exit Subrn If data.GetDataPresent(GetType(System.Drawing.Bitmap)) Thenrnrn '---convert the data into a Bitmap---rn bmap = CType(data.GetData(GetType(System.Drawing.Bitmap)), Image)rn '---save the Bitmap into a memory stream---rn [color=#FF0000]bmap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp)[/color] '---write the Bitmap from stream into a byte array---rn Image = ms.GetBufferrnrn End Ifrn End Subrn[/code]rn程序执行到bmap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp)这句,提示未处理 System.NullReferenceException,未将对象引用设置到对象的实例。请问这是什么错误呢,该如何修改呢, 谢谢了
未处理 FileNotFoundException
rn public void GetConfigMessage()rn rn rnrn StreamReader sr = new StreamReader("config.dll");rn strIP = sr.ReadLine();rnrnrn未处理 FileNotFoundExceptionrnrnCould not find file 'E:\Fax\NetFax\NetFax\bin\Debug\config.dll'.rnrn解,谢谢
未处理 System.Resources.MissingManifestResourceException
未处理 System.Resources.MissingManifestResourceException Message="未能找到任何适合于指定的区域性或非特定区域性的资源。请确保在编译时已将“test1.LeftIcons.resources”正确嵌入或链接到程序集“test1”,或者确保所有需要的附属程序集都可加载并已进行了完全签名。"rn Source="mscorlib"rn StackTrace:rn 在 System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)rn 在 System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)rn 在 System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)rn 在 System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)rn 在 System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)rn 在 System.Resources.ResourceManager.GetObject(String name)rn 在 test1.Form1.InitializeLeftImages() 位置 E:\教程\C#\实例\test1\test1\Form1.cs:行号 34rn 在 test1.Form1..ctor() 位置 E:\教程\C#\实例\test1\test1\Form1.cs:行号 26rn 在 test1.Program.Main() 位置 E:\教程\C#\实例\test1\test1\Program.cs:行号 17rn 在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)rn 在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)rn 在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()rn 在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)rn 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)rn 在 System.Threading.ThreadHelper.ThreadStart()rn InnerException: rnrn已经两天还没解决呀,网上的资料都试了,没用rn我的分比较少^_^rn
未处理杂记
用的beetl 在这里有配置 Controller: 放入缓存然后 Jsp页面获取数值:
未处理 System.Exception
麻烦帮忙看看有什么问题rnpublic static bool LoadBySql(string _mCurConnectionStr,string rpName, GridppReport rP)rn rn tryrn rn SQLDataBase db = new SQLDataBase(_mCurConnectionStr);rn string sqlStr = "Select * from Sys_ReportSet where ReportName='" + rpName + "'";rn DataRow dr = db.GetDataRow(sqlStr);rn if (dr != null)rn rn rP.LoadFromVariant(DataOperate.EChStr(DataOperate.ValidateDataRow_S(dr, "ReportData")));rn rP.DetailGrid.Recordset.ConnectionString = _mCurConnectionStr;rn return true;rn rn elsern return false;rn rn catch (Exception ex)rn rn throw new Exception("\r\n" + tmpClassName + "->LoadBySql失败,ReportName[" + rpName + "]:" + ex.Message); //执行到这里出错了rn rn
未处理异常捕获
自定义类实现UncaughtExceptionHandler接口public class CrashHandler implements UncaughtExceptionHandler然后在初始化方法中调用Thread.setDefaultUncaughtExceptionHandler(this);设置该异常类为程序默认的处理器,在调用这个方法前可以保存系统默认的处理器,在我们的自定义处理完成...
未处理 System.Net.Sockets.SocketException
本人在编写的程序中,在程序刚开始执行,便出现以下错误提示,可是在程序中没有调用网络功能,并且vs也指不出出错的地方,请各位高手给予解决。rn未处理 System.Net.Sockets.SocketExceptionrn Message="提供了一个无效的参数。"rn Source="System"rn ErrorCode=10022rn NativeErrorCode=10022rn StackTrace:rn 在 System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)rn 在 System.Net.Sockets.Socket.Bind(EndPoint localEP)rn 在 System.Net.Sockets.TcpListener.Start(Int32 backlog)rn 在 System.Net.Sockets.TcpListener.Start()rn 在 System.Runtime.Remoting.Channels.ExclusiveTcpListener.Start(Boolean exclusiveAddressUse)rn 在 System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.StartListening(Object data)rn 在 System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupChannel()rn 在 System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider, IAuthorizeRemotingConnection authorizeCallback)rn 在 System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider)rn 在 System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider)rn 在 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.RegisterChannel(Boolean SecureChannel)rn 在 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)rn 在 加密.My.MyApplication.Main(String[] Args) 位置 17d14f5c-a337-4978-8281-53493378c1071.vb:行号 81rn 在 System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)rn 在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)rn 在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()rn 在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)rn 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)rn 在 System.Threading.ThreadHelper.ThreadStart()
未处理 System.Runtime.InteropServices.COMException
进行TTS开发,运行到"cmbVoices.Items.Add(Token.GetAttribute("Name"))"时报错:rn"system.Runtime.InteropServices.COMException","异常来自 HRESULT:0x8004503A"
外部组件发生异常,如何解决? System.Runtime.InteropServices.SEHException
rn外部组件发生异常。rnrnwin2K上正常,在XP上运行,报这个错。rnrn中间引用了 excel组件 和 自定义控件.rnrnXP有的可以,有的报错.rnrn????rnrnthanksrnrnrnrnrnrnrnrnrn
未处理的“System.BadImageFormatException”类型的异常
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦: Markdown和扩展Markdown简洁的语法 代码块高亮 图片链接和图片上传 LaTex数学公式 UML序列图和流程图 离线写博客 导入导出Markdown文件 丰富的快捷键 快捷键 加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
未处理的异常,要命啊!
private void Page_Load(object sender, System.EventArgs e)rn rn if(!IsPostBack)rn rn if(Session["strSql"]==null)rn rn FResult.Text="对不起,没有你所要查询的数据!";rn rn elsern rn string sql=Session["strSql"].ToString();rn SqlDataReader objDr=objXSqlClient.CreateDataReader(sql);rn bool D=objDr.Read();rn if(D)rn rn FResult.Text=Convert.ToString(objDr["Y1"]); rn objDr.Close();rn rn elseFResult.Text="对不起,没有你所要查询的数据!";rn rn rn rn rn-------------------------------------------------rnY1出现异常,在数据库中,Y1值为20451185.387825810806461765438
7.未处理异常
当异常发生的处理流程: CPU检测到异常查IDT表执行中断处理程序CommonDispatchExceptior(CxxThrowException RaiseException RtIRaiseException() NtRaiseException KiRaiseException) KiDispatchException KiUserExceptionDispatcher RtIDispa...
用户代码未处理NullReferenceException
sqlString.AppendFormat("SELECT COUNT(*) FROM CRM_TODOLIST_VIEW WHERE (EXPIRATIONDATE>='0' OR (EXPIRATIONDATE<'0' AND FLAGEXECUTED=0)) AND OWNERID=1;", UC.LTZ.ToUniversalTime(DateTime.Now).ToString(@"yyyyMMdd"), UC.UserId.ToString());rnhere is the errorrnplease tell me what is wrong here rnthank you
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数