rt,谢谢!
解决方案 »
- 我想在内存中绘图,为什么下面的代码没反应呢?
- delphi里面有没有既可以删除文件又可以删文件夹的通用函数?
- 怎样应用dbExpress组件而不使用DBNavigator向数据库中输入数据?
- 请问怎么用delphi将中文字转成UTF-8 在线。。
- 关于DELPHI用什么软件制作安装程序
- 各位熟悉fastreport的大师门帮一下忙
- 注册号算法!
- 关dll程序中可用的参数类型,可否用自定义类?可否用动态数组?可否申明成引用型(var)?另外可否在dll中操作文件?
- Delphi,关于类对象的赋值和数据交换问题,请教各位大侠:...
- 一个毫无技术含量的问题
- 如何实现在不同机器上的VB程序和DELPHI程序的实时交互?
- 在以下操作中分别可能产生哪些异常?
Private 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
Dim rtnValueA As VariantFunction WriteToIni(ByVal strFileName As String, ByVal strSectionName _
As String, ByVal strKeyName As String, ByVal strValue As String)
'将值写到INI文件中去
rtnValueA = WritePrivateProfileString(strSectionName, strKeyName, strValue, strFileName)
End Function
Function ReadFromIni(ByVal strFileName As String, ByVal strSectionName _
As String, ByVal strKeyName As String, ByVal strDefault As String)
Dim strOut As String * 255
'从INI文件中读取值
rtnValueA = GetPrivateProfileString(strSectionName, strKeyName, strDefault, strOut, 255, strFileName)
ReadFromIni = Trim(Replace(strOut, Chr(0), ""))
End Function
'---------------------------------------------------------------------------------
以上的两个函数,你自己用吧!
很简单的调用。
A a 1
B b 2
C c 3
比如:
[User]
UserName1=abc
Password1=abc
UserName2=cde
Password2=cde把USER作为一个表
把UserName Password作为字段
1 2 作为第N条记录在程序中操作数组一样操作不就好了?
读取INI用我给你的函数。
一点一点添加到LISTVIEW中。