在.NET中嵌入和使用资源文件
嵌入和使用资源文件,以下是全部源代码:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Reflection;
using System.IO;
using System.Diagnostics;namespace ResourceDemo
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
ArrayList pics;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.PictureBox pBox;
private System.Windows.Forms.Button btnDisplay;
private System.Windows.Forms.TextBox txtInfo;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();// Instantiate our ArrayList
pics = new ArrayList();
}/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pBox = new System.Windows.Forms.PictureBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnDisplay = new System.Windows.Forms.Button();
this.txtInfo = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// pBox
//
this.pBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pBox.Location = new System.Drawing.Point(8, 8);
this.pBox.Name = "pBox";
this.pBox.Size = new System.Drawing.Size(264, 272);
this.pBox.TabIndex = 0;
this.pBox.TabStop = false;
this.pBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
//
// groupBox1
//
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.txtInfo,
this.btnDisplay});
this.groupBox1.Location = new System.Drawing.Point(288, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(192, 264);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
//
// btnDisplay
//
this.btnDisplay.Location = new System.Drawing.Point(48, 24);
this.btnDisplay.Name = "btnDisplay";
 
补充:Web开发 , ASP.Net ,