예제 #1
0
 public string TranslateMicrosoft()
 {
     string url = "http://api.microsofttranslator.com/v2/ajax.svc/TranslateArray";
     JsArray src = new JsArray();
     src.Add(new JsAtom(sourceNew));
     string query = "from=%22ja%22&to=%22en%22&appId=%22" + UrlEncode("F84955C82256C25518548EE0C161B0BF87681F2F") + "%22&texts=" + UrlEncode(src.Serialize());
     HttpWebRequest req = CreateHTTPRequest(url + "?" + query);
     string ans = ReadAnswer(req);
     JsObject js = Json.Parse(ans);
     string result = js["0"]["TranslatedText"].ToString();
     return result;
 }