访问服务器中的文件 [英] access files in server

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

问题描述

你好
我有一个网站并有一个Windows应用程序,如何访问我的网站上的文件并以Windows窗体显示它们(C#)

Hello
I have a website And have a windows application, how can I access the files on my website and show them in windows forms(C#)

推荐答案

哪些文件?您是指一些常用文件,例如Word文档吗?还是网站的html或aspx文件?

对于前者,您可以创建一个Web服务,以将文件公开给两个应用程序.对于后者,为什么呢?
What files? Do you mean some common files, such as Word documents? Or the html or aspx files of the website?

For the former you could create a webservice to expose the files to both applications. For the latter, why?


如果您不想创建Web服务并且真的想使用某些现有网站,则可以使用网页抓取.请参阅:
http://en.wikipedia.org/wiki/Web_scraping [ http://msdn.microsoft.com/en-us/library/system.net. httpwebrequest.aspx [ ^ ].

有关更多详细信息,请参阅我过去的答案:
从网页中获取特定数据 [如何从另一个站点获取数据 [ ^ ].

—SA
If you don''t want to create a Web service and really want to work with some existing Web site, you can do it using the techniques of Web scraping. Please see:
http://en.wikipedia.org/wiki/Web_scraping[^].

Basically, you will need to use the class System.Net.HttpWebRequest, please see:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^].

For some more detail, please see my past answers:
get specific data from web page[^],
How to get the data from another site[^].

—SA


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

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