我mscorlib.xml
(我注意到從摘要生成的XML文件),它包含:文檔化在C#代碼的異常
<member name="M:System.Console.ReadKey">
<summary>Obtains the next character or function key pressed by the user. The pressed key is displayed in the console window.</summary>
<returns>A <see cref="T:System.ConsoleKeyInfo" /> object that describes the <see cref="T:System.ConsoleKey" /> constant and Unicode character, if any, that correspond to the pressed console key. The <see cref="T:System.ConsoleKeyInfo" /> object also describes, in a bitwise combination of <see cref="T:System.ConsoleModifiers" /> values, whether one or more SHIFT, ALT, or CTRL modifier keys was pressed simultaneously with the console key.</returns>
<exception cref="T:System.InvalidOperationException">The <see cref="P:System.Console.In" /> property is redirected from some stream other than the console.</exception>
<filterpriority>1</filterpriority>
</member>
從這個例子中,我在特別感興趣:
<exception cref="T:System.InvalidOperationException">The <see cref="P:System.Console.In" /> property is redirected from some stream other than the console.</exception>
如何在代碼中記錄異常,以便它們以XML結尾?
奇怪的問題,因爲你已經給自己答案:-) – Steven