Powershell 如何使用Windows Netcat发送回车?
我也希望直接在Powershell提示符中键入,而不是在文本文件中键入管道 富尔不适合我。例如:Powershell 如何使用Windows Netcat发送回车?,powershell,carriage-return,netcat,Powershell,Carriage Return,Netcat,我也希望直接在Powershell提示符中键入,而不是在文本文件中键入管道 富尔不适合我。例如: echo "RJ`r`n" | .\nc.exe -u 192.168.1.247 2639 但我真正想做的是 .\nc.exe -u 192.168.1.247 2639 然后开始在提示中键入内容。尝试: "Foo`ndoes work for me" 如果需要完整的CRLF序列,则: "Foo`r`ndoes work for me" 请注意,转义字符仅在双引号字符串中工作,而不是在
echo "RJ`r`n" | .\nc.exe -u 192.168.1.247 2639
但我真正想做的是
.\nc.exe -u 192.168.1.247 2639
然后开始在提示中键入内容。尝试:
"Foo`ndoes work for me"
如果需要完整的CRLF序列,则:
"Foo`r`ndoes work for me"
请注意,转义字符仅在双引号字符串中工作,而不是在单引号字符串中工作
更新:在
using System;
public class App
{
public static void Main()
{
int ch;
while ((ch = Console.In.Read()) != -1)
{
Console.Write((char)ch);
}
}
}
PS> "foo`r`n" | .\echostdin.exe
foo
PS>