I am developing one application. i want run only in my laptop. suppose i give to another persons means will change current IP Address then only run otherwise will not be run and it will show the login fail how to do that.
please send me with Example.
Thanks&Regs
Magesh.A
Loading
magesh manavalanPosted Mar 31, 2012, 12:11 AM
magesh manavalanPosted Mar 31, 2012, 12:09 AM
SenthilkumarPosted Mar 30, 2012, 11:58 PM
You need to store your laptop IP address some where in the web.config or constant.
When ever the request comes from the url then you need to get the IP address of the request URL.
You need to check whether the request IP address is same one which stored in the web.config. It it is equal then its your laptop and if not then you need to show it login fail.
To get the IP address of requested url is:
string strIPAddress = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList.GetValue(0).ToString();
This logic can be written in your base page or global.asax page.
Hope this will help you.