手机
当前位置:查字典教程网 >编程开发 >vb >VB打开与保存txt文件的方法
VB打开与保存txt文件的方法
摘要:本文实例讲述了VB打开与保存txt文件的方法。分享给大家供大家参考。具体如下:PrivateSubcmdsave_Click()Dimfil...

本文实例讲述了VB打开与保存txt文件的方法。分享给大家供大家参考。具体如下:

Private Sub cmdsave_Click() Dim filelocation As String ' loads save as box commondialog1.ShowSave filelocation = commondialog1.FileName ' append saves over file if it assists Open filelocation For Append As #1 Print #1, text1.text Close #1 End Sub Private Sub cmdopen_Click() Dim filelocation As String ' show open box commondialog1.ShowOpen filelocation = commondialog1.FileName ' input files into text1.text Open filelocation For Input As #1 Do Until EOF(1) Input #1, Data text1.text = text1.text + Data + vbNewLine EOF (1) Loop Close #1 End Sub

希望本文所述对大家的VB程序设计有所帮助。

【VB打开与保存txt文件的方法】相关文章:

VB使用XMLHTTP实现Post与Get的方法

VB编程基础课教程

关于MSCOMM控件的一些说明第1/2页

VB使用ADO操作Access数据库

VB的32位程序在64位系统中出现文件和注册表自动转向的解决方法

VB实现屏蔽文本框右键菜单的复制、粘贴等功能的方法

Basic求10000以内的完美数

VB实现鼠标绘图实例代码

VB调用Word拼写检查功能实例

VB实现的倒计时类代码详解

精品推荐
分类导航