当前位置:编程学习 > VB >>

关于VB如何直接读取节点下的项值?

已知GetPrivateProfileString和WritePrivateProfileString两个API.并能简单运用.
如果现有一个ini文件内容简要如下:

[sec1]
List=p1

[sec2]
QQ=1188552

现在已知ini文件有一项为"QQ",但不知道节点名称.请问怎么读取到QQ的项值?以及怎么读取到这个项所属的节点为"sec2"? --------------------编程问答-------------------- If lpAppName is NULL, GetPrivateProfileString copies all section names in the specified file to the supplied buffer. If lpKeyName is NULL, the function copies all key names in the specified section to the supplied buffer. An application can use this method to enumerate all of the sections and keys in a file. In either case, each string is followed by a null character and the final string is followed by a second null character. If the supplied destination buffer is too small to hold all the strings, the last string is truncated and followed by two null characters. --------------------编程问答--------------------
引用 1 楼 lactoferrin 的回复:
If lpAppName is NULL, GetPrivateProfileString copies all section names in the specified file to the supplied buffer. If lpKeyName is NULL, the function copies all key names in the specified section to……
老大.我程度没到你的境界.看不懂.. --------------------编程问答-------------------- 如果lpAppName 等于0,你可以得到所有节的名字
如果lpKeyName 等于0,你可以得到所有关键字的名字
补充:VB ,  API
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,