谷歌翻译VB 2010 [英] Google translate VB 2010

查看:90
本文介绍了谷歌翻译VB 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

'我在vb中并不完美'

我开始了一个项目,为此我想将文本框中的文本翻译成另一种语言(想要更改文本框字体的僧伽罗语正确显示。

我在互联网上尝试了很多示例代码,但是出现了错误,我使用的是VB 2010.

我试过的其中一个代码如下。

Plz帮助我解决问题或让任何其他代码正常使用vb2010 ...

如果需要任何文件下载,请务必提供链接..



我收到错误 -

连接谷歌时出错... system.net.webexception远程名称不能是已解决'ajax.google.getreson'.............



谢谢!



我的尝试:



'I am not perfect in vb'
I started a project and for that I want to translate text in a text box to another language (Sinhala which wants to change the font of the text box to display properly).
I tried many example codes in the internet but got errors, I use VB 2010.
One of the codes I tried is below.
Plz help me to solve the problem or give any other codes work with vb2010 properly...
Plz be sure to give the link if require any file to download..

Error I got -
error while connecting to google... system.net.webexception the remote name could not be resolved 'ajax.google.getreson'.............

Thank you!

What I have tried:

Sub Translate()
       Try
           chooseLanguage()
           sourcestring = Me.TextBox1.Text

           translatedstring = GoogleTranslator.TranslateAndDetect(sourcestring, ISO_language, "")

       Catch ex As Exception

           MessageBox.Show("Error while Connecting to Google..." & ex.ToString, "Google API Sample")
       End Try

       Me.TextBox2.Text = translatedstring
   End Sub

推荐答案

试试这个CodeProject示例: Google Translator [ ^ ]

或者尝试新的Google API:翻译API客户端库 [ ^ ]
Try this CodeProject example: Google Translator[^]
Or try the new Google API: Translation API Client Libraries[^]


这篇关于谷歌翻译VB 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆