什么是从vb.net调用php文件的最快方法

时间:2012-07-19 23:00:32

标签: vb.net sockets

从vb.net调用php文件的最佳方法是什么?理想情况下,我需要一些可以放在函数中的东西,并调用几个参数传递给url字符串。感谢

1 个答案:

答案 0 :(得分:1)

您可以使用System.Net.HttpWebRequest

    Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(New System.Uri("http://contoso.com/query.php?param1=val1&param2=val2"))

    request.Method = System.Net.WebRequestMethods.Http.Get

    Dim response As System.Net.HttpWebResponse = request.GetResponse()

    ' process response here

    response.Close()