列出之前通过asp.net webform上传的c#.NET winform中的文件 [英] List files in c#.NET winform that previously uploaded thru asp.net webform

查看:123
本文介绍了列出之前通过asp.net webform上传的c#.NET winform中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,



我需要你的帮助。我在asp.net中创建了一个webform,在IIS上启动虚拟目录:



/myWeb/Default.aspx



并且可以在浏览器中访问:http://myserver/myWeb/Default.aspx



这里我可以将文件上传到虚拟目录:



/ myWeb / uploads /



这样可行。



我的问题是,如何从winForm(C#.net)访问文件列表并在ListBox(或ListView或dataGridView中显示结果。我不知道哪一个是完美的) 。我认为我的武器是C#.NET中的HostingEnvironment.MapPath。



WinForm与ClickOnce一起部署,因此它当然在IIS中有一个虚拟目录。但完全不同于webform。



如果我在'uploads'目录中启用目录浏览怎么办?我应该吗?我不想使用FTP连接来获取文件列表。



感谢您的帮助。



Attila

Dear All,

I need your help. I have a webform created in asp.net, with starting virtual directory on IIS:

/myWeb/Default.aspx

and can be accessed in browser here: http://myserver/myWeb/Default.aspx

Here I can upload files to a virtual directory:

/myWeb/uploads/

This works fine.

My question is, that how can I access the file list from winForm (C#.net) and show the results in ListBox (or ListView or dataGridView. I don't know which one is perfect for this). I think my weapon is HostingEnvironment.MapPath in C#.NET.

The WinForm is deployed with ClickOnce, so it has a virtual directory in IIS of course. But totally another than webform.

What if I enable directory browsing on the 'uploads' directory? should I have to? I don't want to use FTP connection to get the file list.

thanks for your help.

Attila

推荐答案

作为 RyanDev [ ^ ]提到,你必须添加适当的权限。



请参阅:

默认权限和IIS 7.0,IIS 7.5和IIS 8.0的用户权限 [ ^ ]

如何设置运行IIS的wwwroot文件(http:// localhost) [ ^ ]

如何在新的Win 7机器上获得Web(Inetpub)目录的写入权限? [ ^ ]
As RyanDev[^] mentioned, you have to add proper permissions.

Please see:
Description of default permissions and user rights for IIS 7.0, IIS 7.5, and IIS 8.0 [^]
How do I set permissions on wwwroot files (http://localhost) running IIS[^]
How can I get write permission for the Web (Inetpub) directory on a new Win 7 machine?[^]


这篇关于列出之前通过asp.net webform上传的c#.NET winform中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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