1: using System;
2: using System.Windows.Forms;
3: using System.IO;
4:
5: namespace WindowsFormsApplication1
6: { 7: public partial class Form1 : Form
8: { 9: public static string InvalidPath ="1:\\invlid_path.txt";
10:
11: public Form1()
12: { 13: InitializeComponent();
14: }
15:
16: private void Form1_Load(object sender, EventArgs e)
17: { 18: MessageBox.Show("Form1_Load 1"); 19: string s = File.ReadAllText(InvalidPath);
20: MessageBox.Show("Form1_Load 2"); 21: }
22:
23: private void button1_Click(object sender, EventArgs e)
24: { 25: string s = File.ReadAllText(InvalidPath);
26: }
27: }
28: }
沒有留言:
張貼留言