方法'TranslateAsync'没有重载需要Bing Transaltor的4个参数
致力于Windows Phone 7的旧翻译示例代码。
最近,我从这里下载了LanguageServiceClient或翻译器Api
http://api.microsofttranslator.com/V2/Soap.svc在我的项目中。
我注意到TranslateAsync的方法有变化
使用这个旧方法在我的页面中调用此方法
_proxy.TranslateAsync(APP_ID, txtInput.Text, from.Code, to.Code);
这个抛出错误信息:
方法'TranslateAsync'没有重载需要4个参数
我在旧的示例代码中发现,它具有:
旧示例代码中存在旧签名:
public void TranslateAsync(string appId, string text, string from, string to) {
this.TranslateAsync(appId, text, from, to, null);
但是这个RECENT Translator api中的新签名是这样的:
public void TranslateAsync(string appId, string text, string from, string to, string contentType, string category) {
this.TranslateAsync(appId, text, from, to, contentType, category, null);
}
我如何使用这个新签名?什么是contentTye,类别?我在哪里可以获得这些信息或使用这些信息的示例代码?
请帮忙。谢谢
没有找到相关结果
已邀请:
2 个回复
广躺椽
方法的文档指示contentType参数用于指定所提供内容的格式,并接受值“text / plain”或“text / html”。如果指定HTML,则HTML必须格式正确。 category参数支持单个值:general。
讼乐