在另一台计算机上运行EXE时出错 [英] Error on running EXE on another computer

查看:120
本文介绍了在另一台计算机上运行EXE时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

*************** ************************************

我创建了一个窗口应用程序,完成调试,它在我的电脑中完美运行。我然后复制整个文件夹包括.Exe文件到另一台未安装C#的计算机。当我运行...

有关调用

实时(JIT)调试而非此对话框的详细信息,请参阅此消息的结尾。

**************异常文本**************

System.Exception:输入字符串是不正确的格式。

at Microsoft.VisualC#.Interaction.Conver.ToInt32

at Registration.Form1.Button1_Click(Object sender,EventArgs e)
$在System.Windows.Forms.Control.OnClick(EventArgs e)的b $ b

在System.Windows.Forms.Button.OnClick(EventArgs e)

在System。 Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

在System.Windows.Forms.Control.WmMouseUp(消息& m,MouseButtons按钮,Int32点击)

在系统.Windows.Forms.Control.WndProc(Message& m)

在System.Windows.Forms.ButtonBase.WndProc(Message& m)

在System.Windows.Forms .Button.WndProc(Message& m)

在System.Windows.Forms.Control.ControlNativ eWindow.OnMessage(消息&安培; m)

在System.Windows.Forms.Control.ControlNativeWindow.WndProc(消息& m)

在System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32) msg,IntPtr wparam,IntPtr lparam)

**************已加载的装配**************

mscorlib

Win32版本:4.0.30319.1022(RTMGDR.030319-1000)

CodeBase:file:/// C:/Windows/Microsoft.NET/ Framework / v4.0.30319 / mscorlib.dll

--------------------------------- -------

注册1

Win32版本:1.0.0.0

CodeBase:file:/// J:/ Registration1。 exe

----------------------------------------

Microsoft.VisualBasic

汇编版本:10.0.0.0

Win32版本:10.0.30319.1内容:RTMRel

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll

----- ---------------------------- -------

系统

汇编版本:4.0.0.0

Win32版本:4.0.30319.1001建立者:RTMGDR

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

--- -------------------------------------

System.Core

汇编版本:4.0.0.0

Win32版本:4.0.30319.1内置:RTMRel

CodeBase:file:/// C:/ Windows / Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

----------------- -----------------------

System.Windows.Forms

汇编版本:4.0.0.0

Win32版本:4.0.30319.1002内容:RTMGDR

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows。 Forms / v4.0_4.0.0.0__b77a5c561934e089 / System.Windows.Forms.dll

------------------------- ---------------

System.Drawing

Ass embly版本:4.0.0.0

Win32版本:4.0.30319.1001内容:RTMGDR

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/ GAC_MSIL / System.Drawing / v4.0_4.0.0.0__b03f5f7f11d50a3a / System.Drawing.dll

----------------------- -----------------

System.Runtime.Remoting

汇编版本:4.0.0.0

Win32版本:4.0.30319.1(RTMRel.030319-0100)

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4 .0_4.0.0.0__b77a5c561934e089 / System.Runtime.Remoting.dll

---------------------------- ------------

辅助功能

汇编版本:4.0.0.0

Win32版本:4.0.30319.1已构建作者:RTMRel

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

----------------------------------------

************** JIT调试**************
要启用实时(JIT)调试,此

应用程序或计算机(machine.config)的.config文件必须具有

jitDebugging值在system.windows.forms部分设置。

应用程序也必须使用调试编译

启用。

例如:

< configuration>

< system.windows.forms jitdebugging =true>



启用JIT调试后,任何未处理的异常

将被发送到计算机上注册的JIT调试器

,而不是由此对话框处理。

********

***********************************************************************************
I Had Created A Window Application, Finish Debug And It Work Perfectly In My Computer. I Then Copy A Whole Folder Includes The .Exe File To Another Computer Which Doesn't Installed C#. When I Run...
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Exception: input string was not in correct format.
at Microsoft.VisualC#.Interaction.Conver.ToInt32
at Registration.Form1.Button1_Click(Object sender, EventArgs e)
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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Win32 Version: 4.0.30319.1022 (RTMGDR.030319-1000)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Registration1
Win32 Version: 1.0.0.0
CodeBase: file:///J:/Registration1.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 10.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1001 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1002 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1001 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
********

推荐答案

Quote:

System.Exception:输入字符串格式不正确。

at Microsoft.VisualC#.Interaction.Conver.ToInt32

at Registration.Form1.Button1_Click(Object sender, EventArgs e)

System.Exception: input string was not in correct format.
at Microsoft.VisualC#.Interaction.Conver.ToInt32
at Registration.Form1.Button1_Click(Object sender, EventArgs e)

你为什么不读这条消息?

索姆在Button1_Click的方法体中,您尝试从其他类型的数据中获取数值,可能是字符串。那次转换失败了。

为什么会失败?因为字符串中某处有非数字字符。

如果它在具有相同值的另一台计算机上工作,则因为逗号(,)或点(。)位于它们不应该的位置根据所选的语言环境。

Why don't you read that message?
Somewhere in the method body of Button1_Click, you try to get a numeric value from some other type of data, likely a string. And that conversion fails.
Why can it fail? Because of non-numeric characters somewhere in the string.
If it works on a different computer with the same value, then because of commas (,) or dots (.) at positions where they should not be according to the selected locale.


at Microsoft.VisualC#.Interaction.Conver.ToInt32



您的程序可能在您的计算机上正常工作,但它无法处理输入数据中的错误。您假设输入值是有效数字,而不是首先使用 ParseInt 进行检查以确定。我建议你仔细阅读所有代码并添加一些正确的错误检查。


Your program may be "working perfectly" on your computer, but it is not able to handle an error in the input data. You are making the assumption that the input value is a valid number, rather than checking it first with ParseInt to be sure. I would suggest you go through all your code and add some proper error checks.


你可以使用第三方软件为其他系统制作.exe(如Innosetup编译器)
u can use the third party software to make .exe for other system like(Innosetup compiler)


这篇关于在另一台计算机上运行EXE时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆