从故障网页asp.net访问形式的网络共享 [英] Trouble accessing network share from asp.net web form
问题描述
我有一个asp.net网页表单,这将显示一个PDF文件。本PDF存储在其他服务器上的网络共享。 的份额已经阅读权限给大家。
I have an asp.net webform which will display a PDF file. This pdf is stored on a network share on another server. The share has read permissions for everyone.
当我尝试引用像\\\\服务器\\共享名\\ file.pdf我收到以下错误:
When I try to reference like \\server\sharename\file.pdf I get the following error:
服务器中的'/ NCLWeb应用程序错误。结果
HTTP错误400 - 错误的请求
Server Error in '/NCLWeb' Application.
HTTP Error 400 - Bad Request.
我也试过用文件://的变化在前面,并扭转了斜线。我在做什么错了?
I've also tried variation with "file://" in front, and reversing the slashes. What am I doing wrong?
我应该如何正确地引用呢?
How should I properly reference this?
编辑:我使用的测试code Visual Studio的内置的开发服务器。 code用途包括:
I am testing the code using Visual Studio's built in development server. Code usage includes:
Response.Redirect(@\\server\sharename\file.pdf);
ShowPdf1.FilePath = @\\server\sharename\file.pdf;
在哪里ShowPdf1是我使用之前浏览器中显示PDF格式的控制。
Where ShowPdf1 is a control which I've used to display pdf's in a browser before.
推荐答案
我怀疑,文件夹是一个虚拟目录。如果你想从你的应用程序访问任何共享文件夹,你需要使该文件夹的虚拟目录
。
I doubt that folder is a Virtual Directory. If you want to access any shared folder from your application you need to make a Virtual Directory
of that Folder.
这篇关于从故障网页asp.net访问形式的网络共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!