天長地久有時盡,此"當"綿綿無絕期...
試TryCatch大約當了10幾次....
1.建立一個Sequential Workflow Console Application
2.新增一個Arguments

3.加一個TryCatch

4.雙擊TryCatch,在Try區塊加入一個WriteLine

5.設WriteLine的Text屬性

6.拖曳Catch'1到Catches

7.選Exception類型

8.選NullReferenceException

9.拖曳WriteLine到Catches,設定:

10.加入程式至Program.cs
1 Dictionary<string, object> input =
2 new Dictionary<string, object>() { { "name", null } };
3 WorkflowInstance myInstance = new WorkflowInstance(new Sequence1(),input);
11.執行觸發Exception
1 則留言:
張貼留言