using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spaces;
using System.Collections.Generic;
using System.Text;
using Spaces.Controls;
public partial class Manage_DisallowedAccount : ManagePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
       　
        if (!IsPostBack)
            BindAccount();
    }

    private void BindAccount()
    {
        List<string> list = SiteTools.GetDisallowedWords(CheckType.Username);
        StringBuilder sb = new StringBuilder();
        foreach (string str in list)
        {
            sb.AppendFormat("{0}\n",str);

        }
        distext.Text = sb.ToString();
    }
    protected void disnow_Click(object sender, EventArgs e)
    {
        string[] names = distext.Text.Trim().Split('\n');
        List<string> list = new List<string>();
        foreach (string s in names)
        {
            if (s.Trim() == string.Empty)
                continue;
            list.Add(s.Trim());
        }
        SpacesDataProvider.Instance().CreateDisallowedWords(list,CheckType.Username);
        SiteTools.ClearCacheDisallowedWords(CheckType.Username);
        BindAccount();
        PageMsg.Text = Msg.GetMsg("修改禁用帐号成功！");
    }
}
