Microsoft online translation API trial

Source: Internet
Author: User

Google Translate API has always been used for online translation. However, as we all know later, Google's services are getting slower and slower due to related policies and legal reasons, I had to find a faster online translation interface. Later I found Microsoft translate and thought it was very useful. I used the soap method as an example and hoped to give some reference to the friends who had the same requirements, old birds don't need to watch it. There's no technical content.

First, register an application in the Bing Developer Center and obtain an appid ~, The registration address is as follows: http://cn.bing.com/?s=

 

As shown in, click "Developer", click "add", enter the basic information, wait for a moment, refresh the page, you will see an Application ID, and write it down for backup.

 

Then go to the msdn document

Http://msdn.microsoft.com/en-us/library/dd576287.aspx

Based on the documentCodeI will use soap as an example to write a simple translation.Program.

 

Create an application in vs2010 (either desktop or console or website ),

Right-click the application and click"Add service reference", Enter

Http://api.microsofttranslator.com/V2/Soap.svc

Click "go" and click "service" to view related operations and methods.

Enter a namespace, such as servicereference1.

Click OK, as shown in:

 

Then add two RichTextBox in the form, add a button, and write

 1   String Result;
2 Servicereference1.languageserviceclient client = New Servicereference1.20.ageserviceclient ();
3 Result = client. Translate ( " The previously applied appid " , Richtextbox1.text, " En " , " Zh-CHS " , " Text/html " , " General " );
4 Richtextbox2.text = result;

 

Click Run. In richtextbox1, enter the English language to be translated. click the button and the translation is successful.

PS: Soap does not seem to have 1000-byte translation length restrictions. HTTP and Ajax methods have length restrictions.

 

For the translation accuracy, I think Microsoft's translation interface is still quite powerful, especially in terms of technical translation, which is quite powerful and fast. We recommend that you use it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.