how can track IP addres in ASP.net

Discussion in 'C#' started by i_am_dhaval, Jul 21, 2009.

  1. #1
    i have develop one application....now when user login and logout then i want to track there time as well as ip address..also if possible i want to track there pc ip address ("sub ip address)...
     
    i_am_dhaval, Jul 21, 2009 IP
  2. dgxshiny

    dgxshiny Greenhorn

    Messages:
    65
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    23
    #2
    Request.ServerVariables["REMOTE_ADDRESS"].ToString();
    Code (markup):
     
    dgxshiny, Jul 21, 2009 IP
  3. EmeraldOne

    EmeraldOne Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    string IP = Request.ServerVariables["REMOTE_ADDR"].ToString();

    You will not be able to access their time, but you can use the server time...
    Or if you do want, try to make JavaScript that will set the time on to a hidden variable on the page and request it..
    DateTime.Now will give you the time of the SERVER...YOUR server

    let me know of any other question.

    Isaac,
    http://www.7Live7.com
     
    EmeraldOne, Jul 25, 2009 IP