导航:
论坛 -> DELPHI技术
斑竹:liumazi,sephil
作者:
2021/5/25 13:55:21
标题:
另外请教一下各位大师,有没有实现字符终端的控件,类似cmd窗口,telnet窗口 那样的控件 ?
浏览:2116
加入我的收藏
楼主:
另外请教一下各位大师,有没有实现字符终端的控件,类似cmd窗口,telnet窗口 那样的控件 ?
----------------------------------------------
-
作者:
2021/5/25 14:31:31
1楼:
indy的idTelnet
----------------------------------------------
▄︻┻┳═
作者:
2021/5/25 15:27:17
2楼:
@lyp8899: 谢谢。 只是, idtelnet是telnet协议,不是可以用来输出的终端窗口
----------------------------------------------
-
作者:
2021/5/25 17:41:48
3楼:
自己画一个嘛...不就是黑色背景的MEMO嘛.
----------------------------------------------
恭喜发财
作者:
msfm (清洁工)
★☆☆☆☆
-
盒子活跃会员
2021/5/25 22:54:54
4楼:
AllocConsole
----------------------------------------------
-
作者:
2021/5/26 9:44:12
5楼:
ICS 通信组件包有一个 TTnEmulVT , 具体看 telnet 客户端 demo
----------------------------------------------
delphi 是兴趣,和工作无关,即使它倒闭。又不靠它 delphi 吃饭,怕甚?
作者:
2021/5/26 9:44:15
5楼:
直接编译成控制台工程就是命令行了。 还是说你想模拟一个cmd?cmd其实是一个虚拟机,你在cmd里输入的所有命令,例如ping、telnet、ipconfig这些其实都是独立的应用程序,如果你想模拟一个类似cmd的全功能的控制台终端的话,那工作量太大了。
----------------------------------------------
--
作者:
omvm ( )
★☆☆☆☆
-
盒子活跃会员
2021/5/26 12:06:26
6楼:
第一个五楼正解,最近好像出现了重复楼层问题
----------------------------------------------
-
作者:
2021/5/26 12:41:03
7楼:
uses JclSysUtils; 里头有个函数: function Execute(const CommandLine: string; OutputLineCallback: TTextHandler; RawOutput: Boolean = False; AbortPtr: PBoolean = nil): Cardinal; 输出回调的函数头: TTextHandler = procedure(const Text: string) of object; 这是最简单的方法
----------------------------------------------
-
作者:
2021/5/26 13:34:39
8楼:
坛子里有 自己搜. 我最少看到两个帖子讨论 并发了代码
----------------------------------------------
[alias] co = clone --recurse-submodules up = submodule update --init --recursiveupd = pullinfo = statusrest = reset --hard懒鬼提速https://www.cctry.com/ >http://qalculate.github.io/downloads.htmlhttps://www.cctry.com/
作者:
2021/6/4 11:22:36
9楼:
https://github.com/t-edson/Tito-s-Terminal 这里这里
----------------------------------------------
-
作者:
2021/6/7 14:47:30
10楼:
谢谢各位 @bahamut8348: 我需要的是一个能显示telnet输出的转义语意的图形窗口,并且能把控制键转义成终端指令供我发送。 没接触过的人可能很难明白我意思
----------------------------------------------
-
作者:
2021/6/7 19:52:42
11楼:
你搜搜 LockBox,我记得,做这个控件的那家公司,以前的控件里面有终端控件。后来全部开源了。不知道我是否记错。
----------------------------------------------
-
作者:
2021/6/12 2:22:45
12楼:
synedit,设置背景黑色 procedure TFormMain.AddMessage(const Bytes: TBytes); var PosBegin : Integer = 0; PosEnd: Integer = 0; S: AnsiString; begin if Length(Bytes) = 0 then CommandOutputScreen.Lines.Append('') else begin while PosBegin < Length(Bytes) do begin while PosEnd < Length(Bytes) do begin if Bytes[PosEnd] = 10 then begin if LastEolByte = 10 then begin CommandOutputScreen.Lines.Append(''); FCurRow := CommandOutputScreen.Lines.Count -1; end; S := TEncoding.Ansi.GetAnsiString(Bytes, PosBegin, PosEnd - PosBegin); CommandOutputScreen.Lines[FCurRow] := S; Inc(PosEnd); LastEolByte := 10; Break; end else if Bytes[PosEnd] = 13 then begin if LastEolByte = 10 then begin CommandOutputScreen.Lines.Append(''); FCurRow := CommandOutputScreen.Lines.Count -1; end; S := TEncoding.Ansi.GetAnsiString(Bytes, PosBegin, PosEnd - PosBegin); CommandOutputScreen.Lines[FCurRow] := S; Inc(PosEnd); LastEolByte := 13; Break; end else begin Inc(PosEnd); end; end; // PosBegin := PosEnd; end; if PosBegin <> PosEnd then begin S := TEncoding.Ansi.GetAnsiString(Bytes, PosBegin, PosEnd - PosBegin); CommandOutputScreen.Lines.Append(S); end; end; CommandOutputScreen.CaretX := 0; CommandOutputScreen.CaretY := CommandOutputScreen.Lines.Count; Application.ProcessMessages; end;
----------------------------------------------
-
作者:
2021/6/12 13:06:49
13楼:
楼主是不是需要下面的东西? 下面是我很多年前收集来的代码,已找不到出处了 ========== Delphi调用Cmd并取得输出字符 最近想做个调用CMD命令并取得结果的程序··找了一下··共享代码 procedure CheckResult(b: Boolean); begin if not b then raise Exception.Create(SysErrorMessage(GetLastError)); end; function RunDOS(const CommandLine: string): string; var HRead, HWrite: THandle; StartInfo: TStartupInfo; ProceInfo: TProcessInformation; b: Boolean; sa: TSecurityAttributes; inS: THandleStream; sRet: TStrings; begin Result := ''; FillChar(sa, sizeof(sa), 0); //设置允许继承,否则在NT和2000下无法取得输出结果 sa.nLength := sizeof(sa); sa.bInheritHandle := True; sa.lpSecurityDescriptor := nil; b := CreatePipe(HRead, HWrite, @sa, 0); CheckResult(b); FillChar(StartInfo, SizeOf(StartInfo), 0); StartInfo.cb := SizeOf(StartInfo); StartInfo.wShowWindow := SW_HIDE; //使用指定的句柄作为标准输入输出的文件句柄,使用指定的显示方式 StartInfo.dwFlags := STARTF_USESTDHANDLES or STARTF_USESHOWWINDOW; StartInfo.hStdError := HWrite; StartInfo.hStdInput := GetStdHandle(STD_INPUT_HANDLE); //HRead; StartInfo.hStdOutput := HWrite; b := CreateProcess(nil, //lpApplicationName: PChar PChar(CommandLine), //lpCommandLine: PChar nil, //lpProcessAttributes: PSecurityAttributes nil, //lpThreadAttributes: PSecurityAttributes True, //bInheritHandles: BOOL CREATE_NEW_CONSOLE, nil, nil, StartInfo, ProceInfo); CheckResult(b); WaitForSingleObject(ProceInfo.hProcess, INFINITE); inS := THandleStream.Create(HRead); if inS.Size > 0 then begin sRet := TStringList.Create; sRet.LoadFromStream(inS); Result := sRet.Text; sRet.Free; end; inS.Free; CloseHandle(HRead); CloseHandle(HWrite); end; 使用方法也很简单···就是调用Function;
----------------------------------------------
http://www.lsworks.net
作者:
2021/6/12 13:11:10
14楼:
或者是这个? https://blog.csdn.net/earbao/article/details/21160033
----------------------------------------------
http://www.lsworks.net
作者:
glwang (glwang)
★☆☆☆☆
-
盒子活跃会员
2021/6/17 13:08:10
15楼:
https://mitov.com/products/megalab#components CL终端 CL终端 文本终端组件
----------------------------------------------