예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            TextFileName = localFilePath;
            string allLine = null;

            if (!File.Exists(TextFileName))               // 首先判断,文件是否已经存在
            {
                MessageBox.Show(TextFileName + "文件不存在!"); // 如果文件不存在,那么提示无法读取!
                return;
            }
            allLine       = ShpFunction.ShowString(TextFileName);
            textBox1.Text = allLine;
        }
예제 #2
0
        private void ReadFileBtn_Click(object sender, EventArgs e)
        {
            TextFileName = textBox2.Text.Trim();
            string allLine = null;

            if (!File.Exists(TextFileName))
            {
                MessageBox.Show(TextFileName + "文件不存在!");// 如果文件不存在,那么提示无法读取!
                return;
            }
            allLine      = ShpFunction.ShowString(TextFileName);
            ShowTxt.Text = allLine;
        }