Recommended: ASP calls web services ASP calls web services % Function CallWebServices(sUrl, sMethodName, soapMessage, XmlString) CallWebServices = false Set xmlhttp = CreateObject(MSXML2.XMLHTTP) xmlhttp.Open POST,sUrl, False xmlhttp.SetRequestHeader Content-Type,text/xm
JavaScript conversion:
<SCRIPT>
/*
************************************
* Parameter description:
* str: The string to be converted
* flag: mark, 0 and half to full, non-0 and half to full
* Return value type: string
************************************
*/
function DBC2SBC(str,flag) {
var i;
var result='';
if (str.length<=0) {alert('Error in string parameter');return false;}
for(i=0;i<str.length;i++)
{ str1=str.charCodeAt(i);
if(str1<125&&!flag)
result+=String.fromCharCode(str.charCodeAt(i)+65248);
else
result+=String.fromCharCode(str.charCodeAt(i)-65248);
}
return result;
}
</script>
//Example:
<script>
alert(DBC2SBC(AAabc,0));
document.write(DBC2SBC(abcdefg,0))
</script>
Asp conversion:
<%
'*********************************
'* Parameter description:
'* str: The string to be converted
'* flag: mark, it is 0 and half to turn all, and it is non-0 and half to turn all
'* Return value type: string
'*********************************
function DBC2SBC(str,flag)
dim i
if len(str)<=0 then
msgbox 'Error in string parameter'
exit function
end if
for i=1 to len(str)
str1=asc(mid(str,i,1))
if str1>0 and str1<=125 and not flag then
dbc2sbc=dbc2sbc&chr(asc(mid(str,i,1))-23680)
else
dbc2sbc=dbc2sbc&chr(asc(mid(str,i,1))+23680)
end if
next
end function
%>
Share: 6 practical codes for asp to control the XML database NO.1--Create an XML database data.xm ?xml version=1.0? records record namecaca/name qq154222225/qq [email protected]/email /record records NO.2-Create object CreateObject Create data.xml object First set xmldoc=server.createobjcet(microsoft.xmldom) xmld