以 .NET Framework 進行網路追蹤Network Tracing in the .NET Framework

針對方法叫用及 Managed 應用程式所產生的網路流量,.NET Framework 中的網路追蹤能提供對這些相關資訊的存取。Network tracing in the .NET Framework provides access to information about method invocations and network traffic generated by a managed application. 若要為開發中的應用程式進行偵錯,以及分析已部署的應用程式,此功能會非常有用。This feature is useful for debugging applications under development as well as for analyzing deployed applications. 您可以自訂網路追蹤所提供的輸出,在程式開發時期和實際執行環境中支援不同的使用案例。The output provided by network tracing is customizable to support different usage scenarios at development time and in a production environment.

若要啟用 .NET Framework 中的網路追蹤,您必須為追蹤輸出選取一個目的地,並在應用程式或電腦組態檔中加入網路追蹤組態設定。To enable network tracing in the .NET Framework, you must select a destination for tracing output and add network tracing configuration settings to either the application or machine configuration file. 如需組態檔和其使用方式的描述,請參閱組態檔For descriptions of configuration files and how they are used, see Configuration Files. 如需如何啟用網路追蹤的資訊,請參閱啟用網路追蹤For information about how to enable network tracing, see Enabling Network Tracing. 如需組態檔之必要新增設定的資訊,請參閱如何:設定網路追蹤For information about the settings that you need to add to the configuration file, see How to: Configure Network Tracing.

啟用追蹤之後,您就可以擷取 System.Net 類別所輸出的追蹤資訊。When tracing is enabled, you can capture trace information that is output by System.Net classes. 可產生追蹤資訊的網路類別成員在它們的 .NET Framework 類別庫文件的<備註>一節中會包含下面附註:Networking class members that generate tracing information include the following note in the Remarks section of their NET Framework class library documentation:

注意

在應用程式中啟用網路追蹤時,這個成員會輸出追蹤資訊。This member outputs trace information when you enable network tracing in your application. 如需詳細資訊,請參閱<網路追蹤>。For more information, see Network Tracing.

另請參閱See also