我试图从 json 下面的json代码中获取值“aaG40a2f-53d3-8f74-3c200403223”。
我的vb.net代码如下所示:
For Each Row In json("data")("records")("Form")
Try
For rowNum = 0 To result_RowNames.Length - 1
result_rowData(intX) = NullSafeSelect(Row, result_RowNames(rowNum))
Select Case result_RowProperTypes(rowNum)
Case "textField"
_tmpHtml += "<td>" & vbCrLf
_tmpHtml += "<input type=""text"" " & _
"data-first=""yes"" " & _
"data-uid=""" & NullSafeSelect(Row("@uid"), result_RowNames(rowNum)) & """ " & _
"onchange=""updateChange(this);"" " & _
"id=""textbox_" & rowNum & """ " & _
"class=""form-control small"" " & _
"value=""" & result_rowData(intX) & """>" & vbCrLf
......etc etc...
我的json in(“data”)(“records”)(“Form”)如下所示:
{
"@application_uid": "af74c279-4340-8441-2dR4e696gb1",
"@draft_ownerid": "",
"@flowState": "ST_NewName",
"@has_draft": "",
"@id": "63",
"@uid": "aaG40a2f-53d3-8f74-3c200403223",
"F_FName": "test1",
"F_LName": "test2"
}
上面的代码有效 - 它只是不会为 uid 生成一个值,如下面的HTML输出所示:
<input type="text" data-first="yes" data-uid="" onchange="updateChange(this);" id="textbox_0" class="form-control small" value="test1">
答案 0 :(得分:0)
看起来我需要做的只是使用
Dim tmpUID = Row("@uid").ToString
为了获得我想要的价值。