void MyThread()
        {
            int s = 0;            for (s = 0; s < 4; s++)
            {
                Thread th1;
                th1=new Thread(new ThreadStart(AutoPostDate));
                th1.Start();
                //th1.Join();
            }
          
        }我原本是创建四个线程..
  现在我不想用线程了,我想用进程,就是可以在进程管理器里面看到四个进程在运行
怎么创建呢,我记得以前VB6好像可以..

解决方案 »

  1.   

      [DllImport("advapi32.dll", CharSet = CharSet.Unicode)]
      BOOL CreateProcess(
      LPCTSTR lpApplicationName,
      LPTSTR lpCommandLine,
      LPSECURITY_ATTRIBUTES lpProcessAttributes,
      LPSECURITY_ATTRIBUTES lpThreadAttributes,
      BOOL bInheritHandles,
      DWORD dwCreationFlags,
      LPVOID lpEnvironment,
      LPCTSTR lpCurrentDirectory,
      LPSTARTUPINFO lpStartupInfo,
      LPPROCESS_INFORMATION lpProcessInformation
    );
     string argm = "cmd.exe";
                STARTUPINFO sInfo = new STARTUPINFO();
                PROCESS_INFORMATION pInfo = new PROCESS_INFORMATION();            if (!CreateProcess(null, new StringBuilder(argm), null, null, false, 0, null, null, ref sInfo, ref pInfo))  
      

  2.   

                    Process process = Process.Start(new StartInfo("c:/test.exe"));
      

  3.   

    ProcessStartInfo info = new ProcessStartInfo(TVars.StartupPath +  TVars.updateBatFile);
    info.WindowStyle = ProcessWindowStyle.Hidden;
    Process.Start(info);