在使用了下面的代码之后,我一直在我的视图中得到这个错误The following _CastError was thrown building Builder: Null check operatorused on a null value,我不知道如何绕过它。当我为空的电子邮件签入if语句时,很明显这个值不会是null,所以我添加了一个!,为什么它总是抛出这个错误?有人能给我建议吗?
我的问题是在第127行- int sent = winPcapDevice.SendQueue(squeue, SharpPcap.WinPcap.SendQueueTransmitModes.Synchronized);中,当尝试执行这个命令时,我得到异常,对象引用没有设置为对象的实例。我已经逐行检查了调试器,并且似乎一切正常,直到这个命令,我的Pcap文件OK,所有的数据包都放在Queue中。
我尝试使用这个语句来检查SSN是否为空,返回SSNstr中的值,否则返回null。但这是在SSN为空时返回错误Object reference not set to an instance of an object.。Model.DocumentData dt = new Model.DocumentData(); public string SSNstr = string.