Vb net没什么不起作用 [英] Vb net isnothing does not work
本文介绍了Vb net没什么不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写一组非常基本的vb网络代码,基本上是:
Dim hsProd as Hashtable = Nothing
< span class =code-keyword> if IsNothing(hsProd)然后
' 做一些事情
end 如果
我碰巧总是输入做一些东西代码....为什么?
我尝试过:
如果没有(hsProd什么都没有)那么.....
如果isnothing(hsProd)= false那么.....
如果hsProd什么都不是.....
他们都没人工作
解决方案
尝试:
Dim hsProd as Hashtable = 没什么
如果 hsProd IsNot 没什么 然后
' 做事
否则
' 做其他事情
结束 如果
I am writing a very elementary bunch of vb net code, which is basically :
Dim hsProd as Hashtable = Nothing
if not IsNothing (hsProd) then
' do some stuff
end if
I happen to always enter the "do some stuff" code .... why ?
What I have tried:
if not (hsProd is nothing) then.....
if isnothing (hsProd) = false then .....
if hsProd isnot nothing then .....
none of them worked
解决方案
Try:
Dim hsProd as Hashtable = Nothing If hsProd IsNot Nothing then ' Do stuff Else ' Do other stuff End If
这篇关于Vb net没什么不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文