mscorlib.dll中发生了未处理的“System.FormatException”类型异常 [英] An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
本文介绍了mscorlib.dll中发生了未处理的“System.FormatException”类型异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
System.FormatException was unhandled
HResult=-2146233033
Message=A cadeia de caracteres de entrada não estava em um formato incorreto.
Source=mscorlib
StackTrace:
em System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
em System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
em MediaControl.AudioPlayer.get_Position()
em MediaControl.AudioPlayer.timer1_Tick(Object sender, EventArgs e)
em System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
em System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
em System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
em System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
em System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
em System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
em MyPlayer.frmAudio.Main() na C:\Users\Bruno Soares\Desktop\MyPlayer\frmAudio.vb:linha 0
em System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
em Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Threading.ThreadHelper.ThreadStart()
InnerException:
FULL代码: PASTEBIN - LINK [ ^ ]
我不知道发生了什么
我已经尝试将try语句放在每个代码上的子代码:(
请大家帮帮忙。
FULL CODE: PASTEBIN - LINK[^]
I don't know what is happening
I already try to put try statement on every sub on the code :(
Please help guys.
推荐答案
我对VB.Net并不是很熟悉 - 但是查看代码,你有3个interops声明 - 我会在调用/使用这些interop之前立即对你的程序进行一些跟踪,这样你就可以检查传递的值
显然你可以使用断点,跟踪,将其缩小到特定的代码行,你的生活会更容易
Im not really familiar with VB.Net - but looking at the code, you have 3 interops declared - I would put some tracing into your program immediately before these interops are called/used so you can check the values being passed
Obviously if you could use breakpoints, tracing, to narrow it down to a specific line of code a bit your life would be easier
来吧,问题究竟在哪里,你现在尝试了什么?当我在Google上搜索System.Number.StringToNumber和FormatException时,我得到了很多结果。例如。 http://support.microsoft.com/kb/942460 [ ^ ]描述了一个错误。但是:您确定用户以您所在地区可接受的格式输入数字(葡萄牙语或巴西语左右 - 在任何情况下:不是美国英语)设置?
Come on, where is the problem exactly, what did you try upto now? When I do a Google search for System.Number.StringToNumber and FormatException, I get many results. E.g. http://support.microsoft.com/kb/942460[^] describes a bug. But: are you sure that the user entered numbers in a format which is acceptable for your regional (Portugese or Brasilian or so - in any case: not US English) settings?
这篇关于mscorlib.dll中发生了未处理的“System.FormatException”类型异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文