Using Procedural Activities
The sample uses the Sequence, Assign, If, While, Switch<T>, TryCatch, and WriteLine activities to implement a guessing game. The guessing game selects a random number and the player has to guess that number. When the player submits an incorrect guess, the workflow provides a hint whether to guess higher or lower. If the player guesses the number in less than 7 attempts, a special congratulations is displayed to the user.
Reads a line of text from the console. This activity derives from the NativeActivity class and creates a bookmark that is resumed by the console application when a line is read.
Using Visual Studio 2010, open the GuessingGame.sln solution file.
To build the solution, press CTRL+SHIFT+B.
To run the solution, press CTRL+F5.
The samples may already be installed on your machine. Check for the following (default) directory before continuing.
If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.