/// <summary>
    /// 设定单元格字体颜色

    /// </summary>
    /// <param name="wSheet"></param>
    /// <param name="rows"></param>
    /// <param name="cols"></param>
    /// <param name="rColor"></param>
    public void SetCellFontColor(Worksheet wSheet, int rows, int cols, ExcelColorIndex rColor)    //会修改上一行及指定行?
    {
        try
        {
            if (wSheet == null)
            {
                throw new Exception("工作表为空");
            }
            Range eRange = wSheet.get_Range(wSheet.Cells[rows, cols], wSheet.Cells[rows, cols]);
            eRange.Font.ColorIndex = rColor;
        }
        catch (Exception excep)
        {
            throw new Exception("设置指定单元格字体颜色失败,可能原因为:" + excep.Message);
        }
    }
    /// <summary>
    /// 设置某行背景色

    /// </summary>
    /// <param name="wSheet">工作表</param>
    /// <param name="rows">行数</param>
    /// <param name="rColor">颜色</param>
    public void SetRowBackgroundColor(Worksheet wSheet, int rows, ExcelColorIndex rColor)
    {
        try
        {
            if (wSheet == null)
            {
                throw new Exception("工作表为空");
            }
            Range eRange = ((Range)wSheet.Rows[rows.ToString() + ":" + rows.ToString(), System.Type.Missing]);
            eRange.Interior.ColorIndex = rColor;
        }
        catch (Exception excep)
        {
            throw new Exception("设置指定行背景色失败,可能原因为:" + excep.Message);
        }
    }
    /// <summary>
    /// 指定单元格的背景色

    /// </summary>
    /// <param name="wSheet"></param>
    /// <param name="rows"></param>
    /// <param name="cols"></param>
    /// <param name="rColor"></param>
    public void SetCellBackgroundColor(Worksheet wSheet, int rows, int cols, ExcelColorIndex rColor)
    {
        try
        {
            if (wSheet == null)
            {
                throw new Exception("工作表为空");
            }
            //Excel.Range eRange = wSheet.get_Range(wSheet.Cells[rows, cols], wSheet.Cells[rows, cols]);
            Range eRange = (Range)wSheet.Cells.get_Item(rows, cols);
            eRange.Interior.ColorIndex = rColor;
        }
        catch (Exception excep)
        {
            throw new Exception("设置指定单元格背景色失败,可能原因为:" + excep.Message);
        }
    }
    public void SetRowFontColor(Worksheet wSheet, int iRow, ExcelColorIndex rColor)
    {
        try
        {
            if (wSheet == null)
            {
                throw new Exception("工作表为空");
            }

            int iCol = GetColumnsCount(wSheet);

            Range eRange = ((Range)wSheet.get_Range(wSheet.Cells[iRow, 1], wSheet.Cells[iRow, iCol]));
            eRange.Font.ColorIndex = rColor;
        }
        catch (Exception excep)
        {
            throw new Exception("设置指定行背景色失败,可能原因为:" + excep.Message);
        }
    }