0% found this document useful (0 votes)
16 views2 pages

Movie Library

Application

Uploaded by

gadala.suhasini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Movie Library

Application

Uploaded by

gadala.suhasini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

// MovieLibrary.

csproj
// Create a new Class Library project named MovieLibrary

using System;

namespace MovieLibrary
{
public class Movie
{
public string Title { get; set; }
public string Director { get; set; }
public int ReleaseYear { get; set; }

// Constructor
public Movie(string title, string director, int releaseYear)
{
Title = title;
Director = director;
ReleaseYear = releaseYear;
}

// Method to display movie details


public void DisplayInfo()
{
Console.WriteLine($"Title: {Title}, Director: {Director}, Year:
{ReleaseYear}");
}
}
}

using System;
using System.Linq;
using System.Reflection;

namespace AssemblyInfoLoader
{
class Program
{
static void Main(string[] args)
{
string assemblyPath = @"path\to\your\MovieLibrary.dll"; // Update this
path

// Load the assembly


Assembly assembly = Assembly.LoadFrom(assemblyPath);

// Display Assembly Information


Console.WriteLine("Assembly Information:");
Console.WriteLine($"Full Name: {assembly.FullName}");
Console.WriteLine($"Location: {assembly.Location}");
Console.WriteLine($"Version: {assembly.GetName().Version}");
Console.WriteLine();

// Display Module Information


Console.WriteLine("Module Information:");
foreach (var module in assembly.GetModules())
{
Console.WriteLine($"Module Name: {module.Name}");
Console.WriteLine($"Module Scope Name: {module.ScopeName}");
}
Console.WriteLine();

// Display Class Information


Console.WriteLine("Class Information:");
var types = assembly.GetTypes();
foreach (var type in types)
{
Console.WriteLine($"Class Name: {type.Name}");
Console.WriteLine($"Namespace: {type.Namespace}");

// Display Constructor Information


Console.WriteLine("Constructors:");
var constructors = type.GetConstructors();
foreach (var constructor in constructors)
{
Console.WriteLine($" - {constructor.Name} ({string.Join(", ",
constructor.GetParameters().Select(p => p.ParameterType.Name))})");
}

// Display Property Information


Console.WriteLine("Properties:");
var properties = type.GetProperties();
foreach (var property in properties)
{
Console.WriteLine($" - {property.Name} (Type:
{property.PropertyType.Name})");
}

// Display Method Information


Console.WriteLine("Methods:");
var methods = type.GetMethods();
foreach (var method in methods.Where(m => !m.IsSpecialName)) //
Exclude property accessors
{
Console.WriteLine($" - {method.Name} ({string.Join(", ",
method.GetParameters().Select(p => p.ParameterType.Name))})");
}

Console.WriteLine();
}
}
}
}

You might also like