今天使用到了C#的抽象函数,在继承的时候出了些问题,特此记录:
首先注意几个概念:
1、c#的抽象函数必须声明在抽象类中,即类前面要加:abstract关键字;
2、抽象函数不能有具体实现部分;
3、抽象函数在派生类中必须被重写,即派生类中要加:override关键字,并实现抽象函数;
简单记录一下今天测试的类:
基类:
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Specialized;
using System.Web;
namespace BLL
{
public abstract class ReponseHandle
{
/// <summary>
/// 当前的上下文
/// </summary>
protected HttpContext _context = null;
protected NameValueCollection _webParameters;// 个性化参数
protected string _strRootPath;// 服务器根目录
protected string _strBugXmlPath;// 业务XML配置文件目录
#region 构造函数
/// <summary>
/// 构造函数
/// </summary>
/// <param name="