Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Get IP address

Get IP address

Scheduled Pinned Locked Moved ASP.NET
sysadmin
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raushan_9
    wrote on last edited by
    #1

    Hello All, I want to get all System IP address Which is running from a DNS Server. Thanks

    V H 2 Replies Last reply
    0
    • R raushan_9

      Hello All, I want to get all System IP address Which is running from a DNS Server. Thanks

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      Please Google first before you post , there are plenty examples IP list, Check an IP number against a list in C#[^]

      Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

      1 Reply Last reply
      0
      • R raushan_9

        Hello All, I want to get all System IP address Which is running from a DNS Server. Thanks

        H Offline
        H Offline
        httplover
        wrote on last edited by
        #3

        /// <summary> /// 获得客户端IP /// </summary> /// <returns></returns> public static string GetClientIP() { string ip; string[] temp; bool isErr = false; if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_ForWARDED_For"] == null) ip = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString(); else ip = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_ForWARDED_For"].ToString(); if (ip.Length > 15) isErr = true; else { temp = ip.Split('.'); if (temp.Length == 4) { for (int i = 0; i < temp.Length; i++) { if (temp[i].Length > 3) isErr = true; } } else isErr = true; } if (isErr) return "1.1.1.1"; else return ip; }

        living none stoping.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups