using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
namespace Sözlük
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
webBrowser1.Navigate("https://translate.google.com.tr/#tr/en/");
webBrowser1.ScriptErrorsSuppressed = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
webBrowser1.Document.GetElementById("source").InnerText = textBox1.Text;
timer1.Start();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
webBrowser1.Document.GetElementById("gt-swap").InvokeMember("click");
if (label1.Text == "Türkçe")
{
label1.Text = "İngilizce";
label2.Text = "Türkçe";
}
else if (label1.Text == "İngilizce")
{
label1.Text = "Türkçe";
label2.Text = "İngilizce";
}
webBrowser1.Document.GetElementById("source").InnerText = textBox1.Text;
}
catch
{ }
}
private void timer1_Tick(object sender, EventArgs e)
{
try
{
textBox2.Text = webBrowser1.Document.GetElementById("result_box").InnerText;
}
catch
{ }
}
private void button3_Click(object sender, EventArgs e)
{
try
{
webBrowser1.Document.GetElementById("gt-src-roman").InvokeMember("click");
}
catch
{ }
}
private void button2_Click(object sender, EventArgs e)
{
try
{
webBrowser1.Document.GetElementById("gt-src-listen").InvokeMember("click");
}
catch
{ }
}
private void button3_Click_1(object sender, EventArgs e)
{
try
{
webBrowser1.Document.GetElementById("gt-res-listen").InvokeMember("click");
}
catch
{ }
}
}
}
0 yorum:
Yorum Gönder