提交站点地图到谷歌

本文关键字:谷歌 地图 站点 提交 | 更新日期: 2023-09-27 18:11:19

 System.Net.WebRequest reqGoogle = System.Net.WebRequest.Create("http://www.google.com/webmasters/tools/ping?sitemap=" + HttpUtility.UrlEncode("http://www.shree/SiteMap/'" + PortalName + "'/sitemap.xml"));
 reqGoogle.GetResponse();


代码工作良好,当谷歌不被阻止。对于某些地区,我的管理员阻止了谷歌。阻断后,谷歌代码给出了一个错误。如何先检查网站是否被屏蔽。请帮助。

提交站点地图到谷歌

像这样(?):

try
{
  System.Net.WebRequest reqGoogle = System.Net.WebRequest.Create("http://www.google.com/webmasters/tools/ping?sitemap=" + HttpUtility.UrlEncode("http://www.shree/SiteMap/'" + PortalName + "'/sitemap.xml"));
  reqGoogle.GetResponse();
}
catch(WebException ex)
{
  MessageBox.Show("Google is blocked");
}