Writing File to Temp Folder

后端 未结 5 915
别那么骄傲
别那么骄傲 2020-12-08 13:14

I want to use StreamWriter to write a file to the temp folder.

It might be a different path on each PC, so I tried using %temp%\\SaveFile.txt

5条回答
  •  执念已碎
    2020-12-08 13:29

    string result = Path.GetTempPath();
    

    https://docs.microsoft.com/en-us/dotnet/api/system.io.path.gettemppath

提交回复
热议问题