Hi1) i've put the TurboActivate.vb in project2) i've tried to insert the code you sendme3) Put: Turboactivate.dll and TurboActivate.dat in Bin /Debug and /Release4) Inserted the correct GUIDbut Dont work for me probably i'm stupid, sorry
Here you can see the code of My frmMain windows form, where i've to put your code, please?
---------------------------------------------------------------------------------------------------------------------------------------------------Public Class frmMain
Private Sub Show_Login() If bSecurity Then frmLogin.ShowDialog() If Not frmLogin.LoginSucceeded Then Me.Close() Exit Sub End If frmLogin.Dispose() If Get_Authority(2, False) Then mnuUser.Visible = True mnuEdit_User.Visible = False Else mnuUser.Visible = False mnuEdit_User.Visible = True End If Else mnuUser.Visible = True mnuEdit_User.Visible = False End If mnuLog_Off.Text = "&Disconnetti " + sUser_Code mnuLog_Off.Visible = bSecurity End Sub
Public Sub Main() Dim bNew_Database As Boolean sUser_Code = "" sDB = "smart pro.sdf" sDBPath = Application.StartupPath sBackupPath = Application.StartupPath sData_Source = sDBPath + "\" + sDB strConnect = "Data Source='" + sData_Source + "'; LCID=1033; Password='" + sDB_Password + "'; Persist Security Info=True;Encryption Mode=Engine Default" If Dir(sData_Source) = "" Then If MsgBox("Database " + sData_Source + " non trovato!." + vbCrLf + "Creare nuovo database?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, "Conferma") = vbYes Then Create_Database(strConnect) bNew_Database = True Else End End If Else bNew_Database = False End If cn = New SqlServerCe.SqlCeConnection cmd = New SqlServerCe.SqlCeCommand da = New SqlServerCe.SqlCeDataAdapter cb = New SqlServerCe.SqlCeCommandBuilder cn.ConnectionString = strConnect cn.Open() cmd.Connection = cn da.AcceptChangesDuringUpdate = True da.FillLoadOption = LoadOption.OverwriteChanges cb.DataAdapter = da
If bNew_Database Then Create_Tables() Initialize_Tables() MsgBox("Creazione nuovo Database eseguita con successo", vbInformation, "Informazioni") End If strKoma = Format(1000, "#,##0") If InStr(1, strKoma, ",") <> 0 Then strKoma = "." Else strKoma = "," End If Check_Update() Load_Setting() End Sub
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Main() Show_Login() End Sub
Private Sub mnuRecipes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuRecipes.Click If Not Get_Authority(8, True, bAdd, bEdit, bDelete) Then Exit Sub End If frmRecipe.bAdd = bAdd frmRecipe.bEdit = bEdit frmRecipe.bDelete = bDelete frmRecipe.strID = "" frmRecipe.bPopup = False frmRecipe.ShowDialog() frmRecipe.Dispose() End Sub
Private Sub mnuPercentage_Soft_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPercentage_Soft.Click If Not Get_Authority(11, True) Then Exit Sub End If frmPercentage_Soft_New.ShowDialog() frmPercentage_Soft_New.Dispose() End Sub
Private Sub mnuRecipe_Soft_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuRecipe_Soft.Click If Not Get_Authority(10, True, bAdd, bEdit, bDelete) Then Exit Sub End If frmRecipe_soft.bAdd = bAdd frmRecipe_soft.bEdit = bEdit frmRecipe_soft.bDelete = bDelete frmRecipe_soft.strID = "" frmRecipe_soft.bPopup = False frmRecipe_soft.ShowDialog() frmRecipe_soft.Dispose() End Sub
Private Sub mnuIngredients_List_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuIngredients_List.Click If Not Get_Authority(6, True, bAdd, bEdit, bDelete) Then Exit Sub End If frmIngredient.bAdd = bAdd frmIngredient.bEdit = bEdit frmIngredient.bDelete = bDelete frmIngredient.strID = "" frmIngredient.bPopup = False frmIngredient.ShowDialog() frmIngredient.Dispose() End Sub
Private Sub mnuPercentage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPercentage.Click If Not Get_Authority(7, True) Then Exit Sub End If frmPercentage_New.ShowDialog() frmPercentage_New.Dispose() End Sub
Private Sub mnuSetting_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSetting.Click If Not Get_Authority(1, True) Then Exit Sub End If frmSetting.ShowDialog() If frmSetting.bSuccess Then Load_Setting() Show_Login() End If frmSetting.Dispose() End Sub
Private Sub mnuEdit_User_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuEdit_User.Click frmUser_New.strUser_ID = sUser_ID frmUser_New.bEdit_Data = True frmUser_New.ShowDialog() frmUser_New.Dispose() End Sub
Private Sub mnuAdditive_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) If Not Get_Authority(9, True) Then Exit Sub End If frmAdditive.ShowDialog() frmAdditive.Dispose() End Sub
Private Sub mnuUser_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuUser.Click If Not Get_Authority(2, True, bAdd, bEdit, bDelete) Then Exit Sub End If frmUser.bAdd = bAdd frmUser.bEdit = bEdit frmUser.bDelete = bDelete frmUser.bPopup = False frmUser.ShowDialog() frmUser.Dispose() End Sub
Private Sub mnuLog_Off_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuLog_Off.Click Show_Login() End Sub
Private Sub mnuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExit.Click, btnExit.Click Me.Close() End Sub
Private Sub AnnullaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub
Private Sub mnuBackup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuBackup.Click Dim strDestination As String If Not Get_Authority(4, True) Then Exit Sub End If SFD.Title = "Database Backup" SFD.FileName = "" SFD.InitialDirectory = sBackupPath SFD.OverwritePrompt = True SFD.Filter = "(*.sdf)|*.sdf" SFD.DefaultExt = ".sdf" SFD.ShowDialog() If SFD.FileName = "" Then Exit Sub End If If SFD.FileName = sData_Source Then MsgBox("Utilizzare un nome diverso " + sDB + ".", MsgBoxStyle.Information, "Informazioni") End If If My.Computer.FileSystem.FileExists(SFD.FileName) Then My.Computer.FileSystem.DeleteFile(SFD.FileName) End If cn.Close() strDestination = "Origine Dati='" + Replace(SFD.FileName, "'", "''") + "'; LCID=1033; Password='" + sDB_Password + "'; Persist Security Info=True;Encryption Mode=Engine Default" Dim Engine As New SqlServerCe.SqlCeEngine(strConnect) Engine.Compact(strDestination) cn.Open() cmd = cn.CreateCommand 'MsgBox("The data backup process has finished.", MsgBoxStyle.In MsgBox("Backup Terminato con successo!.", MsgBoxStyle.Information, "Informazioni") End Sub
Private Sub mnuRestore_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuRestore.Click Dim strRestore_Source As String, strRename_File As String If Not Get_Authority(5, True) Then Exit Sub End If On Error GoTo get_error OFD.Title = "Ripristino Database" OFD.FileName = "" OFD.InitialDirectory = sBackupPath OFD.Filter = "(*.sdf)|*.sdf" OFD.DefaultExt = ".sdf" OFD.ShowDialog() If OFD.FileName <> "" Then cn.Close() strRename_File = sDB + "x" If My.Computer.FileSystem.FileExists(sDBPath + "\" + strRename_File) Then My.Computer.FileSystem.DeleteFile(sDBPath + "\" + strRename_File) End If My.Computer.FileSystem.RenameFile(sData_Source, strRename_File) strRestore_Source = "Origine dei Dati='" + Replace(OFD.FileName, "'", "''") + "'; LCID=1033; Password='" + sDB_Password + "'; Persist Security Info=True;Encryption Mode=Engine Default" Dim Engine As New SqlServerCe.SqlCeEngine(strRestore_Source) Engine.Compact(strConnect) cn.Open() cmd.Connection = cn My.Computer.FileSystem.DeleteFile(sDBPath + "\" + strRename_File) End If MsgBox("Ripristino Database Terminato.", MsgBoxStyle.Information, "Informazioni") Exit Subget_error: If Err.Description <> "" Then MsgBox(Err.Description, vbInformation, "Informazioni") Err.Description = "" End If My.Computer.FileSystem.RenameFile(sDBPath + strRename_File, sDB) End Sub
Private Sub mnuShrink_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuShrink.Click If Not Get_Authority(3, True) Then Exit Sub End If cn.Close() Dim Engine As New SqlServerCe.SqlCeEngine(strConnect) If Not (Engine.Verify) Then Engine.Repair(Nothing, SqlServerCe.RepairOption.RecoverAllPossibleRows) End If Engine.Shrink() cn.Open() cmd = cn.CreateCommand MsgBox("Database compattato con successo.", MsgBoxStyle.Information, "Informazioni") End Sub
Private Sub mnuInverse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuInverse.Click If Not Get_Authority(10, True) Then Exit Sub End If frmInverse.ShowDialog() frmInverse.Dispose() End Sub
Private Sub mnuOverrun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOverrun.Click If Not Get_Authority(11, True) Then Exit Sub End If frmOverrun.ShowDialog() frmOverrun.Dispose() End Sub
Private Sub InformazionisuToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InformazionisuToolStripMenuItem.Click Dim form4 As frmSplashScreen form4 = New frmSplashScreen form4.Show()
End Sub
Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click If Not Get_Authority(9, True) Then Exit Sub End If frmAdditive.ShowDialog() frmAdditive.Dispose() End Sub
Private Sub ToolStripButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton6.Click If Not Get_Authority(8, True, bAdd, bEdit, bDelete) Then Exit Sub End If frmRecipe.bAdd = bAdd frmRecipe.bEdit = bEdit frmRecipe.bDelete = bDelete frmRecipe.strID = "" frmRecipe.bPopup = False frmRecipe.ShowDialog() frmRecipe.Dispose() End Sub
Private Sub ToolStripButton10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton10.Click Dim form2 As Form2 form2 = New Form2 form2.Show() End Sub
Private Sub ToolStripButton11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton11.Click If Not Get_Authority(10, True) Then Exit Sub End If frmInverse.ShowDialog() frmInverse.Dispose() End Sub
Private Sub ToolStripButton12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton12.Click If Not Get_Authority(10, True, bAdd, bEdit, bDelete) Then Exit Sub End If frmRecipe_Soft.bAdd = bAdd frmRecipe_Soft.bEdit = bEdit frmRecipe_Soft.bDelete = bDelete frmRecipe_Soft.strID = "" frmRecipe_Soft.bPopup = False frmRecipe_Soft.ShowDialog() frmRecipe_Soft.Dispose()
End Sub
Private Sub AdditiviUEToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AdditiviUEToolStripMenuItem.Click If Not Get_Authority(9, True) Then Exit Sub End If frmAdditive.ShowDialog() frmAdditive.Dispose() End Sub
Private Sub ToolStripButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton7.Click If Not Get_Authority(2, True, bAdd, bEdit, bDelete) Then Exit Sub End If frmUser.bAdd = bAdd frmUser.bEdit = bEdit frmUser.bDelete = bDelete frmUser.bPopup = False frmUser.ShowDialog() frmUser.Dispose() End Sub
Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click If Not Get_Authority(8, True, bAdd, bEdit, bDelete) Then Exit Sub End If frmRecipe.bAdd = bAdd frmRecipe.bEdit = bEdit frmRecipe.bDelete = bDelete frmRecipe.strID = "" frmRecipe.bPopup = False frmRecipe.ShowDialog() frmRecipe.Dispose() End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click If Not Get_Authority(6, True, bAdd, bEdit, bDelete) Then Exit Sub End If frmIngredient.bAdd = bAdd frmIngredient.bEdit = bEdit frmIngredient.bDelete = bDelete frmIngredient.strID = "" frmIngredient.bPopup = False frmIngredient.ShowDialog() frmIngredient.Dispose() End Sub
Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click If Not Get_Authority(11, True) Then Exit Sub End If frmOverrun.ShowDialog() frmOverrun.Dispose() End Sub
Private Sub ToolStripButton9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton9.Click Show_Login() End Sub
Private Sub TagliaToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TagliaToolStripButton.Click Dim strDestination As String If Not Get_Authority(4, True) Then Exit Sub End If SFD.Title = "Data Backup" SFD.FileName = "" SFD.InitialDirectory = sBackupPath SFD.OverwritePrompt = True
SFD.Filter = "(*.sdf)|*.sdf" SFD.DefaultExt = ".sdf" SFD.ShowDialog() If SFD.FileName = "" Then Exit Sub End If If SFD.FileName = sData_Source Then MsgBox("Utilizzare un nome diverso " + sDB + ".", MsgBoxStyle.Information, "Informazioni") Exit Sub End If If My.Computer.FileSystem.FileExists(SFD.FileName) Then My.Computer.FileSystem.DeleteFile(SFD.FileName) End If cn.Close() strDestination = "Data Source='" + SFD.FileName + "'; LCID=1033; Password='" + sDB_Password + "'; Persist Security Info=True;Encryption Mode=Engine Default" Dim Engine As New SqlServerCe.SqlCeEngine(strConnect) Engine.Compact(strDestination) cn.Open() cmd = cn.CreateCommand MsgBox("Backup Terminato con successo!.", MsgBoxStyle.Information, "Informazioni") End Sub
Private Sub ToolStripButton8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton8.Click Dim strRestore_Source As String, strRename_File As String If Not Get_Authority(5, True) Then Exit Sub End If On Error GoTo get_error OFD.Title = "Data Restore" OFD.FileName = "" OFD.InitialDirectory = sBackupPath OFD.Filter = "(*.sdf)|*.sdf" OFD.DefaultExt = ".sdf" OFD.ShowDialog() If OFD.FileName <> "" Then cn.Close() strRename_File = sDB + "x" If My.Computer.FileSystem.FileExists(sDBPath + "\" + strRename_File) Then My.Computer.FileSystem.DeleteFile(sDBPath + "\" + strRename_File) End If My.Computer.FileSystem.RenameFile(sData_Source, strRename_File) strRestore_Source = "Data Source='" + OFD.FileName + "'; LCID=1033; Password='" + sDB_Password + "'; Persist Security Info=True;Encryption Mode=Engine Default" Dim Engine As New SqlServerCe.SqlCeEngine(strRestore_Source) Engine.Compact(strConnect) cn.Open() cmd.Connection = cn My.Computer.FileSystem.DeleteFile(sDBPath + "\" + strRename_File) End If MsgBox("Ripristino dei Dati terminato.", MsgBoxStyle.Information, "Informazioni") Exit Subget_error: If Err.Description <> "" Then MsgBox(Err.Description, vbInformation, "Informazioni") Err.Description = "" End If My.Computer.FileSystem.RenameFile(sDBPath + strRename_File, sDB) End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click If Not Get_Authority(7, True) Then Exit Sub End If frmPercentage_New.ShowDialog() frmPercentage_New.Dispose() End Sub
Private Sub ToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton.Click System.Windows.Forms.Help.ShowHelp(Me, "Smart.chm", HelpNavigator.AssociateIndex) End Sub
Private Sub SommarioToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SommarioToolStripMenuItem.Click System.Windows.Forms.Help.ShowHelp(Me, "Smart.chm", HelpNavigator.AssociateIndex) End Sub
Private Sub ToolStripButton13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton13.Click If Not Get_Authority(7, True) Then Exit Sub End If Stampe1.ShowDialog() Stampe1.Dispose() End Sub
Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolStrip1.ItemClicked
End SubEnd Class----------------------------------------------------------------------------------------------------------------------------------------------------
ThanksBest regardsMAurizio