How to get assambly version through Reflection in .net

if you want to know the version of any assambly file hen you can do this with the help of Reflection class of the .net
Following is the example for getting version of the file in and C#:


private sub GetAssamblyInfo()
Dim VersionName As String = ""
        Dim Assamblyname As String = ""
        Dim AssemblyPath As String = "C:\\TempAssambly.dll"
        If IO.File.Exists(AssemblyPath) Then
            Dim TempDLL As Reflection.Assembly
            TempDLL = Reflection.Assembly.LoadFrom(AssemblyPath)
            VersionName = TempDLL.GetName().Version.ToString()
            Assamblyname = TempDLL.GetName().Name.ToString()
            MessageBox.Show("Assambly file is not found")
        End If
End sub


private void GetAssamblyInfo()
            string VersionName = "";
            string Assamblyname = "";

            string AssemblyPath = "C:\\TempAssambly.dll";
            if (System.IO.File.Exists(AssemblyPath))
                System.Reflection.Assembly TempDLL = null;
                TempDLL = System.Reflection.Assembly.LoadFrom(AssemblyPath);
                VersionName = TempDLL.GetName().Version.ToString();
                Assamblyname = TempDLL.GetName().Name.ToString();
                MessageBox.Show("file is not found");