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);

            }

        }

    }

  • 相关阅读:
    JAVA_集合_作业01
    Java_Objects_hashCode
    Java成员内部类
    Java集合练习_实现购物车需求
    Java初级_单例设计模式
    HelloWorld
    vue中视频标点
    防抖节流?俩者区别?vue如何使用防抖、节流来解决点击问题?
    keep-alive
    axios和ajax的区别
  • 原文地址:https://www.cnblogs.com/luoyaoquan/p/2614097.html
Copyright © 2011-2022 走看看