In some of point of requirement you may need to show the IP address in visualforce page. The following is the way to show IP address in salesforce.
Apex Class
- public class IPAddress
- {
- public string myIPAddress{get;set;}
- public IPAddress()
- {
- myIPAddress = ApexPages.currentPage().getHeaders().get('X-Salesforce-SIP');
- }
- }
Visualforce page
- <apex:page controller="IPAddress" >
- Your Login IP Address : {!myIPAddress}
- </apex:page>
Here is the IP Address
No comments:
Post a Comment