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 Kadai01
- {
- public partial class FrmKakunin : Form
- {
- public string str1;
- public string str2;
- private const string ADDRESFILE = (@"Z:\WinPro\Lesson04\kadai01.txt");
- public FrmKakunin()
- {
- InitializeComponent();
- }
- private void FrmKakunin_Load(object sender, EventArgs e)
- {
- txtGakusekiNo.Text = str1;
- txtName.Text = str2;
- }
- private void btnToroku_Click(object sender, EventArgs e)
- {
- if (str1 != "" && str2 != "")
- {
- string line = "";
- line += str1 + ",";
- StreamWriter sw = new StreamWriter(ADDRESFILE);
- sw.WriteLine(line + str2);
- sw.Close();
- DialogResult = DialogResult.OK;
- }
- }
- private void btnCancel_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement