全文预览

连接两个文件中的数据

上传者:非学无以广才 |  格式:doc  |  页数:14 |  大小:0KB

文档介绍
为”文件(1)“打开”程序段如下: Private mand1_Click() CommonDialog1.Action =1'打开“打开”对话框 Text1.Text = "" monDialog1.FileName For Input As #1' 打开文件进行读取操作 Do While Not EOF(1) Line Input #1, inputdata ' 读一行数据 Text1.Text = Text1.Text + inputdata + vbCrLf Loop Close #1' 关闭文件 End Sub (2)“另存为” Private mand2_Click() CommonDialog1.FileName = "default.txt" ' monDialog1.DefaultExt = "txt" ' monDialog1.Action =2'打开“另存为”对话框 monDialog1.FileName For Output As #1' 打开文件供写入数据 Print #1, Text1.Text Close #1 End Sub 3 窗体及代码 F orm1 :启动窗体说明程序用途及一定的观赏性。代码如下: Private mand1_Click() Form1.Hide '隐含 form1 窗体 Form2.Show '显示 form2 窗体 End Sub F orm2: 程序运行后的总菜单。 F orm3: 创建文件的主窗体,可浏览,另存为,删除文件。 F orm4: 文件连接后的显示窗口,可删除,另存为和打印文件。 F orm5: 文件连接后出现的提示框,提示文件连接成功。代码如下: Private mand1_Click() Form5.Hide Form2.Show End Sub 总结这次课设我的题目是连接两个文件中的数据, 通过这

收藏

分享

举报
下载此文档