Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
.NET を使用すると、セッション間で永続的な値を作成してアクセスできます。などの 環境変数を使用することはできますか? もしそうなら、どうすればこれを行うことができますか?%WINDIR%%APPDATA%
%WINDIR%
%APPDATA%
構成にこれがある場合:
<appSettings> <add key="SomePath" value="%TEMP%"/> </appSettings>
次に、コードから次のようにします。
string path = ConfigurationManager.AppSettings["SomePath"]; string fullPath = System.Environment.ExpandEnvironmentVariables(path);