最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp实现英语在线翻译
时间:2022-07-02 23:15:25 编辑:袖梨 来源:一聚教程网
YPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.***w3.org/TR/REC-html40/loose.dtd">
'on error resume next
' 如果网速很慢的话,可以调整以下时间。单位秒
Server.ScriptTimeout = 999999
'========================================================
'字符编码函数
'========================================================
Function BytesToBstr(body,code)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset =code
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
'取行字符串在另一字符串中的出现位置
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring End Function
'替换字符串函数
function ReplaceStr(ori,str1,str2)
ReplaceStr=replace(ori,str1,str2)
end function
'=====================================================
function ReadXml(url,code,start,ends)
set oSend=createobject("Microsoft.XMLHTTP")
SourceCode = oSend.open ("GET",url,false)
oSend.send()
ReadXml=BytesToBstr(oSend.responseBody,code )
if(start="" or ends="") then
else
start=Newstring(ReadXml,start)
ReadXml=mid(ReadXml,start)
ends=Newstring(ReadXml,ends)
ReadXml=left(ReadXml,ends-1)
end if
end function
dim urlpage,lan
urlpage=request("urls")
lan=request("lan")
%>
dim transURL
transURL="http://216.239.*3**9.104/translate_c?hl=zh-CN&ie=UTF-8&oe=UTF-8&langpair="&server.URLEncode(lan)&"&u="&urlpage&"&prev=/language_tools"
if(len(urlpage)>3) then
getcont=ReadXml(transURL,"gb2312","","")
response.Write(getcont)
end if
%>
相关文章
- 原神隐藏成就无声指令怎么解锁 无声指令成就攻略 09-16
- 超级机器人大战Y斯威特强袭怎么过 高机动歼灭战攻略 09-16
- 无主之地4支线宿醉解药怎么过 宿醉解药支线图文攻略 09-16
- 超级机器人大战Y新世界宣言怎么过 最终决战关卡攻略 09-16
- 超级机器人大战Y生死之间怎么过 极限生存关卡攻略 09-16
- 三国望神州郭嘉怎么培养 郭嘉培养攻略 09-16