How to understand whether the visitor is Googlebot or not ? ASP.net
How to understand whether th开发者_StackOverflow社区e visitor is Googlebot or not ? ASP.net 4.0 & C#
I mean i want to understand that if the visitor is Googlebot or not.
if (Request.UserAgent.IndexOf("Googlebot") != -1)
{
// google!
}
I think, according to the headers supplied by this website
You need to check the request headers
Each time something requests your website it gives up some information itself, as per @Brads answer you're checking whether whatever is requesting your site is calling itself 'Googlebot'. Of course this can be a lie - so you can't place any great trust within this value.
精彩评论