BlogEngine Tüm Yorumları Silmek

Bir müşterimde kullanılan blogengine eski versionu için spam yorumların adedi yazı başina yüzlerce idi ve elle silmenin imkanı yoktu. E biz programcıyız amele değil ;)
Eğer ihtiyacınız olursa aşağıdaki kodu deletecomments.aspx gibi bir isimle blogunuzun root klasörüne atıp çalıştırın.
<%@ Page Language="C#" %>
<%@ Import Namespace="BlogEngine.Core" %>
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
if (Post.Posts.Count > 0)
{
for (int i = Post.Posts.Count - 1; i >= 0; i--)
{
if (Post.Posts[i].Comments.Count > 0)
{
for (int j = Post.Posts[i].Comments.Count - 1; j >= 0; j--)
{
Comment comment = Post.Posts[i].Comments[j];
Post.Posts[i].RemoveComment(comment);
}
}
}
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server"
Text="Tüm yorumları sil!" onclick="Button1_Click" onclientclick="alert('işiniz bittikten sonra bu dosyayı silmeyi unutmayın ;)');" />
</div>
</form>
</body>
</html>