Click here to Skip to main content
11,718,289 members (84,237 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Resigning a signed assembly

, 18 Dec 2012 CPOL 7.2K 286 9
In this project we learn how to resign a signed assembly with another one of your choice
Imports System.Windows.Forms
Imports System.IO
Imports System.Reflection
Imports System.Runtime.InteropServices

Public Class ResignForm

    Private Sub btnResign_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResign.Click

        Dim clsResign As New ResignClass(Me.txtAssembly.Text, Me.txtSNKFile.Text)
        If clsResign.Resign() Then
            MsgBox("Resigning successfully completed !!", MsgBoxStyle.Information)
        Else
            MsgBox("Resigning failed !!", MsgBoxStyle.Exclamation)
        End If

    End Sub

    Private Sub btnBrowseSNK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowseSNK.Click

        Using dlg As New OpenFileDialog

            dlg.Filter = "SNK File|*.snk"
            dlg.ShowDialog()

            If ((dlg.FileName.Length > 1) AndAlso IO.File.Exists(dlg.FileName)) Then
                Me.txtSNKFile.Text = dlg.FileName
                Me.btnResign.Enabled = True
            End If

        End Using

    End Sub

    Private Sub btnBrowseAssembly_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowseAssembly.Click

        Using dlg As New OpenFileDialog

            dlg.Filter = ".Net Assembly|*.exe;*.dll"
            dlg.ShowDialog()

            If ((dlg.FileName.Length > 1) AndAlso IO.File.Exists(dlg.FileName)) Then
                Me.txtAssembly.Text = dlg.FileName
                Me.btnBrowseSNK.Enabled = True
            End If

        End Using

    End Sub

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ahmad Dekmak
Technical Lead Mentis
Lebanon Lebanon
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150901.1 | Last Updated 18 Dec 2012
Article Copyright 2012 by Ahmad Dekmak
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid