Server.MapPath("/") --------------站點根目錄的物理路徑
Server.MapPath("~/")--------------應用程序根目錄的物理路徑
Server.MapPath("./")--------------當前目錄的物理路徑
Server.MapPath("../")--------------上級目錄的物理路徑
using System.io;
//Request.ApplicationPath是程序的虛擬目錄。但操作時要對真實路徑操作,以下就是獲取真實路徑
string filePath = Server.MapPath(Request.ApplicationPath);
//創建目錄。
Directory.CreateDirectory(filePath);
//刪除目錄。
Directory.Delete(filePath);