请教如果做出一个自动读取图片的循环

dogding 发布于 2009/05/23 15:45
阅读 213
收藏 0
本人刚开始学习C#想将自己的图片读取程序做成一个自动循环,就是让程序自己去特定文件夹自动读取文件里的图片(jpg,dmp).下面是我写的程序,我是菜鸟写得不好的地方请大家见谅! ps.我是用windows forms做得! using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace frame { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) { pictureBox2.ImageLocation = openFileDialog1.FileName; } if (result == DialogResult.OK) { this.name.Text = openFileDialog1.SafeFileName; } } private void openFileDialog1_FileOk(object sender, CancelEventArgs e) { } private void pictureBox2_Click(object sender, EventArgs e) { } private void name_Click(object sender, EventArgs e) { } } }
加载中
返回顶部
顶部