本示例使用的设备:RFID网络WIFI无线TCP/UDP/HTTP可编程二次开发读卡器POE供电语音-淘宝网 (taobao.com)
(p1 + k) Thengetpostval = Mid(strls, p1 + k, p2 - (p1 + k))Elsegetpostval = ""End IfEnd FunctionFunction getjsonval(totalstr, namestr)Dim p1, p2, k, n, strlsn = Len(totalstr)If n < 5 Thengetjsonval = ""Exit FunctionEnd IfIf (Left(totalstr, 1) "{") Or (Right(totalstr, 1) "}") Thengetjsonval = ""Exit FunctionEnd Ifstrls = "," + Mid(totalstr, 2, n - 2) + ","k = Len(namestr) + 4p1 = InStr(strls, ",""" + namestr + """:")If p1 (p1 + k) Thengetjsonval = Mid(strls, p1 + k, p2 - (p1 + k))If (Left(getjsonval, 1) """") Or (Right(getjsonval, 1) """") Thengetjsonval = ""Exit FunctionEnd Ifn = Len(getjsonval)If n < 3 Thengetjsonval = ""Exit FunctionEnd Ifgetjsonval = Mid(getjsonval, 2, n - 2)Elsegetjsonval = ""End IfEnd Function'Parse Get information------------------------------------------------------------info = Request.QueryString("info") 'Information framejihao = Request.QueryString("jihao") 'Equipment number(can modify)caretype = Request.QueryString("cardtype") 'The card type can be IC, ID, or ISO15693card = Request.QueryString("card") 'Hexadecimal card printing numberData = Request.QueryString("data") 'Card sector datadn = Request.QueryString("dn") 'Hardware serial number of equipment, factory has been cured, unique in the worldStatus = Request.QueryString("status") 'Read card status. For example, the password authentication failure is 12If ((info "") And (jihao "") And (caretype "") And (card "")) Then Str = "Response="'Fixed prefix that our device uses to retrieve the return informationStr = Str + "1," 'Information type: 1 indicates the display and sound of the driving deviceStr = Str + info 'Information frameStr = Str + ",{CardNo:}"+ card+ "\nWelcome to user !" 'LCD display infomationStr = Str + ",20"'Display delay of 20 secondsStr = Str + ",1" 'Buzzer sound typeStr = Str + ",0" 'Chinese phonetic coderesponse.Write (Str)response.endElse'Parse POST information**********************************poststrlen = Request.TotalBytes 'lengthIf poststrlen > 0 Thenpoststr = bin2str(Request.BinaryRead(poststrlen))info = getpostval(poststr, "info") 'Information framejihao = getpostval(poststr, "jihao") 'Equipment number(can modify)caretype = getpostval(poststr, "cardtype") 'The card type can be IC, ID, or ISO15693card = getpostval(poststr, "card") 'Hexadecimal card printing numberData = getpostval(poststr, "data") 'Card sector datadn = getpostval(poststr, "dn") 'Hardware serial number of equipment, factory has been cured, unique in the worldStatus = getpostval(poststr, "status") 'Read card status. For example, the password authentication failure is 12If ((info "") And (jihao "") And (caretype "") And (card "")) ThenStr = "Response="'Fixed prefix that our device uses to retrieve the return informationStr = Str + "1," 'Information type: 1 indicates the display and sound of the driving deviceStr = Str + info 'Information frameStr = Str + ",{CardNo:}"+ card+ "\nWelcome to user !" ''LCD display infomationStr = Str + ",20"'Display delay of 20 secondsStr = Str + ",1" 'Buzzer sound typeStr = Str + ",0" 'Chinese phonetic coderesponse.Write (Str)response.endElse'Parsejson information**********************************info = getjsonval(poststr, "info") 'Information framejihao = getjsonval(poststr, "jihao") 'Equipment number(can modify)caretype = getjsonval(poststr, "cardtype") 'The card type can be IC, ID, or ISO15693card = getjsonval(poststr, "card") 'Hexadecimal card printing numberData = getjsonval(poststr, "data") 'Card sector datadn = getjsonval(poststr, "dn") 'Hardware serial number of equipment, factory has been cured, unique in the worldStatus = getjsonval(poststr, "status") 'Read card status. For example, the password authentication failure is 12If ((info "") And (jihao "") And (caretype "") And (card "")) ThenStr = "Response="'Fixed prefix that our device uses to retrieve the return informationStr = Str + "1," 'Information type: 1 indicates the display and sound of the driving deviceStr = Str + info 'Information frameStr = Str + ",{CardNo:}"+ card+ "\nWelcome to user !" ''LCD display infomationStr = Str + ",20"'Display delay of 20 secondsStr = Str + ",1" 'Buzzer sound typeStr = Str + ",0" 'Chinese phonetic coderesponse.Write (Str)response.endEnd IfEnd IfEnd IfEnd If%>