O'Reilly logo

Microsoft Windows Workflow Foundation 4.0 Cookbook by Andrew Zhu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A number guessing game in Sequence

In this task, we will create a guess number game in the Sequence activity. This task will also demonstrate the usage of the DoWhile and IfElse activities.

How to do it...

  1. Create a workflow project:

    Create a Workflow Console Application and name it GuessNumberGameInSequence.

  2. Create a ReadNumberActivity to receive your guess number:

    Create a new code file, name it ReadNumberActivity.cs, and fill the file with the following code:

    using System; using System.Activities; namespace GuessNumberGameInSequence { public sealed class ReadNumberActivity : CodeActivity { public OutArgument<int> OutNumber { get; set; } protected override void Execute(CodeActivityContext context) { OutNumber.Set(context, Int32.Parse(Console.ReadLine())); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required