static void Main(string[] args) { string fileAddress = System.Console.ReadLine(); string text = System.IO.File.ReadAllText(fileAddress, Encoding.GetEncoding("windows-1254")); System.Console.WriteLine("Dosya alındı. Kelimeler alınıyor."); string[] words = text.Split(','); System.Console.WriteLine(words.Length + " kelime alındı. Anlamlar sorgulanıyor."); StringBuilder str = new StringBuilder(); foreach (string word in words) { _business = new Bus(new TdkGts { Word = word }); str.Append(_business.GetDescriptionsAsText()); str.AppendLine(); str.AppendLine(); System.Console.Write('.'); } System.Console.WriteLine("Sorgulama tamamlandı. Dosyaya yazılıyor."); string descriptionFile = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + @"\Description.txt"; // Write the string array to a new file named "WriteLines.txt". using (StreamWriter outputFile = new StreamWriter(descriptionFile)) { outputFile.Write(str); } Process.Start(descriptionFile); }
private void btnSearch_Click(object sender, EventArgs e) { _business = new Bus(new TdkGts { Word = txtWord.Text }); Search(); }
private void btnSearch_Click(object sender, EventArgs e) { if (!_isProsessing && txtWord.Text != "") { _isProsessing = true; _business = new Bus(new TdkGts { Word = txtWord.Text }); Thread thread = new Thread(Search) { IsBackground = true }; thread.Start(); } }