Public dtExistingUsers As DataTable Protected Function fnMultipleUserCheck(ByVal UserID) fnMultipleUserCheck = 0 If IsNothing(dtExistingUsers) Then dtExistingUsers = New DataTable dtExistingUsers.Columns.Add("Session_UserName") dtExistingUsers.Columns.Add("Session_IP") dtExistingUsers.Columns.Add("Session_ID") End If For Each row As DataRow In dtExistingUsers.Rows If row.Item("Session_UserName") = UserID Then fnMultipleUserCheck = 1 End If Next If fnMultipleUserCheck = 0 Then Dim newrow As DataRow = dtExistingUsers.NewRow newrow.Item("Session_UserName") = UserID newrow.Item("Session_IP") = System.Web.HttpContext.Current.Request.UserHostAddress newrow.Item("Session_ID") = HttpContext.Current.Session.SessionID dtExistingUsers.Rows.Add(newrow) End If Return fnMultipleUserCheck End Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)