以下のコードを使用してユーザーグループを取得していますが、ユーザーが「TestGroup」にいる場合、ページをリダイレクトしない場合に何かを行うようにコーディングする方法がわかりませんか?
Dim resEnt As SearchResult
Try
For Each resEnt In mySearcher.FindAll()
LabelUser.Text = resEnt.GetDirectoryEntry.Properties.Item("DisplayName").Value
LabelLocation.Text = resEnt.GetDirectoryEntry.Properties.Item("SystemUserLocation").Value
LabelState.Text = resEnt.GetDirectoryEntry.Properties.Item("st").Value
LabelCountry.Text = resEnt.GetDirectoryEntry.Properties.Item("c").Value
Dim result As SearchResult = mySearcher.FindOne()
If (result Is Nothing) Then
Else
Dim groupColl As Object
For Each groupColl In resEnt.Properties("memberof")
Dim GroupArray As Array = groupColl.split(",")
Select Case GroupArray(0).replace("CN=", "")
Case "TestGroup"
'Continue loading page
Case Else
'Prevent page from loading????
End Select
Next groupColl
End If
Next
Catch f As Exception
Console.WriteLine(f.ToString)
End Try