从C#访问unix文件夹 [英] Accessing unix folders from C#

查看:95
本文介绍了从C#访问unix文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的asp.net页面中显示unix文件夹树结构。



当我们要点击任何文件夹时,它应该显示所有该文件夹下的文件。



我关注的是,我们需要访问unix系统。任何人都可以帮忙。



提前感谢。



我的尝试:



我在google搜索时找不到任何代码片段。

I have a requirement to display the unix folders tree structure in my asp.net page.

When we about to click any folder, it should display all the files under that folder.

My concern here is, we need to access the unix system. Can anyone plz help.

thanks in advance.

What I have tried:

I dont find any code snippers when googling.

推荐答案

如果你的意思是服务器文件系统,那就是可能不可能,因为您的托管服务几乎肯定不会授予Web服务器应用程序访问网站外部任何文件夹的权限。您可以使用目录类来访问您所允许的内容。



如果您的意思是客户端文件系统那根本不可能。 C#代码在服务器上运行,而不是客户端,并且出于安全原因,根本无法访问客户端文件系统。同样的事情适用于Javascript - 它在客户端上运行 - 由于完全相同的原因它无法访问。
If you mean the server file system, then that's probably not going to be possible, as your hosting service will almost certainly not give the web server application permission at access any folders outside the websites themselves. You can use the Directory class to access what you are permitted though.

If you mean the client file system, then that is not going to be possible at all. C# code runs on the server, not the client and does not have any access to the client file system at all for security reasons. The same thing applies to Javascript - which does run on the client - it has no access either for exactly the same reasons.


这篇关于从C#访问unix文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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