更新时间:2023-02-08 08:37:53
If I were to guess I'd say your project is a class library or some non web application project.
If this is the case you will not have access to httpcontext and you'll either have to change your project to a web project or you can look at alternative methods of saving your file. For example: Writing Text File to Folder on Desktop
*note I've not tried the suggested solution.