关于vb.net编码错误 [英] regarding to vb.net coding error

查看:72
本文介绍了关于vb.net编码错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用Visual Studio 2005将我的vb6.0项目之一转换为VB.NET.
执行时显示以下错误:

1)表达式不产生值
2)如何声明名称
3)未使用的局部变量
4)检测到null/isnull()
5)Newindex不是system.windows.forms的成员
6)在变量被赋值之前使用变量,在运行时可能会导致空引用异常

对于解决上述错误的帮助,我将不胜感激.

I have converted one of my vb6.0 projects into VB.NET using Visual Studio 2005.
While executing it displays the following errors:

1)Expression does not produce a value
2)How to declare a name
3)Unused local variable
4)null/isnull() is detected
5)Newindex is not a member of system.windows.forms
6)Variable is used before it has been assigned a value a null reference exception could result at run time

I would be most grateful with help resolving the above errors.

推荐答案

好,没有看到出错的代码,除了

3)基本上,您不会使用该变量.因此,这是多余的,您可以删除此变量,然后该错误就会消失.

6)您需要在使用前检查它是否为非NULL,或者使用一些内容对其进行初始化.例如Dim i as Integer = 0而不是Dim i as Integer我相信,如果单击错误,它将带您到问题所在的代码行.

另外,请自己购买 Resharper [ ^ ].这可以为您提供帮助.
Ok without seeing the code that is erroring, thats going to be very hard, apart from

3) Basically you arent using the variable. So it is redundant, you can remove this variable and then this error will go.

6) You need to either check it is NOT NULL before you use it, OR, initialize it with some content. for example Dim i as Integer = 0 rather than Dim i as Integer I believe if you click on the error it will take you to the line of code where the issue lies.

Also, buy yourself a version of Resharper [^] with VB Support. That could help you.


这篇关于关于vb.net编码错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆