Monday, March 5, 2012

How to Upload images in Windows applications

Code.aspx.cs:
OpenFileDialog open = new OpenFileDialog();
            // image filters
            open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";
            if (open.ShowDialog() == DialogResult.OK)
            {
                // display image in picture box
                pictureBox1.Image = new Bitmap(open.FileName);
                // image file path
                txtImage.Text = open.FileName;
                txtImage.Text = Path.GetFileName(open.FileName)
}




No comments:

Post a Comment