我想将备忘录中填充的动态网关 IP 捕获到文本框中。如何使用通配符或捕获以“网关:10.127.*.*”开头的整行网关并将网关 IP 获取到文本框。
以下是已捕获的备忘录文本示例:
Description: Microsoft Hosted Network Virtual Adapter
HW Address Length: 6
HWAddress: E0:2A:82:F9:B2:3E
Index: 32
Type: 71
CurrentIPAddress:
IP Addresses: 192.168.48.1/255.255.255.0
Gateway: 0.0.0.0/255.255.255.255
Name: {22712B8F-5E3A-48D4-8C0D-771708BF0305}
Description: HUAWEI Mobile Connect - Network Card
HW Address Length: 6
HWAddress: 0C:5B:8F:27:9A:64
Index: 4
Type: 243
CurrentIPAddress:
IP Addresses: 10.127.144.193/255.255.255.252
Gateway: 10.127.144.194/255.255.255.255
编辑:(来自评论)
I:= Pos('Gateway: 10.127.', Memo1.Text);
if I > 0 then begin
L := SendMessage(Memo1.Handle, EM_LINEFROMCHAR, (intTostr(1));
edit1.Text:=(intTostr(L));