Attribute VB_Name = "fun_sub"
Option Explicit


Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpRetunedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFileName As String) As Long
Private Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long

Public s_cn As String
Public cn_ok As Boolean
Public s_sql As String
Public s_all As String
Public s_qt1 As String
Public s_qt2 As String
'* 主要功能: 读写INI文件
'************************************************************

Function rs_ini(AppName As String, KeyName As String, FileName As String) As String
   Dim RetStr As String
   RetStr = String(255, Chr(0))
   rs_ini = Left(RetStr, GetPrivateProfileString(AppName, ByVal KeyName, "-1", RetStr, Len(RetStr), FileName))
End Function
Function w_ini(AppName As String, KeyName As String, Str As String, FileName As String) As String
Dim r
    r = WritePrivateProfileString(AppName, KeyName, Str, FileName)
    If r <> 1 Then MsgBox "写出错！"

End Function




