- Регистрация
- 23.03.2013
- Сообщения
- 25
- Благодарностей
- 4
- Баллы
- 3
Обращаем Ваше внимание на то, что данный пользователь заблокирован.
Не рекомендуем проводить с huangxiangcai_old какие-либо сделки.
My Friends:
how to use the google translator in our zennoposter ?
We need you help.
i have make some c# code in following but unable to get a success result.
public static string GetGoogtextStr(string textstr, string language, string tolanguage)
{
WebClient web = new WebClient();
WebHeaderCollection headers = new WebHeaderCollection();
headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded; charset=utf-8";
headers[HttpRequestHeader.Referer] = "http://translate.google.cn/";
web.Headers = headers;
string text = textstr;
string url = string.Format("http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q={0}&langpair={1}|{2}", text, language, tolanguage);
byte[] bystr = web.DownloadData(url);
string urldata = GetText(System.Web.HttpUtility.UrlDecode(bystr, Encoding.UTF);
return urldata;
}
#####The Core API
http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q={0}&langpair={1}|{2}
{0) for source words want to translate
(1} for translate type like from chinese to english is: zh_en
{2) for translaltor result ,save to some varabile
Hope someone who success in google translator can give me a good code for zennposter.
Very appreciated.
Best wishes
how to use the google translator in our zennoposter ?
We need you help.
i have make some c# code in following but unable to get a success result.
public static string GetGoogtextStr(string textstr, string language, string tolanguage)
{
WebClient web = new WebClient();
WebHeaderCollection headers = new WebHeaderCollection();
headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded; charset=utf-8";
headers[HttpRequestHeader.Referer] = "http://translate.google.cn/";
web.Headers = headers;
string text = textstr;
string url = string.Format("http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q={0}&langpair={1}|{2}", text, language, tolanguage);
byte[] bystr = web.DownloadData(url);
string urldata = GetText(System.Web.HttpUtility.UrlDecode(bystr, Encoding.UTF);
return urldata;
}
#####The Core API
http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q={0}&langpair={1}|{2}
{0) for source words want to translate
(1} for translate type like from chinese to english is: zh_en
{2) for translaltor result ,save to some varabile
Hope someone who success in google translator can give me a good code for zennposter.
Very appreciated.
Best wishes