What is a NullReferenceException, and how do I fix it?
问题 This question's answers are a community effort . Edit existing answers to improve this post. It is not currently accepting new answers or interactions. I have some code and when it executes, it throws a NullReferenceException , saying: Object reference not set to an instance of an object. What does this mean, and what can I do to fix this error? 回答1: What is the cause? Bottom Line You are trying to use something that is null (or Nothing in VB.NET). This means you either set it to null , or