VB.NET 如何对JOSN解析 50

如何对图上获取到的数据解析,提取出变量值DimFHAsstring‘’FH是返回值... 如何对图上获取到的数据解析,提取出变量值Dim FH As string ‘’FH是返回值 展开
 我来答
VB编程解放双手
2017-07-05 · 个人VB爱好者专注vb编程_时效软件
VB编程解放双手
采纳数:1204 获赞数:2391

向TA提问 私信TA
展开全部
对josn字符串,根据关键字进行提取!比如要提取:局域网这3个字
Private Sub Form_Load()
Me.AutoRedraw = True
Dim FH As String
FH = """area"":""局域网"","

Dim n As Long, m As Long, t As String, s As String
t = "area"":"
s = ""","
t = getjosn(FH, t, s)
Print t
End Sub
Function getjosn(ByVal strfh As String, ByVal strt As String, ByVal strs As String) As String
On Error GoTo myerr
Dim n As Long, m As Long, t As String, f As String
f = strfh
t = strt
n = InStr(f, t) + Len(t)
t = Right(f, Len(f) - n)
s = strs
m = InStr(t, s) - 1
t = Left(t, m)
getjosn = t
Exit Function
myerr:
getjosn = ""
End Function
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式