|
|
Function getCharCodeStr( charCode )
if Not isNumeric(charCode) then Exit Function
aryChar = Array("SJIS", "JIS", "EUC", "UNICODE", "UTF-8", "UTF-7", "UNICODE-BE")
getCharCodeStr = aryChar( charCode )
End Function
' Class 定義
Class clsSakuraIni
Dim aryLine
Private Sub Class_Initialize ' Initialize イベントを設定します。
Dim objFso
Dim iniFileName
Dim objFs
Set objFso = CreateObject("Scripting.FileSystemObject")
iniFileName = getSakuraIniFileName
Set objFs = objFso.OpenTextFile( iniFileName, 1 )
aryLine = Split( objFs.ReadAll, vbCrLf )
objFs.Close
Set objFs = Nothing
Set objFso = Nothing
End Sub
Private Sub Class_Terminate ' Terminate イベントを設定します。
' Do Nothing
End Sub
' ini ファイル名生成
Private Function getSakuraIniFileName()
Dim sakuraPath, pos, sRet
sakuraPath = ExpandParameter("$S")
pos = instrrev(sakuraPath, ".")
if pos <= 0 then
sRet = ""
Else
sRet = Mid(sakuraPath, 1, pos ) & "ini"
End If
getSakuraIniFileName = sRet
End Function
' ini ファイルの読み込み
Function getProfileString( strSection, strEntry)
Dim i, sRet
if UBound( aryLine ) > 0 then
' ini ファイルの解析
Dim bFound,sLine,aryEntity
sRet = "" 'Empty
bFound = False
For i = 0 to Ubound( aryLine )-1
if bFound then
if Left( aryLine( i ), 1 ) = "[" then Exit For
sLine = LTrim( aryLine( i ) )
if Left( sLine, Len(strEntry)) = strEntry then
aryEntity = Split( sLine, "=" )
if Trim(aryEntity(0)) = strEntry then
if Ubound( aryEntity ) = 1 then
sRet = Trim( aryEntity( 1 ) )
Exit For
end if
end if
end if
End if
if aryLine(i) = "[" & strSection & "]" then
bFound = True
end if
Next
Else
sRet = ""
End If
getProfileString = sRet
End Function
End Class
|
|
まくろ初心者 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1) Sleipnir/2.49 |
|