Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当 CSharpScript(Rosslyn) 运行该脚本时,托管进程是否可以捕获由 vbScript 或 cs-script 生成的输出?
我在 C# 中运行罗斯林脚本。我想记录脚本生成的控制台或跟踪输出。我在 System.Console 中期待类似于 OpenStandardOutput 的东西,但我没有找到它。
当您的 CSharpScript 被执行时,它只是在您的调用进程中作为代码运行。如果要捕获其输出,可以使用启动新进程的技术来运行脚本并重定向其输出。
试试这个链接。