如何读取和写入Windows的“网络位置"? [英] How to read and write to a Windows "Network Location"

查看:59
本文介绍了如何读取和写入Windows的“网络位置"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows中,可以使用添加网络位置向导"将FTP站点添加为命名的网络位置.例如,用户可以添加一个名为"MyFtp"的位置.

In Windows you can add a FTP site as a named Network Location using the "Add Network Location Wizard". For instance, a user can add a location called "MyFtp".

在.Net中,我如何访问(列出,读取和写入)该位置的文件?Windows是否将实现(WebDAV,FTP或其他)抽象化,并使其看起来像.Net程序的本地文件夹?如果是这种情况,如何在 File.WriteAllText(path,content)中指定 path 参数?如果没有,我该如何访问文件?

In .Net, how can I access (list, read and write) files in that location? Does Windows abstract away the implementation (WebDAV, FTP or else) and make it look like a local folder to my .Net program? If that's the case, how do I specify the path parameter in File.WriteAllText(path, content)? If not, how can I access the files?

推荐答案

否,Windows仅在资源管理器中处理该问题.(他们可能已在Windows的较新版本中将其删除.)您将不得不使用一些内置类或自己实现FTP,WebDav和任何其他协议.

No, Windows only handles that in Explorer. (They might have removed this in newer versions of Windows.) You will have to use some built in classes or implement FTP, WebDav and any other protocol yourself.

这篇关于如何读取和写入Windows的“网络位置"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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