如何获取本地计算机目录名称以存储来自Web应用程序的pdf文件 [英] How to get local machine directory name to store pdf files from web application

查看:70
本文介绍了如何获取本地计算机目录名称以存储来自Web应用程序的pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有网络应用程序,我想要本地磁盘路径,我想从我的web应用程序保存或下载文件到本地磁盘。我已经使用treenode创建了特定的目录结构。问题是当我在服务器上托管我的Web应用程序时,它只显示服务器目录结构而不是本地机器

如果有任何想法然后与我分享。



提前感谢



我尝试过:



Hello,
I have web application in that i want local disk path where i want to save or download files to local disk from my web application.Here i have used treenode to create perticular directory structure.Here problem is when i host my web application on server then it shows only server directory structure instead of local machine
If any idea then share with me .

thanks in advance

What I have tried:

TreeNode onjParent = new TreeNode("D:\\", "D:\\");
                onjParent.PopulateOnDemand = true;
                TreeView1.Nodes.Add(onjParent);




private TreeNode AddNodes(string path, TreeNode parentNode)
        {
            FileList objList = new FileList(path, "*.*");
            TreeNode node = new TreeNode(path, path);
            for (int index = 0; index < objList.Directories.Length; index++)
            {
                string directory = objList.Directories[index];
                TreeNode objChildNode = new TreeNode(directory, path + "\\" + directory + "\\");
                objChildNode.PopulateOnDemand = true;
                objChildNode.Target = "_blank";

                parentNode.ChildNodes.Add(objChildNode);
            }



显示mi目录结构,但在托管


It shows mi directory structure but it shows server directory after hosting

推荐答案

之后显示服务器目录您在 IIS 中托管的应用程序将具有仅访问项目文件夹的权限。它无法访问任何其他目录,这就是IIS的工作原理。



The Application which you have hosted in the IIS will have the permission to access only the project folder. It cannot access any other directory, this is how IIS works.

Quote:

它在托管后显示服务器目录

it shows server directory after hosting



由于它托管在服务器中,因此只显示服务器路径。


Since it is hosted in server, that will show only the server path.


这篇关于如何获取本地计算机目录名称以存储来自Web应用程序的pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆