Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   C# Process.Start() (https://www.delphipraxis.net/52026-process-start.html)

faux 22. Aug 2005 21:50


Process.Start()
 
Hallo!

Wieso funktioniert beim folgenden Code nur dir 1. Möglichkeit?

Danke schon mal
Grüße Faux

Code:
Process process = [b][color=darkblue]new[/color][/b] Process();
process.StartInfo.FileName = textBox1.Text;
process.Start();
Code:
Process process = [b][color=darkblue]new[/color][/b] Process();
process.Start(textBox1.Text); [color=green]//Start ist doch auch mit[/color] [b][color=darkblue]string[/color][/b] fileName [color=green]überladen, oder ist das nicht das Selbe wie StartInfo.FileName?[/color]

Robert_G 22. Aug 2005 22:39

Re: Process.Start()
 
Warum sollten die nicht gehen? :gruebel:

Code:
using (Process process = Process.Start("cmd"))
{ }

using (Process process = new Process())
{
   process.StartInfo.FileName = "cmd";
   process.Start();
}
Wobei das using hier nicht nötig wäre...

faux 22. Aug 2005 22:46

Re: Process.Start()
 
Wenn ich das 2. Beispiel von mir mache, regt er sich auf, dass kein Pfad definiert ist.


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:10 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz