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.