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. How to know client IP Address ?

How to know client IP Address ?

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
6 Posts 4 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.
  • S Offline
    S Offline
    Samarjeet Singh india
    wrote on last edited by
    #1

    Hi all, In my website I have made program that if any error will come then an email comes to me. I want to also know IP address,browsertype etc.. of that machine in the email. Thanks to all..

    T A 2 Replies Last reply
    0
    • S Samarjeet Singh india

      Hi all, In my website I have made program that if any error will come then an email comes to me. I want to also know IP address,browsertype etc.. of that machine in the email. Thanks to all..

      T Offline
      T Offline
      thatraja
      wrote on last edited by
      #2

      code is below

      Request.ServerVariables["REMOTE_ADDR"]

      S 1 Reply Last reply
      0
      • T thatraja

        code is below

        Request.ServerVariables["REMOTE_ADDR"]

        S Offline
        S Offline
        Samarjeet Singh india
        wrote on last edited by
        #3

        Thanks Dear, But how can we get browser informatio ?

        M T 2 Replies Last reply
        0
        • S Samarjeet Singh india

          Thanks Dear, But how can we get browser informatio ?

          M Offline
          M Offline
          Manas Bhardwaj
          wrote on last edited by
          #4

          Look at this [^]one.

          Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

          1 Reply Last reply
          0
          • S Samarjeet Singh india

            Thanks Dear, But how can we get browser informatio ?

            T Offline
            T Offline
            thatraja
            wrote on last edited by
            #5

            you can get the information by Request.Browser.*. For example

            Request.Browser.Browser

            you can get the user browser

            1 Reply Last reply
            0
            • S Samarjeet Singh india

              Hi all, In my website I have made program that if any error will come then an email comes to me. I want to also know IP address,browsertype etc.. of that machine in the email. Thanks to all..

              A Offline
              A Offline
              April Fans
              wrote on last edited by
              #6

              private string GetClientIP() { string result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (null == result || result == String.Empty) { result = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } if (null == result || result == String.Empty) { result = HttpContext.Current.Request.UserHostAddress; } return result; }

              April Comm100 - Leading Live Chat Software Provider

              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