I have to retrieve internal ip addresses(10.X.X.X) from clients on a intranet. The intranet is built using ASP.NET C# however i'd like to implement this feature in JS if possible. Can this be done in JS? If not how would i do this in ASP.NET? Thanks in advance!
            Asked
            
        
        
            Active
            
        
            Viewed 717 times
        
    0
            
            
        - 
                    Possible duplicated question, http://stackoverflow.com/questions/391979/get-client-ip-using-just-javascript – lmcanavals Mar 12 '12 at 22:37
- 
                    Doesn't look like you can get the internal IP address of the client unless the server is on the same internal network. Here is another duplicate candidate: http://stackoverflow.com/questions/102605/can-i-lookup-the-ip-address-of-a-hostname-from-javascript – Joshua Hayworth Mar 12 '12 at 22:40
- 
                    I cant use PHP or JSON like both solutions suggest. – timvb Mar 12 '12 at 22:52
2 Answers
2
            ...i'd like to implement this feature in JS if possible. Can this be done in JS?
If not how would i do this in ASP.NET?
Using UserHostAddress.
 
    
    
        Community
        
- 1
- 1
 
    
    
        T.J. Crowder
        
- 1,031,962
- 187
- 1,923
- 1,875
1
            
            
        HttpContext.Current.Request.UserHostAddress should do the trick, on the server side.
 
    
    
        Dave Bish
        
- 19,263
- 7
- 46
- 63
