注册新用户与即时开通BlobGroup

注册新用户这里没有什么太多的说到,需要考虑一个问题,BlobGroup。原本的数据库中并没有关于BLOG分类的表,可以建立一个,将BLOG群体分为不同性质的聚合,如技术、音乐、文学、兴趣等等,选择不同的类别,在加入数据库时给以相应的BlogGroup,以后会在首页中由GroupID体现出来。
另一方面,考虑用户注册名的过滤问题,也就是其application值,如果他注册了bin、images、admin、services等名字,肯定不会很好。
if (BlogGroupIDList.SelectedValue=="" || BlogGroupIDList.SelectedValue==null)
{
Message.Text = "你没有选择类别";
return;
}
if (CheckUserName(tbUserName.Text))
{
Message.Text = "用户名请不要使用与系统相关的字眼,如:admin,User,Images等";
return;
}

即时开通,说白了就是给用户建立一个目录,并建立一个空白内容的Default.aspx文件,可以先放一个空白内容的Default.aspx文件,在为用户建立目录后,COPY过去。。

private bool CreatNewBlogContent(string _newuserfile)
{
string _newpath = Context.Server.MapPath("/") + _newuserfile + "\\";
string _defaultfile = Context.Server.MapPath("/") + "AAA.aspx";
try
{
Dottext.Framework.Images.CheckDirectory(_newpath);

if (File.Exists(_defaultfile))
{
File.Copy(_defaultfile, _newpath + "default.aspx", true);
}

}
catch
{
return false;
}

return true;
}

posted @ 2007-07-24 16:32  习图  阅读(112)  评论(0)    收藏  举报