Click here to Skip to main content
15,914,416 members
Home / Discussions / C#
   

C#

 
AnswerRe: Release Photo Pin
Christian Graus25-Aug-09 19:32
protectorChristian Graus25-Aug-09 19:32 
QuestionRe: Release Photo Pin
sanforjackass25-Aug-09 19:46
sanforjackass25-Aug-09 19:46 
AnswerRe: Release Photo Pin
Hum Dum25-Aug-09 19:55
Hum Dum25-Aug-09 19:55 
QuestionRe: Release Photo Pin
sanforjackass25-Aug-09 20:10
sanforjackass25-Aug-09 20:10 
AnswerRe: Release Photo Pin
Hum Dum25-Aug-09 20:18
Hum Dum25-Aug-09 20:18 
QuestionRe: Release Photo Pin
sanforjackass25-Aug-09 20:29
sanforjackass25-Aug-09 20:29 
QuestionRe: Release Photo Pin
sanforjackass25-Aug-09 20:52
sanforjackass25-Aug-09 20:52 
AnswerRe: Release Photo Pin
Henry Minute25-Aug-09 21:59
Henry Minute25-Aug-09 21:59 
You are not closing the FileStream until after you try to delete the image, Therefore the image is still being used by the FileStream, hence the error message.

Modify your code:
using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
{
  PictrureBox1.Image=Image.FromStream(fs);
}
pictuer1.Image.Save(New Dir);
File.Delete(Dir);


Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

GeneralRe: Release Photo Pin
sanforjackass26-Aug-09 2:16
sanforjackass26-Aug-09 2:16 
QuestionHelp needed with simple Web Spider Code Pin
manormi125-Aug-09 16:02
manormi125-Aug-09 16:02 
AnswerRe: Help needed with simple Web Spider Code Pin
N a v a n e e t h25-Aug-09 16:41
N a v a n e e t h25-Aug-09 16:41 
QuestionimageList images appear to be getting "corrupted" Pin
shultas25-Aug-09 14:54
shultas25-Aug-09 14:54 
AnswerRe: imageList images appear to be getting "corrupted" Pin
Henry Minute25-Aug-09 22:05
Henry Minute25-Aug-09 22:05 
QuestionRefactoring question Pin
Illegal Operation25-Aug-09 14:42
Illegal Operation25-Aug-09 14:42 
AnswerRe: Refactoring question Pin
Not Active25-Aug-09 15:03
mentorNot Active25-Aug-09 15:03 
AnswerRe: Refactoring question Pin
N a v a n e e t h25-Aug-09 16:26
N a v a n e e t h25-Aug-09 16:26 
QuestionConvert Process to the orginal C# COM class Pin
Gindi Bar Yahav25-Aug-09 13:07
Gindi Bar Yahav25-Aug-09 13:07 
Question[Message Deleted] Pin
WhiteWolf1925-Aug-09 11:49
WhiteWolf1925-Aug-09 11:49 
AnswerRe: C# code help Pin
Not Active25-Aug-09 12:20
mentorNot Active25-Aug-09 12:20 
AnswerRe: C# code help Pin
_Maxxx_25-Aug-09 19:38
professional_Maxxx_25-Aug-09 19:38 
QuestionEnumerator Pin
CodingYoshi25-Aug-09 11:06
CodingYoshi25-Aug-09 11:06 
AnswerRe: Enumerator Pin
Adam R Harris25-Aug-09 11:51
Adam R Harris25-Aug-09 11:51 
GeneralRe: Enumerator Pin
CodingYoshi25-Aug-09 17:20
CodingYoshi25-Aug-09 17:20 
AnswerRe: Enumerator Pin
DaveyM6925-Aug-09 11:51
professionalDaveyM6925-Aug-09 11:51 
AnswerRe: Enumerator Pin
Alan N25-Aug-09 13:45
Alan N25-Aug-09 13:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.