<%
'获得办事器生成的html代码
Function GetHTTPPage(url)
dim XmlHttp
set XmlHttp=Server.createobject("Microsoft.XMLHTTP")
XmlHttp.open "GET",url,false
XmlHttp.send()
'getHTTPPage=Http.responseText
if XmlHttp.readystate<>4 then exit function
GetHTTPPage=bytes2BSTR(XmlHttp.responseBody)
set XmlHttp=nothing
if err.number<>0 then err.Clear
End Function
Function Bytes2bStr(vin)
Dim BytesStream,StringReturn
Set BytesStream = Server.CreateObject("ADODB.Stream")
BytesStream.Type = 2
BytesStream.Open
BytesStream.WriteText vin
BytesStream.Position = 0
BytesStream.Charset = "GB2312"
BytesStream.Position = 2
StringReturn =BytesStream.ReadText
BytesStream.close
Set BytesStream = Nothing
Bytes2bStr = StringReturn
End Function
'转换函数中的页面分隔输入函数
sub splitwords(words)
into=words
out=""
'response.write "共有字数:"&len(into)&"<br>"
for i=1 to len(into) '轮回遍历每一个字符
'response.write "如今轮回"&i&"/"&len(into)&"次,并入手下手检拆字符"&mid(into,i,1)&"<br>"
if ascw(mid(into,i,1))<0 or ascw(mid(into,i,1))>255 then '假如是简体中文,进入检测阶段
code=instr(application("gb"),mid(into,i,1)) '获得此字符在简体字库中的地位
if code then'假如在简体字库中呈现
out=out&mid(application("other_language"),code,1) '输入在繁体字库中响应的繁体字
'response.write "如今输入繁体第"&i&"个字符:"&mid(application("other_language"),i,1)&"<br>"
else
out=out&mid(into,i,1) '原样输入
'response.write "如今输入简体第"&i&"个字符"&mid(into,i,1)&"<br>"
end if
else
out=out&mid(into,i,1) '原样输入
'response.write "如今输入简体第"&i&"个字符"&mid(into,i,1)&"<br>"
end if
next
response.write out
end sub