简体   繁体   English

从php脚本中获取信息并显示在winform上

[英]Grab information from a php script and display on a winform

I have a php script that returns a list of file directories held at the root of a remote server that I need to display in my winform application. 我有一个php脚本,该脚本返回一个目录列表,该目录保存在需要显示在winform应用程序中的远程服务器的根目录中。 For example if I put the link in my browser it returns something like the following: 例如,如果将链接放在浏览器中,它将返回类似以下内容的内容:

511157.jpg|Koala.jpg|VIDEO0031.3gp|Test_Folder.folder 511157.jpg | Koala.jpg | VIDEO0031.3gp | Test_Folder.folder

However, I have never accessed a php script through a C# application before and nor have I displayed the information it may hold. 但是,我以前从未通过C#应用程序访问过php脚本,也从未显示过它可能包含的信息。

Is there a best practice for being able to connect and grab the information via a php script? 是否有能够通过php脚本连接和获取信息的最佳实践? Could someone please point me in the right direction to achieve what I would like to achieve. 有人可以指出正确的方向来实现我想要实现的目标。

try WebClient 尝试使用WebClient

using(var client = new WebClient())
{
    String result = client.DownloadString("www.foosite.com/page.php");
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM