private void UpdateList()
{
AjaxLife.Debug("BanList", "Loading ban list from " + AjaxLife.BAN_LIST + "...");
try
{
string sbanlist = "";
if (AjaxLife.BAN_LIST.StartsWith("http://"))
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(AjaxLife.BAN_LIST);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new System.IO.StreamReader(response.GetResponseStream());
sbanlist = reader.ReadToEnd();
reader.Close();
response.Close();
}
else
{
sbanlist = File.ReadAllText(AjaxLife.BAN_LIST);
}
char[] newline = { '\n' };
this.Bans = sbanlist.Split(newline);
for (int i = 0; i < this.Bans.Length; ++i)
{
this.Bans[i] = this.Bans[i].Trim();
}
AjaxLife.Debug("BanList", "Ban list up to date. " + Bans.Length + " banned names.");
}
catch (Exception e)
{
AjaxLife.Debug("BanList", "Ban list update failed: " + e.Message);
}
}