C# runs cmd to output messages in real time

How to let C# runs cmd to output messages in real time? Today, I use WinForm to write an automated tool software. I need to call cmd to run some batch scripts, and I need to output response messages in real time in another WinForm form. How to achieve it? This post answers that question with sample code.