C#代码调用Resource.resx

网上找半天,怕脑子记不住写下来好了.

System.Resources.ResourceManager rs = new System.Resources.ResourceManager(typeof(Properties.Resources)); //建立资源对象
pictureBox1.Image = (System.Drawing.Image)rs.GetObject("img1");//获取资源图片

Leave a Reply

Your email address will not be published. Required fields are marked *