或vs || 条件

pha*_*unk 1 c# vb.net conditional-statements

我刚开始使用Vb.Net.我习惯了C#语法.我知道我可以在C#中做到这一点:

if (x | y)
//Test both 

if (x || y)
//Test both unless x is true
Run Code Online (Sandbox Code Playgroud)

在Vb.Net中,我怎样才能完成相同的事情,考虑到:

If x or y Then
//Test both no matter what
Run Code Online (Sandbox Code Playgroud)

Eri*_*ert 8

在Vb.Net中,我怎样才能完成同样的事情?

OrElse

文档在这里:

http://msdn.microsoft.com/en-us/library/ea1sssb2.aspx

VB的当量&&AndAlso的方式.

  • 不知道VB的这个方面.这听起来很不祥:`如果YouDoThis()OrElse ThePuppyGetsIt()` (5认同)