简体   繁体   English

从网络上的其他计算机读取xml文件?

[英]Read an xml file from different computer on the network?

To begin with, I developed a web application which reads an XML file from specific location and displays the contents on editable web page of the application,which is executed perfectly when the XML file is on the same machine/computer. 首先,我开发了一个Web应用程序,该Web应用程序从特定位置读取XML文件并将其内容显示在该应用程序的可编辑Web页面上,当XML文件位于同一台计算机/计算机上时,可以完美执行该Web应用程序。 When I try to read the same file on different computer on the network I cannot read the contents onto my web page. 当我尝试在网络上的另一台计算机上读取同一文件时,无法将内容读取到我的网页上。

My Observation: When I access that file from run window in the computer by entering \\xxx.xxx.xx.xx\\c$ it gives me the window to connect to the machine asking for credentials and I guess the session is open. 我的观察:当我通过输入\\ xxx.xxx.xx.xx \\ c $从计算机的运行窗口访问该文件时,它为我提供了一个连接到计算机的窗口,要求输入凭据,并且我认为会话已打开。 So I close the window and when I access the xml file from the web application it's able to read the content. 因此,我关闭了窗口,当我从Web应用程序访问xml文件时,便能够读取内容。

Is there a way to bypass this authentication mechanism which is part of windows when I use my web app to read the XML file or is there a way to accommodate the extra step to configure the authentication in my application? 当我使用Web应用程序读取XML文件时,是否有办法绕过Windows的身份验证机制,还是有办法容纳在应用程序中配置身份验证的额外步骤?

I would be glad if someone can guide me to the solution. 如果有人可以指导我解决问题,我将感到非常高兴。

Check the user your web application is running under and if this user is also permitted to access this location. 检查您的Web应用程序正在其下运行的用户,以及是否还允许该用户访问此位置。

If you are using IIS to host the page you have to check the "AppPool" user and also the users which are used at the "Web Site" and "Application" 如果使用IIS托管页面,则必须检查“ AppPool”用户以及“网站”和“应用程序”中使用的用户。

只需将IIS应用程序池用户更改为“足够权限”用户(右键单击当前应用程序池-高级设置-身份),或在web.config的相同名称部分中指定模拟。

Could it be possible to change your logic, 能否改变您的逻辑,

By storing file from different network to local machine where your code is running, through uploading file and process it. 通过将文件从其他网络存储到运行您的代码的本地计算机,通过上传和处理文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM