diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 2ea0873..4464d4b 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -59,5 +59,5 @@ Imports System.Windows ' usando l'asterisco '*' come illustrato di seguito: ' - - + + diff --git a/NewLicencePage/NewLicencePageVM.vb b/NewLicencePage/NewLicencePageVM.vb index 0e08624..db22d0f 100644 --- a/NewLicencePage/NewLicencePageVM.vb +++ b/NewLicencePage/NewLicencePageVM.vb @@ -549,10 +549,12 @@ Public Class NewLicencePageVM ' Nome licenza Dim sCliName As String = If(String.IsNullOrWhiteSpace(m_ClientName), "", "-" & m_ClientName) Dim sLicName As String = If(GetSelIsDongle(), "Key-", "Soft-") & SelNumber.Number.ToString("D6") & "-" & SelProduct.ProductName & sCliName - ' Nome file Dim fileName As String = Map.refMainWindowVM.MainWindowM.sKeygenDataDir & "\" & sLicName & ".Kge" fileName = ManageFile.ComputeFileName(fileName, Path.GetFileNameWithoutExtension(fileName)) + ' Aggiorno nome licenza col nuovo nome calcolato del file + sLicName = Path.GetFileNameWithoutExtension(fileName) + ' Scrivo il file Dim StringFile As New List(Of String) StringFile.Add(";") @@ -621,9 +623,16 @@ Public Class NewLicencePageVM Return End Try - ' Ora aggiungo la licenza al DB + ' Ora leggo il contenuto del file .lic generato e aggiungo la licenza al DB + Dim textLic As String = String.Empty + Try + textLic = File.ReadAllText(Path.ChangeExtension(fileName.Replace("\", "\\"), ".lic")) + Catch ex As Exception + MessageBox.Show("File .lic non trovato", "LicenceManager Error") + Return + End Try + Try - Dim textLic As String = File.ReadAllText(Path.ChangeExtension(fileName.Replace("\", "\\"), ".lic")) If String.IsNullOrEmpty(NestKey) Or String.IsNullOrWhiteSpace(NestKey) Then Query = "INSERT INTO " & DB_LICENCE & " (" & DB_PRODUCTID & ", " & DB_PRODUCTVERSION & ", " & DB_PRODUCTLEVEL & ", " &