在.Net中,Server.MapPath方法用于獲取指定虛擬路徑的物理路徑。
語法:
Server.MapPath(path)
參數:
返回值:
示例:
string physicalPath = Server.MapPath("~/images/logo.png");
在上面的示例中,Server.MapPath方法將虛擬路徑"~/images/logo.png"轉換為物理路徑,并將其存儲在變量physicalPath中。