如何返回 C# / ASP.NET Web 应用程序中的完整文件路径?
这应该非常简单,但我已经尝试了互联网上发布的许多解决方案,所以我想我应该在这里尝试一下。我有一个 VS 2008 Web 应用程序,我需要从所选文件中捕获完整的文件路径(目录和文件名)。因此,用户选择一个文件,然后单击其中一个按钮,将控制权转移到我的代码进行处理。那么如何获取文件路径呢?我可以获取文件名,但不能获取路径。谢谢!
This should be really simple, but I have tried many solutions posted on the internet so I thought I'd give this a try here. I have a VS 2008 web application that I need to capture the full file path (directories and file name) from the selected file. So user selects a file and then clicks on one of the buttons which transfers control to my code for processing. So how do I get the file path? I can get the file name, but not the path. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用 Server.MapPath。这更适合在 Web 应用程序中使用。
华泰
Try using Server.MapPath. This is much better to use in Web Apps.
HTH