书接上文
te:=ini("C:\Users\YZ\Desktop\usercmd1.ini")
a:={}
hlog()
a:=te.SetKeyVal("em_OpenWithNotepad","button","test")
te.save()
hdbug(a)
简单写入值的,注意保存
comment部分其实就是给ini加上标准注释
比如这样
添加注释
te:=ini("C:\Users\YZ\Desktop\usercmd1.ini")
a:={}
hlog()
a:=te.AddComment("em_OpenWithNotepad","button","test")
te.save()
hdbug(a)
查询key的注释
te:=ini("C:\Users\YZ\Desktop\usercmd1.ini")
a:={}
hlog()
a:=te.GetCommentContent("em_OpenWithNotepad","button")
te.save()
hdbug(a)
查询sec的注释
te:=ini("C:\Users\YZ\Desktop\usercmd1.ini")
a:={}
hlog()
a:=te.GetSectionComments("em_OpenWithNotepad")
te.save()
hdbug(a)
添加顶部注释
te:=ini("C:\Users\YZ\Desktop\usercmd1.ini")
a:={}
hlog()
a:=te.AddTopComment("em_OpenWithNotepad")
te.save()
hdbug(a)
获取顶部注释
te:=ini("C:\Users\YZ\Desktop\usercmd1.ini")
a:={}
hlog()
a:=te.GetTopComments()
te.save()
hdbug(a)
给sec添加注释
te:=ini("C:\Users\YZ\Desktop\usercmd1.ini")
a:={}
hlog()
a:=te.AddSectionComment("em_OpenWithNotepad","hah")
te.save()
hdbug(a)
删除注释
根据你想要删除的位置留空参数,具体留空的位置参考
DeleteComment(sec=””, key=””, comment=””, topComment=false, ByRef rsError=””)
te:=ini("C:\Users\YZ\Desktop\usercmd1.ini")
a:={}
hlog()
a:=te.DeleteComment("em_OpenWithNotepad","hah")
te.save()
hdbug(a)
DeleteTopComment
删除top注释