以编程方式在 ASP.NET 中的服务器上创建目录

发布于 2024-08-23 19:42:33 字数 156 浏览 4 评论 0原文

我想使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

简美 2024-08-30 19:42:33

好的...从你对我的评论的回答我认为你可以尝试一下这个东西:

 images.ImageUrl = "~/Images-" + ObjectName + "/Slide1.png";

希望这有帮助...!!

OK...From your answer to my comment I think you can try this thing out:

 images.ImageUrl = "~/Images-" + ObjectName + "/Slide1.png";

Hope this helps...!!

夜司空 2024-08-30 19:42:33

你提到它不包含在项目中。你指的是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.

琴流音 2024-08-30 19:42:33

在 IIS 中修改网站内容时要小心:它会检测到此类修改并立即重新启动应用程序。

Be careful when modifying the content of the web site in IIS : it detects such modifications and restarts the application immediately.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文