Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.IO;
  11.  
  12. namespace WindowsFormsApp2
  13. {
  14. public partial class Form1 : Form
  15. {
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. }
  20.  
  21. public void textBox1_TextChanged(object sender, EventArgs e)
  22. {
  23.  
  24. }
  25.  
  26. public void button1_Click(object sender, EventArgs e)
  27. {
  28. string line;
  29. string file = "szotar.txt";
  30. StreamReader read = new StreamReader(file);
  31. textBox1.Text = read.ReadLine();
  32. line = read.ReadLine();
  33.  
  34. while (line != null)
  35. {
  36. if (line == Text)
  37. {
  38. MessageBox.Show("A szó helyes!");
  39. break;
  40. }
  41. else
  42. {
  43. line = read.ReadLine();
  44. }
  45.  
  46. }
  47. if (line == null)
  48. {
  49. MessageBox.Show("A szó helytelen!");
  50. }
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement