Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
AnswerRe: Put DLL file to another location Pin
Dave Kreskowiak31-Aug-13 15:10
mveDave Kreskowiak31-Aug-13 15:10 
AnswerRe: Put DLL file to another location Pin
Abhinav S31-Aug-13 15:51
Abhinav S31-Aug-13 15:51 
QuestionHow to get user names accessing ACCESS database Pin
BajrangSingh31-Aug-13 8:22
BajrangSingh31-Aug-13 8:22 
AnswerRe: How to get user names accessing ACCESS database Pin
Dave Kreskowiak31-Aug-13 8:29
mveDave Kreskowiak31-Aug-13 8:29 
GeneralRe: How to get user names accessing ACCESS database Pin
BajrangSingh31-Aug-13 9:32
BajrangSingh31-Aug-13 9:32 
GeneralRe: How to get user names accessing ACCESS database Pin
Dave Kreskowiak31-Aug-13 10:30
mveDave Kreskowiak31-Aug-13 10:30 
GeneralRe: How to get user names accessing ACCESS database Pin
BajrangSingh31-Aug-13 18:40
BajrangSingh31-Aug-13 18:40 
GeneralRe: How to get user names accessing ACCESS database Pin
Dave Kreskowiak1-Sep-13 5:02
mveDave Kreskowiak1-Sep-13 5:02 
AnswerRe: How to get user names accessing ACCESS database Pin
Mycroft Holmes31-Aug-13 13:09
professionalMycroft Holmes31-Aug-13 13:09 
GeneralRe: How to get user names accessing ACCESS database Pin
jschell31-Aug-13 13:57
jschell31-Aug-13 13:57 
GeneralRe: How to get user names accessing ACCESS database Pin
Mycroft Holmes31-Aug-13 16:17
professionalMycroft Holmes31-Aug-13 16:17 
GeneralRe: How to get user names accessing ACCESS database Pin
BajrangSingh31-Aug-13 19:27
BajrangSingh31-Aug-13 19:27 
AnswerRe: How to get user names accessing ACCESS database Pin
Chris Quinn2-Sep-13 4:14
Chris Quinn2-Sep-13 4:14 
QuestionAudio programming - play section of WAV file Pin
keykeeper130-Aug-13 23:04
keykeeper130-Aug-13 23:04 
AnswerRe: Audio programming - play section of WAV file Pin
BillWoodruff31-Aug-13 1:47
professionalBillWoodruff31-Aug-13 1:47 
AnswerRe: Audio programming - play section of WAV file Pin
blitzkrieged31-Aug-13 13:31
blitzkrieged31-Aug-13 13:31 
AnswerRe: Audio programming - play section of WAV file Pin
blitzkrieged31-Aug-13 21:01
blitzkrieged31-Aug-13 21:01 
AnswerRe: Audio programming - play section of WAV file Pin
Dusara Maulik31-Aug-13 23:27
Dusara Maulik31-Aug-13 23:27 
QuestionCan we use memorycache in webservice running on different machine and client on other machine?(c#) Pin
santosh code30-Aug-13 19:30
santosh code30-Aug-13 19:30 
AnswerRe: Can we use memorycache in webservice running on different machine and client on other machine?(c#) Pin
Pete O'Hanlon30-Aug-13 22:04
mvePete O'Hanlon30-Aug-13 22:04 
GeneralRe: Can we use memorycache in webservice running on different machine and client on other machine?(c#) Pin
santosh code31-Aug-13 0:34
santosh code31-Aug-13 0:34 
Question[Solved] Run application until Tasks are finished? Pin
Dralken30-Aug-13 13:54
Dralken30-Aug-13 13:54 
I'm writing an application that performs a few independant tasks in the background. It's a console application.

My issue is that when the program is run, it starts to execute some of the stuff on the threads (processes maybe 1-2 lines of code) then quits before all the tasks are finished (I'm using the Task library, rather than standard Threads)

Rather than cramming all of my code into the Main() function, I'm separating them out into different functions for readability.

If I add a Console.ReadKey() at the end of the Main function, all the tasks run properly (they only take maybe 1-2 seconds, though over time that could change to several minutes, as it's performing file operations) and close properly when I hit a button.

However, once I'm finished with it, I don't want to have make the user do any inputs (it's going to be a "scheduled" task), in fact the window won't even be shown.

Part of my problem is that, by the nature of my program, I can't ever be completely sure of how many tasks are going to be running. The program pulls in a list of what needs to be done from an xml file.

Is there a safe way to perhaps create a list of tasks, then at the end of the Main() function, have it wait till all those tasks are complete before the program closes?

I tried using a
List<Task>
but it didn't seem very safe, as I'd be building the array with other functions then doing a foreach() on the list and starting each task.

modified 31-Aug-13 7:33am.

AnswerRe: Run application until Tasks are finished? Pin
Dave Kreskowiak30-Aug-13 14:57
mveDave Kreskowiak30-Aug-13 14:57 
GeneralRe: Run application until Tasks are finished? Pin
Dralken30-Aug-13 15:16
Dralken30-Aug-13 15:16 
GeneralRe: Run application until Tasks are finished? Pin
Dave Kreskowiak30-Aug-13 15:28
mveDave Kreskowiak30-Aug-13 15:28 

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.