Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Luc Pattyn22-May-10 2:49
sitebuilderLuc Pattyn22-May-10 2:49 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 [modified] Pin
Matt U.22-May-10 7:28
Matt U.22-May-10 7:28 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Matt U.22-May-10 14:16
Matt U.22-May-10 14:16 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Luc Pattyn22-May-10 14:28
sitebuilderLuc Pattyn22-May-10 14:28 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Matt U.20-May-10 14:58
Matt U.20-May-10 14:58 
QuestionHelp Re: DateTime and DayofWeek - Increasing DayofWeek Value Pin
roman_s20-May-10 7:45
roman_s20-May-10 7:45 
AnswerRe: Help Re: DateTime and DayofWeek - Increasing DayofWeek Value [modified] Pin
Luc Pattyn20-May-10 8:31
sitebuilderLuc Pattyn20-May-10 8:31 
QuestionZip files Pin
DinoRondelly20-May-10 6:36
DinoRondelly20-May-10 6:36 
I am generating a zip file and then emailing it. I am using a temp directory to create this file but i will always be creating a number of different files using this directory.

The problem i am having is when i go to delete the files inside my temp directory i get an error saying that the zip file is being used by another process.

I have stepped through the code and waited until the email was sent to be sure that its not being locked there.

I have also set the zipfile to null and that still didnt work.

if anyone has any ideas as to what might be causing this i would be forever grateful.
    if (!CreatedTempFolder)
    {
        //if not dir exists
        if (!System.IO.Directory.Exists(TempFileLocation))
            // create it
            System.IO.Directory.CreateDirectory(TempFileLocation);
        else
        {
            //delete all files from temp foleder
                System.IO.Directory.Delete(TempFileLocation, true);
                System.IO.Directory.CreateDirectory(TempFileLocation);
        }
        //set CreatedTempFolder to true


string zipFileName = string.Format("{0}\\{1}.zip", TempFileLocation, DrSched["GROUPNAME"].ToString());
MyZip zipfile = new MyZip(zipFileName,"W");


foreach (string fileName in System.IO.Directory.GetFiles(TempFileLocation,"*.csv"))
    zipfile.AddFile(fileName);

//zipfile.Save();
zipfile.Close();

zipfile = null;
GC.Collect();

AnswerRe: Zip files Pin
J4amieC20-May-10 6:45
J4amieC20-May-10 6:45 
AnswerRe: Zip files Pin
The Man from U.N.C.L.E.20-May-10 6:46
The Man from U.N.C.L.E.20-May-10 6:46 
GeneralRe: Zip files Pin
DinoRondelly20-May-10 7:06
DinoRondelly20-May-10 7:06 
AnswerRe: Zip files Pin
Hristo-Bojilov20-May-10 9:59
Hristo-Bojilov20-May-10 9:59 
Question.mov file writer Pin
c242320-May-10 5:28
c242320-May-10 5:28 
AnswerRe: .mov file writer Pin
Martin Jarvis20-May-10 6:57
Martin Jarvis20-May-10 6:57 
GeneralRe: .mov file writer Pin
c242320-May-10 7:46
c242320-May-10 7:46 
QuestionRetrieve data (using query) from a Access database Pin
Chiman120-May-10 4:29
Chiman120-May-10 4:29 
AnswerRe: Retrieve data (using query) from a Access database Pin
Andy_L_J20-May-10 4:40
Andy_L_J20-May-10 4:40 
AnswerRe: Retrieve data (using query) from a Access database Pin
Abhinav S20-May-10 4:43
Abhinav S20-May-10 4:43 
GeneralRe: Retrieve data (using query) from a Access database Pin
Chiman120-May-10 5:13
Chiman120-May-10 5:13 
GeneralRe: Retrieve data (using query) from a Access database Pin
Wes Aday20-May-10 7:30
professionalWes Aday20-May-10 7:30 
QuestionHeaderFile vs Class Pin
jashimu20-May-10 4:13
jashimu20-May-10 4:13 
AnswerRe: HeaderFile vs Class Pin
Pete O'Hanlon20-May-10 4:23
mvePete O'Hanlon20-May-10 4:23 
GeneralRe: HeaderFile vs Class Pin
jashimu20-May-10 4:38
jashimu20-May-10 4:38 
GeneralRe: HeaderFile vs Class Pin
PIEBALDconsult20-May-10 6:15
mvePIEBALDconsult20-May-10 6:15 
AnswerRe: HeaderFile vs Class Pin
Luc Pattyn20-May-10 4:55
sitebuilderLuc Pattyn20-May-10 4:55 

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.