Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:vb.net 访问webapi接口,如何改进foxtable中

1楼
252476276 发表于:2024/9/9 9:25:00
vb.net  get代码, 如果改进foxtable中, 还有post方法应该如何写?

Imports System.Net.Http
Imports System.Threading.Tasks
 
Public Class WebApiClient
 
    Private Shared ReadOnly _client As New HttpClient()
 
    Public Shared Async Function GetDataAsync(ByVal uri As String) As Task(Of String)
        Try
            Dim response As HttpResponseMessage = Await _client.GetAsync(uri)
            If response.IsSuccessStatusCode Then
                Dim content As String = Await response.Content.ReadAsStringAsync()
                Return content
            Else
                Return Nothing
            End If
        Catch ex As Exception
            ' 处理异常
            Return Nothing
        End Try
    End Function
 
End Class
2楼
有点蓝 发表于:2024/9/9 9:54:00
改不了,这个是高版本的net 4.5及以上才有功能,Foxtable只支持到net4.0。

4.0可以看看:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=133325&replyID=889181&skin=1

https://docs.microsoft.com/zh-cn/dotnet/api/system.net.httpwebrequest?view=netframework-4.0
3楼
252476276 发表于:2024/9/9 10:08:00
谢谢
共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03516 s, 2 queries.