THE PUTXI PROJECT

Catalonia is Not Spain

FileStream and PictureBox

Posted by putxi on April 24, 2007

Have you got problems with a locked File? Are you searching a unlocker aplication? If your file is locked due to a PictureBox you are doing something badly. You must open the PictureBox like in the following example and the message of “this file is used for another person or application” will desapear

You must use a FileStream like in the following way:

// Make sure that you have added the System.IO namespace.
using System.IO;

// Specify a valid picture file path on your computer.
FileStream fs;
fs = new FileStream("C:\WINNT\Web\Wallpaper\Fly Away.jpg", FileMode.Open, FileAccess.Read);
pictureBox1.Image = System.Drawing.Image.FromStream(fs);
fs.Close();
And remember: CATALONIA IS NOT SPAIN!
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: