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.Windows.Forms;
- using System.IO;
- namespace Kadai02
- {
- public partial class FrmMeiboToroku : Form
- {
- private const string MEIBOFILE = @"Z:\WinPro\Lesson04\名簿.txt";
- public FrmMeiboToroku()
- {
- InitializeComponent();
- }
- private void btnSelect_Click(object sender, EventArgs e)
- {
- FrmKen form = new FrmKen();
- form.ShowDialog();
- txtJusyo.Text = form.kenmei;
- }
- private void btnToroku_Click(object sender, EventArgs e)
- {
- string line = "";
- if (txtName.Text != "" && txtJusyo.Text != "")
- {
- line = txtName.Text + ",";
- if (rdoMan.Checked)
- {
- line += "男";
- }
- else
- {
- line += "女";
- }
- StreamWriter wr = new StreamWriter(MEIBOFILE, true);
- wr.WriteLine(line + "," + txtJusyo.Text);
- wr.Close();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement