Reputation: 617
we have to build a functionality in asp.net and c# which in a online survey one ip address will only be allowed to attend the survey once? how can we achieve this?
Upvotes: 0
Views: 435
Reputation: 8736
Try this to get IP
HttpContext.Current.Request.UserHostAddress;
or
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
or
HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
Store some where in database..now for every time on Request for survey you can lookup in database that it is exist or not
Upvotes: 1