请给一些VB中对文件进行操作的相关信息!!!谢了

jeapvan 2006-04-27 06:43:41
我现在想从一个自己定义的INI文件中读取其中的内容,内容就是一个电话号吗?请问应该如何操作呢???我是新接触VB不知道其中的一些语句,请各位大师指点!!!
...全文
99 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
randomx 2006-04-28
  • 打赏
  • 举报
回复
open app.path & "你的文件名.ini" for input as #read
input #read , phone
close #read
就这么简单吧?
deallylau 2006-04-28
  • 打赏
  • 举报
回复
Public Declare Function GetPrivateProfileString Lib "Kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Public Declare Function WritePrivateProfileString Lib "Kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As Any, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFilename As String) As Long


读:
HValue = String$(20, " ")
GetPrivateProfileString "YearFormula", vskey, "", HValue, Len(HValue), App.Path & "\YearFormula.Ini"
写:
HValue = "0"
WritePrivateProfileString "YearFormula", vskey, "0", App.Path & "\YearFormula.Ini"
cbzdream 2006-04-28
  • 打赏
  • 举报
回复
www.baidu.com 搜索vb ini文件.有一堆

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧