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.Windows.Forms;
- using System.IO;
- namespace OtotdikFeladat_kesz
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- int meret = 0;
- int[] homerseklet = new int[31];
- string[] ujhomerseklet = new string[40];
- string[] honapok = new string[] {"Január",
- "Február",
- "Március",
- "Április",
- "Május",
- "Június",
- "Július",
- "Augusztus",
- "Szeptember",
- "Október",
- "November",
- "December", };
- private void buttonOK_Click(object sender, EventArgs e)
- {
- if (comboBoxHonap.SelectedIndex == 0)
- {
- StreamReader f = File.OpenText("homerseklet.txt");
- StreamWriter fki = File.CreateText("fokok.txt");
- while (!f.EndOfStream)
- {
- homerseklet[meret] = Convert.ToInt32(f.ReadLine());
- meret++;
- }
- f.Close();
- for (int i = 0; i < meret; i++)
- {
- listBoxKi.Items.Add(homerseklet[i]);
- for (int j = 0; j < meret; j++)
- {
- ujhomerseklet[0] = honapok[0];
- ujhomerseklet[j + 1] = Convert.ToString(homerseklet[i]);
- for (int k = 0; k < ujhomerseklet.Length; k++)
- {
- fki.WriteLine(ujhomerseklet[k]);
- }
- }
- }
- }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- comboBoxHonap.SelectedIndex = 0;
- if (comboBoxHonap.SelectedIndex == 0)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 1)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 2)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 3)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 4)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 5)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 6)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 7)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 8)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 9)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 10)
- {
- buttonOK.Enabled = true;
- }
- else if (comboBoxHonap.SelectedIndex == 11)
- {
- buttonOK.Enabled = true;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment