22/09/11 11:54
zerolife
Ciao a tutti, volevo creare un programma che quando si avvii, non faccia apparire il terminale ho usato system.diagnostic, come si puo' vedere nel programma. Ho messo anche la stampa di 100 "ciao mondo" ma ho un problema, il terminale si apre e stampa i 100 "ciao mondo".
Chiedo se qualcuno potrebbe spiegarmi meglio queste funzioni. Grazie.
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace diagnostica
{
class Program
{
static void Main(string[] args)
{
Process ProcessObj = new Process();
// These two optional flags ensure that no DOS window
// appears
ProcessObj.StartInfo.UseShellExecute = false;
ProcessObj.StartInfo.CreateNoWindow = true;
// If this option is set the DOS window appears again :-/
ProcessObj.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
for (int i = 0; i < 100; i++)
{
Console.WriteLine("ciao mondo"
}
}
}
}
Chiedo se qualcuno potrebbe spiegarmi meglio queste funzioni. Grazie.
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace diagnostica
{
class Program
{
static void Main(string[] args)
{
Process ProcessObj = new Process();
// These two optional flags ensure that no DOS window
// appears
ProcessObj.StartInfo.UseShellExecute = false;
ProcessObj.StartInfo.CreateNoWindow = true;
// If this option is set the DOS window appears again :-/
ProcessObj.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
for (int i = 0; i < 100; i++)
{
Console.WriteLine("ciao mondo"
}
}
}
}
aaa