我有一个会员注册 aspx 页面。
ACCOUNT(user,pass,mail,privilege)
当用户注册成功时,如果privilege == "lecturer"
--> 会创建一个文件夹,其中folder's name= user
.
看看我下面的代码:
if(privilege=="lecturer")
{
string path = this.Server.MapPath("~/Lecturer/"); // path="D:\\C#Projects\\website\\Lecturer\\"
string targetPath = path + @"\";
System.IO.Directory.CreateDirectory(Server.MapPath(targetPath+newuser));
}
它有一个错误:'D:/C#Projects/website/Lecturer/david' is a physical path, but a virtual path was expected.
为什么???
我真的很想在 Lecturer 文件夹中创建一个 david 文件夹。帮助???