■ 어셈블리 저작권 구하기

----------------------------------------------------------------------------------------------------

using System.Reflection;

 

#region 어셈블리 저작권 구하기 - GetAssemblyCopyright(assembly)

 

/// <summary>

/// 어셈블리 저작권 구하기

/// </summary>

/// <param name="assembly">어셈블리</param>

/// <returns>어셈블리 저작권 버전</returns>

public string GetAssemblyCopyright(Assembly assembly)

{

    object[] customAttributeArray = assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);

 

    if(customAttributeArray == null || customAttributeArray.Length == 0)

    {

        return null;

    }

 

    AssemblyCopyrightAttribute assemblyCopyrightAttribute = customAttributeArray[0] as AssemblyCopyrightAttribute;

 

    return assemblyCopyrightAttribute.Copyright;

}

 

#endregion

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker