在asp.net找到回访者 [英] find returning visitor in asp.net
本文介绍了在asp.net找到回访者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i我在电子商务网站工作有没有找到回访者的方式
i使用以下代码但不起作用。当多个用户连接wifi时,它只告诉公众
ipaddressVal = HttpContext.Current.Request.ServerVariables [ HTTP_X_FORWARDED_FOR];
if (!string.IsNullOrEmpty(ipaddressVal))
{
string [] ipRange = ipaddressVal.Split(' ,');
int le = ipRange.Length - 1 ;
ipaddressVal = ipRange [le];
}
else
ipaddressVal = HttpContext.Current.Request.ServerVariables [ REMOTE_ADDR];
解决方案
这通常是通过Cookie,在Cookie中存储GUID或其他一些不可猜测的标识符,并将其与用户的帐户相关联。它仍然不是100%,因为它只能识别从同一台计算机返回您网站的人,但它可能是您将获得的最佳解决方案。
deal all
i am working on e commerce website is there any way to find returning visitor
i use following code but not work. when multiple user connected with wifi it only tell public
ipaddressVal = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (!string.IsNullOrEmpty(ipaddressVal))
{
string[] ipRange = ipaddressVal.Split(',');
int le = ipRange.Length - 1;
ipaddressVal = ipRange[le];
}
else
ipaddressVal = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
解决方案
This is normally done via cookies, store a GUID or some other non-guessable identifier in a cookie and link it with the user's account. It's still not 100% though as it only identifies people returning to your site from the same computer, but it's probably the best solution you're going to get.
这篇关于在asp.net找到回访者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文