Autor Beitrag
Ccenter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 154

Win7
C#
BeitragVerfasst: So 31.10.10 16:53 
Moin,
ich wüsste gerne wie ich die Ausgabe eines Cmd-Befehls in eine Textbox bekomme.
Wenn ich einen Cmd-Befehl aufrufe,
ausblenden C#-Quelltext
1:
Process.Start("ping", Ip);					

wird nur ein Konsolenfenster geöffnet und dort das Ergebniss des Befehls angezeigt. Das würde ich gerne in eine Textbox umlenken.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 31.10.10 18:33 
Hallo!

Schau mal hier: msdn.microsoft.com/e....standardoutput.aspx
Insbesondere die Beispiele weiter unten auf der Seite.

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".

Für diesen Beitrag haben gedankt: Ccenter
Ccenter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 154

Win7
C#
BeitragVerfasst: So 31.10.10 18:56 
Danke, läuft.
Wo ich allerdings noch ein Problem hab: Ich hab ebend versucht "net user" auf zu rufen jedoch findet er das Programm nicht. Was mach ich da falsch?

ausblenden C#-Quelltext
1:
 ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("net user");					
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: So 31.10.10 19:13 
Die Exe heißt "net", "user" ist ein Parameter.

_________________
>λ=
Ccenter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 154

Win7
C#
BeitragVerfasst: So 31.10.10 19:20 
Jep, jetzt geht's :D
Danke ;)