Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 为什么If-Else语句不跳转到Else中?_Vb.net_If Statement_Conditional Statements - Fatal编程技术网

Vb.net 为什么If-Else语句不跳转到Else中?

Vb.net 为什么If-Else语句不跳转到Else中?,vb.net,if-statement,conditional-statements,Vb.net,If Statement,Conditional Statements,我有个问题,我还不明白。我想这和andalso或IsNot运算符有关 因此,对于舒尔而言,我的Cells(o)值是“ImportName”,但它不会跳到其他值。 它尝试更改.cells(1)的值 单元格(0)的值为“ImportName”,但它不会跳转 进入Else 确定两个对象引用是否引用不同的对象。但是,它不执行值比较。如果要与非空值进行比较,只需使用=和: 单元格(0)的值为“ImportName”,但它不会跳转 进入Else 确定两个对象引用是否引用不同的对象。但是,它不执行值比较。如果

我有个问题,我还不明白。我想这和andalso或IsNot运算符有关

因此,对于舒尔而言,我的Cells(o)值是“ImportName”,但它不会跳到其他值。 它尝试更改.cells(1)的值

单元格(0)
的值为“ImportName”,但它不会跳转 进入
Else

确定两个对象引用是否引用不同的对象。但是,它不执行值比较。如果要与非空值进行比较,只需使用
=

单元格(0)
的值为“ImportName”,但它不会跳转 进入
Else

确定两个对象引用是否引用不同的对象。但是,它不执行值比较。如果要与非空值进行比较,只需使用
=

单元格(0)
的值为“ImportName”,但它不会跳转 进入
Else

确定两个对象引用是否引用不同的对象。但是,它不执行值比较。如果要与非空值进行比较,只需使用
=

单元格(0)
的值为“ImportName”,但它不会跳转 进入
Else

确定两个对象引用是否引用不同的对象。但是,它不执行值比较。如果要与非空值进行比较,只需使用
=

一个包含禁止字词的列表(字符串)和一个对Contains的调用将使此代码清晰数千倍,您将删除包含禁止字词的问题列表(字符串),一个对Contains的调用将使此代码清晰数千倍,您将删除问题列表(字符串)使用禁止的单词和对Contains的调用将使此代码更清晰数千倍,您将删除问题列表(字符串),使用禁止的单词和对Contains的调用将使此代码更清晰数千倍,您将删除问题
If row.Cells(0).Value IsNot "ImportName" AndAlso row.Cells(0).Value IsNot "ID" AndAlso row.Cells(0).Value IsNot "CSV_Datensatznummer" AndAlso row.Cells(0).Value IsNot "ist_headerzeile" AndAlso row.Cells(0).Value IsNot "Einlese_Datum" AndAlso row.Cells(0).Value IsNot "Dubletten_Vorschlaege" _
           AndAlso row.Cells(0).Value IsNot "forcerequestid" AndAlso row.Cells(0).Value IsNot "asp_Update_erfolgreich" AndAlso row.Cells(0).Value IsNot "adress_korrektur_noetig" AndAlso row.Cells(0).Value IsNot "adress_korrektur_abgeschlossen" AndAlso row.Cells(0).Value IsNot "in_Adrium_angelegt" AndAlso row.Cells(0).Value IsNot "fehler_bei_der_anlage" _
           AndAlso row.Cells(0).Value IsNot "import_abgeschlossen" AndAlso row.Cells(0).Value IsNot "asp_dubletten_vorschlaege" AndAlso row.Cells(0).Value IsNot "asp_forcerequerstid" AndAlso row.Cells(0).Value IsNot "asp_fehler_bei_der_anlage" AndAlso row.Cells(0).Value IsNot "asp_in_Adrium_angelegt" AndAlso row.Cells(0).Value IsNot "asp_import_abgeschlossen" AndAlso row.Cells(0).Value IsNot "Update_erfolgreich" _
           AndAlso row.Cells(0).Value IsNot "Fehler_Update" AndAlso row.Cells(0).Value IsNot "asp_Update_erfolgreich" AndAlso row.Cells(0).Value IsNot "asp_Fehler_Update" AndAlso row.Cells(0).Value IsNot "anreichern_fehler" AndAlso row.Cells(0).Value IsNot "asp_anreichern_fehler" AndAlso row.Cells(0).Value IsNot "Dateiname" AndAlso row.Cells(0).Value IsNot "addresssource_val" AndAlso row.Cells(0).Value IsNot "asp_addresssource_val" Then

                            row.Cells(1).Value = Startseite.Spaltennamen(i)
                        Else
                            MsgBox("Yolo why it doesnt work")

                        End If
Dim value As String = row.Cells(0).Value
If value <> "ImportName" AndAlso value <> "ID" AndAlso value <> "CSV_Datensatznummer" AndAlso value <> "ist_headerzeile" AndAlso value <> "Einlese_Datum" AndAlso value <> "Dubletten_Vorschlaege" _ 
'...'
Dim values = { "ImportName", "CSV_Datensatznummer", "ist_headerzeile", "Einlese_Datum", "Dubletten_Vorschlaege" }
If values.Contains(row.Cells(0).Value, StringComparer.CurrentCultureIgnoreCase) Then
    ' ... '
Else
    ' ... '
End If