Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 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.Windows.Forms;
  9. using System.IO;
  10.  
  11. namespace Kadai02
  12. {
  13. public partial class FrmKen : Form
  14. {
  15. private const string ADDRESFILE = @"Z:\WinPro\Lesson04\都道府県.txt";
  16. public string kenmei;
  17.  
  18. public FrmKen()
  19. {
  20. InitializeComponent();
  21. }
  22.  
  23. private void FrmKen_Load(object sender, EventArgs e)
  24. {
  25. StreamReader sr = new StreamReader(ADDRESFILE);
  26.  
  27. string line;
  28.  
  29. while ((line = sr.ReadLine()) != null)
  30. {
  31. lstKen.Items.Add(line);
  32. }
  33. sr.Close();
  34. }
  35.  
  36. private void btnKettei_Click(object sender, EventArgs e)
  37. {
  38. FrmMeiboToroku form1 = new FrmMeiboToroku();
  39. kenmei = lstKen.Text;
  40.  
  41. this.Close();
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement