Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Threading;
- using System.IO;
- namespace FormsApp_01
- {
- public partial class Student : Form
- {
- public Student()
- {
- InitializeComponent();
- }
- private void btnOK_Click(object sender, EventArgs e)
- {
- string path = "D:\\Skola\\NOP\\Forms\\Ucenik.txt";
- if (!string.IsNullOrEmpty(textBox1.Text) && !string.IsNullOrEmpty(textBox2.Text) && !string.IsNullOrEmpty(comboBox1.Text))
- {
- using (StreamWriter sw = new StreamWriter(path))
- {
- sw.WriteLine(textBox1.Text);
- sw.WriteLine(textBox2.Text);
- sw.WriteLine(comboBox1.Text);
- textBox1.Clear();
- textBox2.Clear();
- comboBox1.ResetText();
- }
- }
- else
- {
- MessageBox.Show("Greška, popunite polja!");
- }
- }
- private void Student_Load(object sender, EventArgs e)
- {
- txtDateTime.Text = DateTime.Now.ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement