Lock and Unlock
-
hi i lock a file.. and i acces this how i can unlock this file in c#.. plz send me any article, code, help for that problem.. Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
-
What do you mean by locking the file? If you mean that you lock it as you open it, simply close it. --- b { font-weight: normal; }
When I get the image from the file the file remains locked hi, Can you help? When I get the image from the file the file remains locked so the Delete fails with a "used by another process" how can i unlock this file...................? its urgent plz help and if any code and article send me on nicevirendra@rediffmail.com thanx Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
-
When I get the image from the file the file remains locked hi, Can you help? When I get the image from the file the file remains locked so the Delete fails with a "used by another process" how can i unlock this file...................? its urgent plz help and if any code and article send me on nicevirendra@rediffmail.com thanx Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
As I see the file stream remains open . You may copy the image into MemoryStream, then close FileStream .After this you will be able to delete the file and play with the image as you want. DevIntelligence.com - My blog for .Net Developers
-
As I see the file stream remains open . You may copy the image into MemoryStream, then close FileStream .After this you will be able to delete the file and play with the image as you want. DevIntelligence.com - My blog for .Net Developers
Actually prob is that: i save an image... but when im update image... i want to delete old image frm my IMAGE folder... i use.. Image = Image.FromFile(imageFileName) : and thow the error : this is used by another procees help me out ..... thanx Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
-
Actually prob is that: i save an image... but when im update image... i want to delete old image frm my IMAGE folder... i use.. Image = Image.FromFile(imageFileName) : and thow the error : this is used by another procees help me out ..... thanx Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
This code snippet reads image file, show it in PictureBox then delete image file from the disk.
try { MemoryStream ms = null; FileInfo fi = new FileInfo(textBoxFilePathName.Text); byte [] buffer = new byte[fi.Length]; // read image file into stream using( FileStream stream = File.Open(fi.FullName, FileMode.Open) ) { stream.Read( buffer, 0, (int)fi.Length ); ms = new MemoryStream(buffer); } Image img = Image.FromStream(ms); // display image pictureBox1.Image = img; // delete image file File.Delete( textBoxFilePathName.Text ); //close stream ms.Close(); } catch (Exception e1) { MessageBox.Show( e1.Message ); }
DevIntelligence.com - My blog for .Net Developers -
When I get the image from the file the file remains locked hi, Can you help? When I get the image from the file the file remains locked so the Delete fails with a "used by another process" how can i unlock this file...................? its urgent plz help and if any code and article send me on nicevirendra@rediffmail.com thanx Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...