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")
%>
<form method="post" action="translate.asp">
<input type="text" name="urls" size="150" value="<%=urlpage%>">
<input type="hidden" name="lan" value="<%=lan%>">
<input type="submit" value="submit">
</form>
<%
dim transURL
transURL="http://216.239.39.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
%>
</body>
</html>
translate.asp实现翻译功能,这是利用google的语言工具实现的。
注意,因为提供多语言支持,所以translate.asp文件所用的编码是支持所有字符的"utf-8"