本文介绍了Bing Translator问题:ArgumentOutOfRangeException:'from'必须是有效的语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我是Bing Translator开发人员的初学者。我刚刚注册了Windows Azure Marketplace并获得了客户ID。我整天尝试在VB2010中编码,但它失败了。我解决了一些问题,直到最后一个我不知道要解决它。期待
谁对此有所帮助。错误是  ArgumentOutOfRangeException:'from'必须是有效语言


参数名称:from:ID = 3817.V2_Soap.Translate.106AF0DA
(详细错误如下所示。)


我想将英语翻译成泰语。请帮助我,谢谢。非常感谢你提前。

'代码片段
Dim strTranslatedText As String = Nothing
尝试
Dim client As New TranslatorService.LanguageServiceClient()
client = New TranslatorService.LanguageServiceClient()
strTranslatedText = client.Translate(" my_client_ID",txtTranslateFrom.Text,txtTranslateFrom.Text,txtTranslatedText.Text," en" ,"en")

txtTranslatedText.Text = strTranslatedText
Catch ex As Exception
MsgBox(ex.Message)
结束尝试

'代码段在app.config中
< client>

< endpoint address =" http://api.microsofttranslator.com/V2/soap.svc"
binding =" basicHttpBinding" bindingConfiguration = QUOT; BasicHttpBinding_LanguageService2"
contract =" TranslatorService.LanguageService"名称= QUOT; BasicHttpBinding_LanguageService1" />
< / client>




解决方案

Hello,

I am a beginner in Bing Translator developer. I’ve just signed up Windows Azure Marketplace and got the customer ID. I tried coding in VB2010 in all day but it’s failed. After I solved some problems until the last one which I had no idea to solve it. Expecting who is kindly helps me for this. The error is  ArgumentOutOfRangeException: 'from' must be a valid language

Parameter name: from : ID=3817.V2_Soap.Translate.106AF0DA( The detailed error is shown below.)

I’d like to translate English language to Thai language. Please help me for this is appreciated. Thank you very much in advance.

'Code Snippet
        Dim strTranslatedText As String = Nothing
        Try
            Dim client As New TranslatorService.LanguageServiceClient()
            client = New TranslatorService.LanguageServiceClient()
            strTranslatedText = client.Translate("my_client_ID", txtTranslateFrom.Text, txtTranslateFrom.Text, txtTranslatedText.Text, "en", "en")

            txtTranslatedText.Text = strTranslatedText
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

'Code snippet In app.config
        <client>

            <endpoint address="http://api.microsofttranslator.com/V2/soap.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_LanguageService2"
                contract="TranslatorService.LanguageService" name="BasicHttpBinding_LanguageService1" />
        </client>


解决方案


这篇关于Bing Translator问题:ArgumentOutOfRangeException:'from'必须是有效的语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 06:14