Response. expires =-1 curpage = request. querystring ("curpage") KEYWORDS = request. querystring ("keywords") if curpage = "" Then curpage = "1" strmyiclist = getmyiclistforhtml (43, curpage, 30, keywords) response. write strmyiclist function getmyiclistforhtml (userid, curpage, pagesize, keywords) '####################################### ################# 'function Name: getmyiclistforhtml 'version:. ASP. v1.0 'function Description: Obtain the HTML list on the current page of my IC production' Parameter description: 'userid your user ID integer number' curpage current page number integer number' pagesize the number of products to be displayed per page integer number' keywords search keywords (2 or more characters) string 'Return description: 'Return to the HTML list string on the current page of the IC '############################## ########################## 'on error resume next err. clear () 'defines the variable dim strurl, strdata dim XMLHTTP, xmldoc, strresult = "" 'initial WebService URL strurl = "http: // 192.168.1.88/ECS/products. asmx/getmyiclistforhtml "strdata =" userid = "& Userid & _" & curpage = "& curpage & _" & pagesize = "& pagesize & _" & KEYWORDS = "& keywords strurl = strurl &"? "& Strdata' creates an XMLHTTP object set XMLHTTP = server. createobject ("msxml2.xmlhttp") XMLHTTP. open "get", strurl, false XMLHTTP. send () 'send an http get request' when the returned HTTP status is 200, it indicates that the request data is successful if XMLHTTP. status = 200 then' create the domdocument object set xmldoc = server. createobject ("msxml2.domdocument") xmldoc. async = false xmldoc. load (XMLHTTP. responsexml) 'Load the XML if xmldoc returned by the server. parseerror. errorcode <> 0 then getmyiclistforhtml = "error message:" & xmldoc. parseerror. reason exit function else 'response. write xmldoc. XML if xmldoc.doc umentelement. childnodes. length = 0 then strresult = "no record" else strresult=xmldoc.doc umentelement. childnodes. item (0 ). text end if 'when the returned HTTP status is not 200, else getmyiclistforhtml = "the following error message is returned by the server, which may be caused by incorrect strdata:
HTTP status: "& XMLHTTP. Status &"
HTTP status text: "& XMLHTTP. statustext &"
"Exit function end if err. Number <> 0 then getmyiclistforhtml =" error message: "& err. Description err. Clear () else getmyiclistforhtml = strresult end if end Function