问题
I've been asked to set up a web service for account creation. The inbound HTTP Post request contains a single formatted field containing tab delimited fields with a header line wrapped in tags.
Here's a sample:
accountRequest=<NewUser>
userName password fName lName
ABC123 wzbtw88g Joe Bloggs
</NewUser>
Can anyone help me understand how to parse it with Classic ASP?
回答1:
extract the values into a string and do something like this
<%
str="userName password fName lName ABC123 wzbtw88g Joe Bloggs"
arr=split(str,vbTab)
for i=lbound(arr) to ubound(arr)
response.write i & "=" & arr(i) &"<BR>"
next
%>
来源:https://stackoverflow.com/questions/9026654/http-post-request-with-tab-delimited-field