Files
effector.plugin.fivelakes/Supervisor.Plugin.FiveLakes/Utility/IniFile.vb
T
Emmanuele Sassi d1afc92d94 - creazione dictionary
- creazione lista porte
2024-07-31 19:44:01 +02:00

66 lines
2.4 KiB
VB.net

'----------------------------------------------------------------------------
' EgalTech 2017-2017
'----------------------------------------------------------------------------
' File : IniFile.vb Data : 08.05.24 Versione : 2.6e1
' Contenuto : Modulo IniFile per gestione lettura/scrittura da file INI.
'
'
'
' Modifiche : 08.05.24 ES Creazione modulo.
'
'
'----------------------------------------------------------------------------
Imports System.Collections.ObjectModel
Public Module IniFile
Private m_sPath As String
Public ReadOnly Property sPath As String
Get
Return m_sPath
End Get
End Property
Friend Sub SetIniFile(sPath)
m_sPath = sPath
End Sub
Public Function GetMainPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer
Return GetPrivateProfileInt(IpAppName, IpKeyName, nDefault, m_sPath)
End Function
Public Function GetMainPrivateProfileDouble(IpAppName As String, IpKeyName As String, dDefault As Double) As Double
Return GetPrivateProfileDouble(IpAppName, IpKeyName, dDefault, m_sPath)
End Function
Public Function GetMainPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
Return GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sPath)
End Function
'Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
' Dim sVal As String = String.Empty
' GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
' Dim sItems() As String = sVal.Split(",".ToCharArray)
' If sItems.Count() = 2 Then
' Return New Language(sItems(0), sItems(1))
' End If
' Return Nothing
'End Function
'Public Function GetMainPrivateProfileLanguage(lpAppName As String, lpKeyName As String) As Language
' Dim sVal As String = String.Empty
' GetMainPrivateProfileString(lpAppName, lpKeyName, "", sVal)
' Dim sItems() As String = sVal.Split(",".ToCharArray)
' If sItems.Count() = 2 Then
' Return New Language(sItems(0), sItems(1))
' End If
' Return Nothing
'End Function
Public Function WriteMainPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
Return WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sPath)
End Function
End Module