ASP利用Google实现在线翻译功能-ASP技术-3P代码网
繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP基础 >> ASP利用Google实现在线翻译功能

ASP利用Google实现在线翻译功能

2006-04-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:在线翻译 translate.ASP实现翻译功能,这是利用google的语言工具实现的。 注意,因为提供多语言支持,所以translate.ASP文件所用的编码是支持所有字符的"utf-8"

在线翻译

<%

'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

3) then

getcont=ReadXml(transURL,"gb2312","","")

response.Write(getcont)

end if

%>

translate.ASP实现翻译功能,这是利用google的语言工具实现的。

注意,因为提供多语言支持,所以translate.ASP文件所用的编码是支持所有字符的"utf-8"

责任编辑:admin
相关文章