简体   繁体   English

获取IIS服务器目录路径

[英]Getting IIS Server directory path

I am trying to get the IIS server directory path from another computer to download few files from there. 我正在尝试从另一台计算机获取IIS服务器目录路径,以从那里下载一些文件。

using codes like this.. 使用这样的代码..

using (var client = new WebClient())
{
    client.DownloadFile("//serverpath", "a.exe");
}

I would like to download the files from the directory shown in the picture! 我想从图片所示的目录下载文件! 服务器目录

That is the server computer and I'll be putting some exe files in that directory .I would now like to download the files that i put in that directory to the client computer I'm am using. 那是服务器计算机,我将在该目录中放置一些exe文件。我现在要将我将该目录中的文件下载到我正在使用的客户端计算机上。 How should I put the serverpath?? 我应该如何放置服务器路径? Agent folder is an virtual directory. 代理文件夹是一个虚拟目录。

If this is asp.net mvc there is direct support for this with FileResult , and Controller has a set of helpers: 如果这是asp.net mvc,则使用FileResult直接对此提供FileResult ,并且Controller具有一组帮助器:

In your action: 在您的行动中:

return File(filename, contentType);

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

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