コード例 #1
0
 void BindData()
 {
     foreach (string name in DisallowedNames.GetNames())
     {
         Usernames.Text += name.Trim('*') + "\n";
     }
     Usernames.Text = Usernames.Text.TrimEnd('\n');
 }
コード例 #2
0
    public void btnPost_Click(object sender, EventArgs e)
    {
        ArrayList currentNames = DisallowedNames.GetNames();

        foreach (string nameToDelete in currentNames)
        {
            DisallowedNames.DeleteName(nameToDelete);
        }

        String[] newNames = Usernames.Text.Split('\n');

        foreach (string nameToAdd in newNames)
        {
            if (nameToAdd.Length > 0)
            {
                DisallowedNames.CreateName("*" + nameToAdd.Trim() + "*");
            }
        }

        mbMessage.ShowMsg("修改用户名过滤信息成功!", Color.Navy);
    }