uNkn0wn_d4_r3aL hat folgendes geschrieben: |
öhm,
ja wie binde ich die TDosCommans-Kompontente genau ein? |
Zitat: |
How to use it : --------------- - just put the line of command in the property 'CommandLine' - execute the process with the method 'Execute' - if you want to stop the process before it has ended, use the method 'Stop' - if you want the process to stop by itself after XXX sec of activity, use the property 'MaxTimeAfterBeginning' - if you want the process to stop after XXX sec without an output, use the property 'MaxTimeAfterLastOutput' - to directly redirect outputs to a memo or a richedit, ... use the property 'OutputLines' (DosCommand1.OutputLnes := Memo1.Lines;) - you can access all the outputs of the last command with the property 'Lines' - you can change the priority of the process with the property 'Priority' value of Priority must be in [HIGH_PRIORITY_CLASS, IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, REALTIME_PRIORITY_CLASS] - you can have an event for each new line and for the end of the process with the events 'procedure OnNewLine(Sender: TObject; NewLine: string; OutputType: TOutputType);' and 'procedure OnTerminated(Sender: TObject);' - you can send inputs to the dos process with 'SendLine(Value: string; Eol: Boolean);'. Eol is here to determine if the program have to add a CR/LF at the end of the string. ******************************************************************* How to call a dos function (win 9x/Me) : ---------------------------------------- Example : Make a dir : ---------------------- - if you want to get the result of a 'c:\dir /o:gen /l c:\windows\*.txt' for example, you need to make a batch file --the batch file : c:\mydir.bat @echo off dir /o:gen /l %1 rem eof --in your code DosCommand.CommandLine := 'c:\mydir.bat c:\windows\*.txt'; DosCommand.Execute; Example : Format a disk (win 9x/Me) : ------------------------- --a batch file : c:\myformat.bat @echo off format %1 rem eof --in your code var diskname: string; -- DosCommand1.CommandLine := 'c:\myformat.bat a:'; DosCommand1.Execute; //launch format process DosCommand1.SendLine('', True); //equivalent to press enter key DiskName := 'test'; DosCommand1.SendLine(DiskName, True); //enter the name of the volume |
Zitat: |
DosCommand.CommandLine := 'c:\mydir.bat c:\windows\*.txt';
DosCommand.Execute; |
1: | procedure TForm1.Button1Click(Sender: TObject); |
uNkn0wn_d4_r3aL hat folgendes geschrieben: |
=> fehler: Undefinierter Bezeichner "CommandLine" |
1: | TDosCommand = class(TComponent) //the component to put on a form |
uNkn0wn_d4_r3aL hat folgendes geschrieben: |
wie muss ich die kompontene genau in mein programm einbinden? |
uNkn0wn_d4_r3aL hat folgendes geschrieben: |
ja, wir prechen vom selben!
wie muss ich die kompontene genau in mein programm einbinden? vielleicht ist da der fehler. |
Entwickler-Ecke.de based on phpBB
Copyright 2002 - 2011 by Tino Teuber, Copyright 2011 - 2025 by Christian Stelzmann Alle Rechte vorbehalten.
Alle Beiträge stammen von dritten Personen und dürfen geltendes Recht nicht verletzen.
Entwickler-Ecke und die zugehörigen Webseiten distanzieren sich ausdrücklich von Fremdinhalten jeglicher Art!