- 博客(8)
- 资源 (2)
- 收藏
- 关注
原创 如何创建隐式类型的数组示例
<br />static void Main() { var a = new[] { 1, 10, 100, 1000 }; // int[] var b = new[] { "hello", null, "world" }; // string[] // single-dimension jagged array var c = new[] { new[]{1,2,3
2011-04-17 01:02:00 258
原创 嵌入资源例子
<br />Assembly asm = Assembly.GetExecutingAssembly(); //MessageBox.Show(asm.GetName().Name); //foreach (string name in asm.GetManifestResourceNames()) //MessageBox.Show(name); Bitmap bitmap = new Bitmap(a
2011-04-17 01:01:00 170
原创 在字符串数组中搜索字符串
<br />string[] strArray = {"ABCDEFG", "HIJKLMNOP"};string findThisString = "JKL";int strNumber;int strIndex = 0;for (strNumber = 0; strNumber < strArray.Length; strNumber++){ strIndex = strArray[strNumber].IndexOf(findThisString); if (s
2011-04-17 01:00:00 351
原创 装箱和取消装箱
<br />将值类型转换为引用类型的过程称为装箱。装箱某个变量,就是创建一个引用变量,它指向堆上的新副本。引用变量是一个对象,因此,它可以使用每个对象都继承的所有方法(例如 ToString())。下面的代码进行了具体的说明:<br />int i = 67; // i is a value typeobject o = i; // i is boxedSystem.Console
2011-04-17 00:58:00 202
原创 资源文件的简单使用
<br /> Assembly thisExe; thisExe = System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Stream file = thisExe.GetManifestResourceStream("winform.hhh.GIF"); this.pictureBox1.Image = Image.FromStream(
2011-04-17 00:57:00 139
原创 打开文件框简单应用
Stream myStream = null; OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "c://"; openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
2011-04-16 22:39:00 255
原创 从对话框中检索数据
Form2:Form1 mainForm; public Form2(Form1 mainForm) { this.mainForm = mainForm; InitializeComponent(); }private void button1_Click(object sender, EventArgs e) {
2011-04-16 22:36:00 196
原创 简单动态添加控件
<br /> string[] stringArray = new string[3]; stringArray[0] = "Yes"; stringArray[1] = "No"; stringArray[2] = "Maybe"; System.Windows.Forms.RadioButton[] radioButtons = new
2011-04-16 22:34:00 234
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人