| 发表于:2008-01-10 09:32:28 楼主 |
代码如下: private declare function getprivateprofileint lib "kernel32" alias "getprivateprofileinta" ( _ byval lpapplicationname as string, _ byval lpkeyname as string, _ byval ndefault as string, _ byval lpfilename as string) as long private sub command1_click() open "c:\1.txt" for input as #1 dim lines as string dim nextline do until eof(1) on error resume next line input #1, nextline lines = lines + nextline & chr$(13) + chr$(10) loop close #1 dim t as string dim x as string t = space$(1000) x = getprivateprofilestring(lines, "name", "", t, 1000, app.path & "\abc.ini") text1 = left$(t, len(trim$(t)) - 1) x = getprivateprofilestring(lines, "email", "", t, 1000, app.path & "\abc.ini") text2 = left$(t, len(trim$(t)) - 1) end sub |
|
|
|
|