System.Windows.Forms.OpenFileDialog openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
System.Windows.Forms.ImageList imageList1 = new System.Windows.Forms.ImageList();
System.Collections.ArrayList imgList = new System.Collections.ArrayList();
protected void button1_Click(object sender, EventArgs e)
{
this.openFileDialog1.Filter = "jpg文件(*.jpg)|*.jpg|gif文件(*.gif)|*.gif";
if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
{
string PicFileName = this.openFileDialog1.FileName;
this.imgList.Add(PicFileName);
this.imageList1.Images.Add(Image.FromFile(PicFileName));
}
}
protected void button1_Click(object sender, EventArgs e)
{
this.openFileDialog1.Filter = "*.*";
if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
{
string FileName = this.openFileDialog1.FileName;
// 你的 处理文件路径代码
}
}
需要保存吗?