/
AstroJohn
/
MailRobot
Обзор
Документация
Войти
/
AstroJohn
/
MailRobot
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Parser/IniReader/Constants.vb
54 строки
2 KB
AstroJohn
1st commit
11 сен 2024, 13:31
11 сен 2024, 13:31
0f57dc5
Код
Авторство
О чём код?
Imports System.Collections.Generic Imports Microsoft.Win32 Public Class Constants Public Shared ReadOnly RegistryKeyPath As String = "Software\RK1AA Software\Mail Robot" Public Shared ReadOnly XMLConfigFileName_RegistryValueName As String = "XMLConfigFileName" Public Shared ReadOnly Period_RegistryValueName As String = "Period" Public Shared ReadOnly Recalc_RegistryValueName As String = "Recalc" Public Shared ReadOnly ConfigFolderName As String = "Config" Public Shared ReadOnly UsageToolTip As String = "Usage: installutil /i /config=<XML Config file path (or paths delimited with ';'> /period=<Mail checking period in minutes (1-30)> /recalc=<Crosschecking period in minutes (5-600)> MailRobotService.exe" Public Shared Function GetRegistryKeyPath() As String Return "Software\" + My.Application.Info.CompanyName + "\" + My.Application.Info.ProductName End Function Public Shared Function GetCfgFiles() As IEnumerable(Of String) Dim regKey As RegistryKey Dim fileCollection As New List(Of String) regKey = Registry.LocalMachine.OpenSubKey(RegistryKeyPath, True) If Not (regKey Is Nothing) Then Dim i As Integer = 0 Do i = i + 1 Dim filePath As String If i = 1 Then filePath = regKey.GetValue(XMLConfigFileName_RegistryValueName).ToString() Else filePath = regKey.GetValue(XMLConfigFileName_RegistryValueName + (i - 1).ToString).ToString() End If If filePath <> String.Empty Then fileCollection.Add(filePath) End If Loop Until Not regKey.GetValueNames.Contains(XMLConfigFileName_RegistryValueName + i.ToString) End If regKey.Close() Return fileCollection End Function End Class