diff --git a/Effector.Main/MainWindow/MainWindowM.vb b/Effector.Main/MainWindow/MainWindowM.vb index ee59379..380634a 100644 --- a/Effector.Main/MainWindow/MainWindowM.vb +++ b/Effector.Main/MainWindow/MainWindowM.vb @@ -167,33 +167,6 @@ Public Class MainWindowM (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() & My.Application.Info.Version.Revision.ToString() EgtOutLog(sLogMsg) - ' Gestione della chiave di protezione - Dim sLicFileName As String = "" - GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName) - Dim sLicFile As String = sConfigDir & "\" & sLicFileName - Dim sKey As String = "" - GenInterface.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile) - EgtSetKey(sKey) - ' Recupero livello e opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(7375, 2706, 1, m_nKeyLevel) And - EgtGetKeyOptions(7375, 2706, 1, m_nKeyOpt1, m_nKeyOpt2) - - If Not bKey Then - EgtOutLog("Key or Licence Problem (" & (-nKeyLevel).ToString() & ")") - MessageBox.Show(String.Format(EgtMsg(201), (-nKeyLevel).ToString()), "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtOutLog("Exit") - End - End If - 'EgtInit(m_nDebug, m_sLogFile, sLogMsg) - 'EgtSetTempDir(m_sTempDir) - 'EgtSetIniFile(IniFile.m_sIniFile) - ' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione) - 'Dim sMsgDir As String = String.Empty - 'If GetMainPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then - ' sMsgDir = m_sConfigDir - 'End If - '' Inizializzo OptionModule - ''OptionModule.InitOptionModule() ' Leggo lingua corrente Dim sLanguage As String = String.Empty GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sLanguage) @@ -244,6 +217,33 @@ Public Class MainWindowM If Not EgtLoadMessages(sMsgFilePath) Then EgtOutLog("Error in EgtLoadMessages") End If + ' Gestione della chiave di protezione + Dim sLicFileName As String = "" + GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName) + Dim sLicFile As String = sConfigDir & "\" & sLicFileName + Dim sKey As String = "" + GenInterface.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile) + EgtSetKey(sKey) + ' Recupero livello e opzioni della chiave + Dim bKey As Boolean = EgtGetKeyLevel(7375, 2706, 1, m_nKeyLevel) And + EgtGetKeyOptions(7375, 2706, 1, m_nKeyOpt1, m_nKeyOpt2) + + If Not bKey Then + EgtOutLog("Key or Licence Problem (" & (-nKeyLevel).ToString() & ")") + MessageBox.Show(String.Format(EgtMsg(201), (-nKeyLevel).ToString()), "Error", MessageBoxButton.OK, MessageBoxImage.Error) + EgtOutLog("Exit") + End + End If + 'EgtInit(m_nDebug, m_sLogFile, sLogMsg) + 'EgtSetTempDir(m_sTempDir) + 'EgtSetIniFile(IniFile.m_sIniFile) + ' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione) + 'Dim sMsgDir As String = String.Empty + 'If GetMainPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then + ' sMsgDir = m_sConfigDir + 'End If + '' Inizializzo OptionModule + ''OptionModule.InitOptionModule() ' Leggo e imposto livello utilizzatore ' m_nUserLevel = Math.Min(m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1)) ' Info su opzioni chiave diff --git a/Effector.Main/My Project/AssemblyInfo.vb b/Effector.Main/My Project/AssemblyInfo.vb index 4e69e56..70c9167 100644 --- a/Effector.Main/My Project/AssemblyInfo.vb +++ b/Effector.Main/My Project/AssemblyInfo.vb @@ -55,5 +55,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + +