Mã nguồn :


Mã:
public void Application_Start(object sender, EventArgs e){    BeginRequest += new System.EventHandler(Application_BeginRequest);} public void Application_BeginRequest(object sender, EventArgs e){    if (HttpContext.Current.Request.ServerVariables["HTTP_USER_AGENT"].Contains("Googlebot"))    {        // Welcome Google bot! I'm going to let my        // webmaster know that you're here!        new SmtpClient().Send("MySite@***.com",        "MyEmail@***.com",        "Guess who came to visit!",        "Google is crawling in my Site!");    }}
Có thể thêm hàm cập nhật logs trong đoạn Send mail. Hàm send mail là để thông báo cho mình biết khi nào google sẽ vào site của mình. Tùy từng loại mail mà sẽ có các port khác nhau nhé.
Enjoy!