マイクロソフト系技術情報 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。

目次

概要

方法

Webサイトの様々なパスを取得する方法。

HttpServerUtility?.MapPath?

Page内

Server組み込みオブジェクトからHttpServerUtility?インスタンスを取得。

string path = Server.MapPath("./");

Page外

HttpContext?.Current.ServerプロパティからHttpServerUtility?インスタンスを取得。

string path = HttpContext.Current.Server.MapPath("./");

HttpRequest?

ApplicationPath?

https://msdn.microsoft.com/ja-jp/library/system.web.httprequest.applicationpath.aspx

CurrentExecutionFilePath?

https://msdn.microsoft.com/ja-jp/library/system.web.httprequest.currentexecutionfilepath.aspx

FilePath?

https://msdn.microsoft.com/ja-jp/library/system.web.httprequest.filepath.aspx

Path

https://msdn.microsoft.com/ja-jp/library/system.web.httprequest.path.aspx

PhysicalApplicationPath?

https://msdn.microsoft.com/ja-jp/library/system.web.httprequest.physicalapplicationpath.aspx

PhysicalPath?

https://msdn.microsoft.com/ja-jp/library/system.web.httprequest.physicalpath.aspx

参考

アプリケーションの様々なパスを取得する方法


Tags: :.NET開発, :ASP.NET


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS