示例#1
0
 private string GetIPFromTgw(COMDT_TGWINFO tgwInfo, IspType ispType)
 {
     for (int i = 0; i < tgwInfo.dwVipCnt; i++)
     {
         if (tgwInfo.astVipInfo[i].iISPType == ispType)
         {
             IPAddress address = new IPAddress((long)tgwInfo.astVipInfo[i].dwVIP);
             return(address.ToString());
         }
     }
     return(null);
 }
示例#2
0
        private string GetIPFromTgw(COMDT_TGWINFO tgwInfo, IspType ispType)
        {
            this.tempIpList.Clear();
            int num = 0;

            while ((long)num < (long)((ulong)tgwInfo.dwVipCnt))
            {
                if (tgwInfo.astVipInfo[num].iISPType == (int)ispType)
                {
                    IPAddress iPAddress = new IPAddress((long)((ulong)tgwInfo.astVipInfo[num].dwVIP));
                    string    item      = iPAddress.ToString();
                    this.tempIpList.Add(item);
                }
                num++;
            }
            if (this.tempIpList.Count == 0)
            {
                return(null);
            }
            int index = Random.Range(0, this.tempIpList.Count);

            return(this.tempIpList[index]);
        }