protected void Button1_Click(object
sender, EventArgs e)
{
// using Google
Translate
string
Fromlang = "en";
string Tolang = "gu";
string url = @"http://translate.google.com/translate_a/t?client=t&text="
+ txtFrom.Text +
"&hl=en&sl="+Fromlang+"&tl="+Tolang+"&ie=UTF-8&oe=UTF-
8&multires=1&otf=1&ssel=3&tsel=3&sc=1";
"&hl=en&sl="+Fromlang+"&tl="+Tolang+"&ie=UTF-8&oe=UTF-
8&multires=1&otf=1&ssel=3&tsel=3&sc=1";
WebRequest client = WebRequest.Create(url);
WebResponse resp = client.GetResponse();
Stream strm = resp.GetResponseStream();
StreamReader sr = new
StreamReader(strm);
string strResp = sr.ReadToEnd();
dvTo.InnerHtml
= strResp.Split(']')[0].Split(',')[0].Replace('[',
' ').Replace('"',' ');
}
<div>
<asp:TextBox ID="txtFrom"
runat="server"
TextMode="MultiLine"
Height="88px"
Width="235px"></asp:TextBox>
<br />
<asp:Button ID="Button1"
runat="server"
Text="Button"
OnClick="Button1_Click"
/>
<div id="dvTo" runat="server"
> </div>
</div>
1 comment:
GsmZybWgtCzu [url=http://www.adidasyasuyijp.com/]アディダス[/url]RaiXcqPbqVth [url=http://www.adidasyasuyijp.com/jeremy-scott-c-14.html]アディダス スニーカー[/url]ZabUcxFdaWdo [url=http://www.adidasyasuyijp.com/アディダス-スタンスミス-c-13.html]アディダス シューズ[/url]PpyHpbGexEiw [url=http://www.adidasyasuyijp.com/サッカー-c-8.html]アディダス ランニング[/url]
Post a Comment