网页翻译 [英] Web page translation
问题描述
大家好,
我想将整个网页从一种语言翻译成另一种语言,例如Google翻译.
有人知道我该怎么办吗?
[提前感谢]
谢谢达莱克·戴夫先生.对我有用.
但是在我的代码中,我必须使用Google Translator API处理翻译操作.我必须使用WebClient类阅读Web文本.当我翻译整个页面时,那时候抛出一些GoogleApiException.我不知道原因.
这是我的编码
WebClient wc =新的WebClient();
字符串代码= wc.DownloadString(&"http://www.google.com& quot;);;
试试
{
Console.WriteLine(Translator.Translate(代码,Language.English,
Language.French,TranslateFormat.html));
}
捕获(GoogleAPIException e)
{
Console.WriteLine(e.ToString());
}
我知道原因回复我...
[提前感谢]
Hi to all,
I want to translate a whole web page from one language to another language, like google translator.
Anybody know how can I do it?
[Thanks in advance]
Thank you Mr.Dalek Dave. It useful to me.
But in my code i have to process translation operation using google translator api. I have to read a web text using WebClient class. When i translate those whole page, that time throw some GoogleApiException. I don''t know the reason.
This is my coding
WebClient wc = new WebClient();
string code = wc.DownloadString("http://www.google.com");
try
{
Console.WriteLine(Translator.Translate(code, Language.English,
Language.French, TranslateFormat.html));
}
catch (GoogleAPIException e)
{
Console.WriteLine(e.ToString());
}
I anybody know the reason reply me...
[Thanks in advance]
推荐答案
hi,
你可以看到这个
http://www.codeproject.com/KB/IP/GoogleTranslator.aspx [ ^ ]
祝你好运
jerem
you can see this
http://www.codeproject.com/KB/IP/GoogleTranslator.aspx[^]
good luck
jerem
谢谢Dalek Dave先生.对我有用.
但是在我的代码中,我必须使用Google Translator API处理翻译操作.我必须使用WebClient类阅读Web文本.当我翻译整个页面时,那时候抛出一些GoogleApiException.我不知道原因.
这是我的编码
Thank you Mr.Dalek Dave. It useful to me.
But in my code i have to process translation operation using google translator api. I have to read a web text using WebClient class. When i translate those whole page, that time throw some GoogleApiException. I don''t know the reason.
This is my coding
WebClient wc = new WebClient();
string code = wc.DownloadString("http://www.google.com");
try
{
Console.WriteLine(Translator.Translate(code, Language.English,
Language.French, TranslateFormat.html));
}
catch (GoogleAPIException e)
{
Console.WriteLine(e.ToString());
}
我知道原因回复我...
[提前感谢]
I anybody know the reason reply me...
[Thanks in advance]
这篇关于网页翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!