用户创建相册的字符串发生的错误
用户注册完毕。在服务器User文件夹下创建一个个人信息和imags的文件夹
string SubDir = user.Email;
string Timepath = Server.MapPath("Users/" + SubDir + "/" + "Images").ToString() + "\\";
if (!Directory.Exists(Timepath))
{
Directory.CreateDirectory(Timepath);
}
用户使用相册时,在Images文件夹下创见新相册文件夹(服务器上)
Users user = (Users)Session["Users"] ;
string newAlbum = txtCreateNew.Text;
string TimePath = Server.MapPath("Users/"+user.Email+"/Images/"+newAlbum).ToString() + "\\";
//说 :System.NullReferenceException: 未将对象引用设置到对象的实例
if (!Directory.Exists(TimePath))
{
Directory.CreateDirectory(TimePath);
}
字符串设置可有错;如果错了按我得逻辑该怎么弄。请帮忙,刚注册分不躲