Click here to Skip to main content
13,042,421 members (125,670 online)
Click here to Skip to main content

Tagged as

Stats

11.2K views
373 downloads
9 bookmarked
Posted 17 Dec 2012

Resigning a signed assembly

, 18 Dec 2012
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...

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