空引用异常未处理 C#
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;
}
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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于初学者来说,您的整个代码示例都是用 C# 编写的,如果您尝试编写 VB.NET 应用程序,肯定会崩溃。
well for starters your entire code example is in C# and will definitely blow up if you're trying to write a VB.NET application.