|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Junior Member
Iscritto dal: Feb 2009
Messaggi: 18
|
c# processo che blocca programma
Codice:
System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents=false; proc.StartInfo.FileName="ffmpeg"; proc.StartInfo.Arguments = " -i " + ultimo_file + " -target pal-dvd " + percorsoMPEG + zeri + numfiles2 + "_" + lbldataeora.Text + ".mpg"; proc.Start(); proc.WaitForExit(); Grazie |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Feb 2003
Città: Stockholm (SE)
Messaggi: 1343
|
Prova ad usare la TPL per spawnare un altro thread.
Codice:
Task.Factory.CreateNew(() =>
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents=false;
proc.StartInfo.FileName="ffmpeg";
proc.StartInfo.Arguments = " -i " + ultimo_file + " -target pal-dvd " + percorsoMPEG + zeri + numfiles2 + "_" + lbldataeora.Text + ".mpg";
proc.Start();
proc.WaitForExit();
});
Ultima modifica di Kralizek : 03-05-2011 alle 11:45. |
|
|
|
|
|
#3 |
|
Junior Member
Iscritto dal: Feb 2009
Messaggi: 18
|
Provato ma mi restituisce:
Codice:
Errore 4 Il nome 'Task' non esiste nel contesto corrente |
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Feb 2003
Città: Stockholm (SE)
Messaggi: 1343
|
devi usare
Codice:
using System.Threading.Tasks; |
|
|
|
|
|
#5 |
|
Junior Member
Iscritto dal: Feb 2009
Messaggi: 18
|
Il .net 4 posso usarlo anche in VS2008 ?
|
|
|
|
|
|
#6 |
|
Member
Iscritto dal: Dec 2005
Città: Provincia di Vicenza
Messaggi: 174
|
|
|
|
|
|
|
#7 |
|
Junior Member
Iscritto dal: Feb 2009
Messaggi: 18
|
Codice:
Task.Factory.CreateNew(() =>
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents=false;
proc.StartInfo.FileName="ffmpeg";
proc.StartInfo.Arguments = " -i " + ultimo_file + " -target pal-dvd " + percorsoMPEG + zeri + numfiles2 + "_" + lbldataeora.Text + ".mpg";
proc.Start();
proc.WaitForExit();
});
Codice:
CreateNew Codice:
StartNew |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 12:47.



















