C#

private Assembly AssemblyData = System.Reflection.Assembly.GetEntryAssembly();

// タイトル名
AssemblyData.GetName().Name;

// 会社名
GetCustomAttribute<AssemblyCompanyAttribute>().Company;

private T GetCustomAttribute<T>() where T : Attribute
{
    return (T)Attribute.GetCustomAttribute(AssemblyData, typeof(T));
}

C#,ソフトウェア開発

private async Task<string> GetSiteSource(string url, Uri reffrrer = null)
{
    using (System.Net.WebClient objWebClient = new System.Net.WebClient())
    {
        if(reffrrer != null)
            objWebClient.Headers.Add(HttpRequestHeader.Referer, reffrrer.ToString());

        objWebClient.Headers.Add(HttpRequestHeader.UserAgent, strUserAgent);
        objWebClient.Encoding = System.Text.Encoding.UTF8;
        string strSource = await objWebClient.DownloadStringTaskAsync(url);

        ContentType contentType = new ContentType(objWebClient.ResponseHeaders["Content-Type"]);

        switch(contentType.CharSet.ToLower().Replace("-", ""))
        {
            case "utf8":
                break;

            case "eucjp":
                objWebClient.Encoding = System.Text.Encoding.GetEncoding("euc-jp");
                strSource = await objWebClient.DownloadStringTaskAsync(url);
                break;

            case "shiftjis":
                objWebClient.Encoding = System.Text.Encoding.GetEncoding("shift-jis");
                strSource = await objWebClient.DownloadStringTaskAsync(url);
                break;

            default:
                break;
        }

        return strSource;
    }
}