2010-07-28 93 views
2
private void StartReadInlay2() 
    { 
     byte[] cSN = new byte[8];   
     byte[] sw12 = new byte[2]; 
     string strsw12 = "", errdes = "", result = ""; 

     test1_2 = new Initialisation(); 

     test1_2.logmode = Convert.ToInt32(ConfigurationSettings.AppSettings["LogMode"]); 
     test1_2.iChipType = GetChipType(lblChipType.Text.Trim()); 

     //--initialise test 
     result = test1_2.Initialise(1, **configXML.fnSamSlot**, configXML, ref cSN, ref sProgress1_2, ref lProcess1_2, ref sw12, ref errdes); 
     scSN1_2 = Hex.ToHexString(test1_2.chipID); 
     strsw12 = Hex.ToHexString(sw12); 

     if (strsw12.Equals("0000")) 
      errInlay1_2 = result.ToString(); 
     else 
      errInlay1_2 = result.ToString() + strsw12; 

     lProcess1_2 = 2; 

     if(!errInlay1_2.Equals("")) 
      StatusInlay1_2 = false; 
     else 
      StatusInlay1_2 = true; 
    } 
+0

请说明问题。哪一行抛出异常?你是否放置了一个断点并通过调试器运行? – 2010-07-28 03:29:20

+0

是的..我确实放置了断点,然后运行调试器,发现这条线上有错误。 “result = test1_2.Initialise(1,configXML.fnSamSlot,configXML,ref cSN,ref sProgress1_2,ref lProcess1_2,ref sw12,ref errdes);” – nashprem 2010-07-28 03:32:12

+0

它显示: NullReferenceException未处理 对象引用未设置为对象的实例 – nashprem 2010-07-28 03:34:13

回答

0

对于初学者来说,您的整个代码示例都在C#中,如果您尝试编写VB.NET应用程序,它肯定会炸毁。

+0

对不起,错误的信息..它的C#脚本。不是vb.net .. – nashprem 2010-07-28 03:27:37