1

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)..........................................................
4

2 に答える 2

1

指しているファイルが見つからない可能性があります。そうでない場合は、ファイルのエントリが欠落している可能性があります。

少しでもお役に立てれば幸いです

于 2013-05-22T14:27:00.723 に答える
1

C:\ または C:\Users への書き込みが許可されていない可能性があります。

于 2013-05-22T14:34:10.020 に答える