6deabc6be5
- modificata finestra Copia Multipla
60 lines
2.2 KiB
VB.net
60 lines
2.2 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
|
|
Public 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
|
|
Return GetPrivateProfileLanguage(lpAppName, lpKeyName, m_sPath)
|
|
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
|