簡體   English   中英

從.cs文件調用Server.MapPath

[英]Calling Server.MapPath from .cs file

我正在嘗試將錯誤寫入MapPath中的文本文件。 但我有一個問題是:

path = Server.MapPath("~/emails.txt");

實際上, Server位於System.Web.UI.Page命名空間中,我想在沒有aspx文件的cs文件中使用它。 如何從CS CodeFile寫入文件?

使用HttpContext.Current.Server

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM