0
我想下面的Python代码转换为C#转换蟒蛇struct.pack到C#
sys.stdout.write(struct.pack('I', len(message)))
sys.stdout.write(message)
sys.stdout.flush()
我需要的C#程序输出到控制台。尝试了以下,但C#和Python程序不输出相同 - struct.pack部分似乎搞砸了。
Stream stdout = Console.OpenStandardOutput();
stdout.WriteByte((byte)message.Length);
Console.Write(message);
任何想法如何解决它?谢谢!