zoukankan      html  css  js  c++  java
  • 获取资源文件

    from:http://blog.csdn.net/bjddd192/article/details/4317909
    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Data;

    using System.Drawing;

    using System.Text;

    using System.Windows.Forms;

    namespace WinFormDev

    {

        public partial class FormResouce : Form

        {

            public FormResouce()

            {

                InitializeComponent();

            }

     

            private void FormResouce_Load(object sender, EventArgs e)

            {

                //获取资源文件:资源名称应为命名空间加相对路径,且资源为嵌入的资源

     

                //获取本程序集的资源文件

                System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();

                System.IO.Stream stream = assembly.GetManifestResourceStream("WinFormDev.wait.gif");

                pictureBox1.Image = new System.Drawing.Bitmap(stream);

     

                //获取其它程序集的资源文件

                assembly = System.Reflection.Assembly.GetAssembly(typeof(Components.frmGradeEditor));

                stream = assembly.GetManifestResourceStream("Components.Resources.1.bmp");

                pictureBox2.Image = new System.Drawing.Bitmap(stream);

            }

        }

    }

  • 相关阅读:
    处理数据
    Vue--Vue常用指令及操作
    Vue--Vue实例
    ES6--解构赋值
    ES6--入门
    前端模块化开发
    Node.js--入门
    HTML5--canvas与svg的使用
    input整理
    移动端开发入门
  • 原文地址:https://www.cnblogs.com/luoyaoquan/p/2614097.html
Copyright © 2011-2022 走看看