private void btnImportarDLL_Click(object sender, EventArgs e) { OpenFileDialog op = new OpenFileDialog(); op.Title = "Selecionar DLL"; op.DefaultExt = "dll"; op.Filter = "dll files (*.dll)|*.dll|All files (*.*)|*.*"; op.ShowDialog(); txtImportarDLL.Text = op.FileName; string SATDLL = txtImportarDLL.Text; int tamanho = IntPtr.Size; tamanho.ToString(); ptr = FuncoesDll.LoadLibrary(SATDLL); if ((tamanho == 4) && (ptr != IntPtr.Zero)) { FuncoesDLL(); } else if ((tamanho == 8) && (ptr != IntPtr.Zero)) { FuncoesDLL(); } else { MessageBox.Show("Erro ao importar DLL"); grpBoxFuncoes.Enabled = false; return; } }
public Codigo_de_Ativacao(string dll) { InitializeComponent(); string SATDLL = dll; ptr = FuncoesDll.LoadLibrary(SATDLL); intptr_trocarCodigoDeAtivacao = FuncoesDll.GetProcAddress(ptr, "TrocarCodigoDeAtivacao"); trocarCodigoDeAtivacao = (TrocarCodigoDeAtivacao)Marshal.GetDelegateForFunctionPointer (intptr_trocarCodigoDeAtivacao, typeof(TrocarCodigoDeAtivacao)); }
public Configurar_Rede(string dll) { InitializeComponent(); string SATDLL = dll; ptr = FuncoesDll.LoadLibrary(SATDLL); intptr_ConfigurarInterfaceDeRede = FuncoesDll.GetProcAddress(ptr, "ConfigurarInterfaceDeRede"); configurarInterfaceDeRede = (ConfigurarInterfaceDeRede)Marshal.GetDelegateForFunctionPointer (intptr_ConfigurarInterfaceDeRede, typeof(ConfigurarInterfaceDeRede)); }