以编程方式在 ASP.NET 中的服务器上创建目录
我想使用 ASP.NET 以编程方式在服务器上创建一个目录。
我已经使用 System.IO 的 Directory.CreateDircory 完成了此操作。但是,在代码中无法访问新创建的文件夹。
经过一番搜索后,我发现新创建的文件夹不包含在项目中,因此无法访问。
I want to programmatically create a directory on the server using ASP.NET.
I have done this using System.IO's Directory.CreateDirctory. however, the newly created folder is not accessible in the code.
after searching a bit, I came to know that the newly create folder is not included the project and hence not accessible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好的...从你对我的评论的回答我认为你可以尝试一下这个东西:
希望这有帮助...!!
OK...From your answer to my comment I think you can try this thing out:
Hope this helps...!!
你提到它不包含在项目中。你指的是Visual Studio中的项目吗?如果是这样,它将不会显示在那里,因为它不是文件系统目录的列表。它是 proj 文件中构建的项目文件列表。您需要将其添加到那里。
如果您指的是应用程序,那么它应该在成功创建后立即可用。
请让我们知道您的问题发生在哪里。
You mention that it is not included in the project. Are you referring to the project in Visual Studio? If so, it will not show up there as it is not a listing of file system directories. It is a listing of project files as build in the proj file. You will need to add it there.
If you are referring to the application then it should be available as soon as it is successfully created.
Please let us know where your issue is happening.
在 IIS 中修改网站内容时要小心:它会检测到此类修改并立即重新启动应用程序。
Be careful when modifying the content of the web site in IIS : it detects such modifications and restarts the application immediately.