GetIP() public method

public GetIP ( ) : string
return string
Example #1
0
        public String GetUsrLst(String sIP)
        {
            try
            {
                int i; String sRet = "";

                for (i = 0; i < _listUsr.Count; i++)
                {
                    User usr = (User)_listUsr[i];
                    if (usr.GetIP() != sIP)
                    {
                        sRet += usr.GetUser() + "|";
                    }
                }
                return(sRet);
            }
            catch (Exception)
            {
            }
            return("");
        }
Example #2
0
        public User GetUserFromIP(String sIP)
        {
            User usr = null;

            try
            {
                int i;
                for (i = 0; i < _listUsr.Count && usr == null; i++)
                {
                    User tmp = (User)_listUsr[i];
                    if (tmp.GetIP() == sIP)
                    {
                        usr = tmp;
                    }
                }
            }
            catch (Exception)
            {
            }
            return(usr);
        }
Example #3
0
        public bool HeartBeatUser(String sIP)
        {
            bool bFound = false;

            try
            {
                int i;

                for (i = 0; i < _listUsr.Count && !bFound; i++)
                {
                    User tmp = (User)_listUsr[i];
                    if (tmp.GetIP() == sIP)
                    {
                        tmp.SetHearBeat(true);
                        bFound = true;
                    }
                }
            }
            catch (Exception)
            {
            }
            return(bFound);
        }