我在 i7 intel、Windows 7 Ultimate、VS2010 Ultimate 中创建、构建和发布应用程序。在这台机器上运行的应用程序使用代码。在另一台机器上不工作,为什么。在此先感谢,ocaccy。
if(!Directory.Exists("C:\\users"))
{
DirectoryInfo di=Directory.CreateDirectory("C:\\users");
}
IniFile ini=new IniFile("C:\\users\\monitoring_config.ini");
Error Message on created machine:
************** Exception text **************
System.NullReferenceException: Object reference not set to an instance of an object.
Local MonitorX.CommPort.Open()
Local MonitorX.Monitor.checkConfigINI()
Local MonitorX.Monitor.btn_Preferences_Click(Object sender, EventArgs e)
Local System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
Local System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
Local System.Windows.Forms.Control.WndProc(Message& m)
Local System.Windows.Forms.ButtonBase.WndProc(Message& m)
Local System.Windows.Forms.Button.WndProc(Message& m)
Local System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)..........................................................