Reputation: 23820
How to understand whether the visitor is Googlebot or not ? ASP.net 4.0 & C#
I mean i want to understand that if the visitor is Googlebot or not.
Upvotes: 1
Views: 530
Reputation: 30882
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.
Upvotes: 0
Reputation: 101604
if (Request.UserAgent.IndexOf("Googlebot") != -1)
{
// google!
}
I think, according to the headers supplied by this website
Upvotes: 2