zoukankan      html  css  js  c++  java
  • 获取接口数据

    Public Function getProxyL(ByVal num As Integer, ByVal classid As Integer) As String

    Dim rs As String = ""
    Dim Expires_in As Integer = 0 '过期时间
    Dim url As String = "http://域名/api/default?mid=20&num=" & num & "&classid=" & classid
    Try
    Dim objHTTP As Object = System.Web.HttpContext.Current.Server.CreateObject("Msxml2.ServerXMLHTTP")
    objHTTP.open("GET", url, False)
    objHTTP.send()
    Dim r As String = objHTTP.responseText
    objHTTP = Nothing
    rs = r
    Catch ex As Exception
    Throw ex
    End Try

    Return rs
    End Function

    调用:

    Dim Jsonstr As String = getProxyL(8, 27)
    Dim r As ArrayList = CType(JsonConvert.DeserializeObject(Jsonstr, GetType(ArrayList)), ArrayList)
    If r.Count > 0 Then
    rpt_news.DataSource = r
    rpt_news.DataBind()
    End If

  • 相关阅读:
    jQuery_第一章_JavaScript基础
    呵呵双钻
    MINIDVD
    幸运抽奖
    三章
    复习
    三种循环
    百文买百鸡
    1~100的奇数和
    Python memcache和redis
  • 原文地址:https://www.cnblogs.com/shiyi2014/p/12679647.html
Copyright © 2011-2022 走看看