首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 技术专题 | 电子书下载 | 教学视频 | 网页设计 | 平面设计 | 搜索 | 博客 | 论坛
中国IT实验室Dotnet频道
中国IT教育
首页 ASP.NET  C#  XML/WebService ADO.NET VC.NET VB.NET .NET 资讯动态 专题 RSS订阅 讨论 下载
您现在的位置: 中国IT实验室 >> Dotnet >> C# >> 文章正文

展现C#世界之九:配置和调度

文章来源ChinaItLab 作者佚名 更新时间2007-11-29 保存本文保存本文 推荐给好友推荐给好友 收藏本页收藏本页

  清单 9.5 利用 <summary>, <see>, <para>, and <seealso> 标签描述一个成员

  1: using System;

  2: using System.Net;

  3: using System.IO;

  4: using System.Text;

  5:

  6: /// <summary>Class to tear a Webpage from a Webserver</summary>

  7: public class RequestWebPage

  8: {

  9: private const int BUFFER_SIZE = 128;

  10:

  11: /// <summary>m_strURL stores the URL of the Webpage</summary>

  12: private string m_strURL;

  13:

  14: /// <summary>RequestWebPage() is the constructor for the class

  15: /// <see cref="RequestWebPage"/> when called without arguments.</summary>

  16: public RequestWebPage()

  17: {

  18: }

  19:

  20: /// <summary>RequestWebPage(string strURL) is the constructor for the class

  21: /// <see cref="RequestWebPage"/> when called with an URL as parameter.</summary>

  22: public RequestWebPage(string strURL)

  23: {

  24: m_strURL = strURL;

  25: }

  26:

  27: public string URL

  28: {

  29: get { return m_strURL; }

  30: set { m_strURL = value; }

  31: }

  32:

  33: /// <summary>The GetContent(out string strContent) method:

  34: /// <para>Included in the <see cref="RequestWebPage"/> class</para>

  35: /// <para>Uses variable <see cref="m_strURL"/></para>

  36: /// <para>Used to retrieve the content of a Webpage. The URL

  37: /// of the Webpage (including http://) must already be

  38: /// stored in the private variable m_strURL.

  39: /// To do so, call the constructor of the RequestWebPage

  40: /// class, or set its property <see cref="URL"/> to the URL string.</para>

  41: /// </summary>

  42: /// <seealso cref="System.Net"/>

  43: /// <seealso cref="System.Net.WebResponse"/>

  44: /// <seealso cref="System.Net.WebRequest"/>

  45: /// <seealso cref="System.Net.WebRequestFactory"/>

  46: /// <seealso cref="System.IO.Stream"/>

  47: /// <seealso cref="System.Text.StringBuilder"/>

  48: /// <seealso cref="System.ArgumentException"/>

  49:

  50: public bool GetContent(out string strContent)

  51: {

  52: strContent = "";

  53: // ……

  54: return true;

  55: }

  56: }

  9.2.2 添加备注和列表

  <remarks> 标签是规定大量文档的地方。与之相比, <summary>只仅仅规定了成员的简短描述。

  你不限于只提供段落文本(使用<para>标签)。例如,你可以在备注部分包含bulleted(和有限偶数)列表

  (list):

  /// <list type="bullet">

  /// <item>Constructor

  /// <see cref="RequestWebPage()"/> or

  /// <see cref="RequestWebPage(string)"/>

  /// </item>

  /// </list>

  这个list有一项(item),且该item引用了两个不同的构造函数描述。你可以根据需要,任意往list item中添加内容。

  另一个在备注部分很好用的标签是<paramref>.例如,你可以用<paramref>来引用和描述传递给构造函数的参数:

  /// <remarks>Stores the URL from the parameter /// <paramref name="strURL"/> in

  /// the private variable <see cref="m_strURL"/>.</remarks>

  public RequestWebPage(string strURL)

  在清单9.6中,你可以看到所有的这些以及前面的标签正在起作用。

上一页  [1] [2] [3] [4] [5] 下一页  

【责编:John】

中国IT教育

相关产品和培训
文章评论
 友情推荐链接
 认证培训
 社区讨论
 博客论点
 Dotnet频道相关导航