当前位置: 首页>>代码示例>>C#>>正文


C# HSSFWorkbook.GetSheet方法代码示例

本文整理汇总了C#中NPOI.HSSF.UserModel.HSSFWorkbook.GetSheet方法的典型用法代码示例。如果您正苦于以下问题:C# HSSFWorkbook.GetSheet方法的具体用法?C# HSSFWorkbook.GetSheet怎么用?C# HSSFWorkbook.GetSheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NPOI.HSSF.UserModel.HSSFWorkbook的用法示例。


在下文中一共展示了HSSFWorkbook.GetSheet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getContractsFromExcel

        /// <summary>
        /// 读取文件获取合同信息
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static List<Contract> getContractsFromExcel(string fileName)
        {
            tFileName = fileName;
            List<Contract> list = new List<Contract>();

            FileStream f = new FileStream(fileName,FileMode.OpenOrCreate);
            Workbook workbook = new HSSFWorkbook(f);

            Sheet sheet = workbook.GetSheet("合同信息表");
            Row headerRow = sheet.GetRow(0);

            //判断是否是正确的协议存储文件
            if (headerRow.GetCell(0).ToString() != "协议类型")
            {
                statusLab = "Excel文件:" + fileName + " 不是正确的合同信息数据文件。";
                return null;
            }

            //读取协议内容
            for (int i = 1; i <= sheet.LastRowNum; i++)
            {
                Row dataRow = sheet.GetRow(i);
                Contract con = getContractFromRow(dataRow);

                if (con != null)
                {
                    list.Add(con);
                }
            }

            f.Close();
            f.Dispose();

            return list;
        }
开发者ID:holenzh,项目名称:CSharpProjAtYC,代码行数:40,代码来源:ExcelUtil.cs

示例2: Main

        static void Main(string[] args)
        {
            string strFilePath = string.Format("D:\\1.xls");

            HSSFWorkbook wk;
            using (FileStream fs = new FileStream(strFilePath, FileMode.Open, FileAccess.ReadWrite))
            {
                wk = new HSSFWorkbook(fs);
            }
            HSSFSheet hst;
            hst = (HSSFSheet)wk.GetSheet("執行情形統計表(里辦公處)");
            HSSFRow hr;

            int dlastrow = 0; dlastrow = hst.LastRowNum;
            #region Get Sheet Name

            string strSheetname = hst.SheetName;

            #endregion Get Sheet Name
            hr = (HSSFRow)hst.GetRow(0);
            int dLastNum = hr.LastCellNum;
            for (int j = 1; j <= hst.LastRowNum; j++)
            {
                hr = (HSSFRow)hst.GetRow(j);
                for (int i = 0; i < dLastNum; i++)//Column
                {
                    string strcell = hr.GetCell(i) == null ? "0" : hr.GetCell(i).ToString();
                }
            }
        }
开发者ID:JeremyShih,项目名称:-1,代码行数:30,代码来源:Program.cs

示例3: addRecord

        private static bool addRecord(float data)
        {
            try
            {
                //close the FileStream before specifying any changes in the HSSFSheet object
                FileStream fs = new FileStream(pathExcel, FileMode.Open, FileAccess.ReadWrite);
                HSSFWorkbook templateWorkbook = new HSSFWorkbook(fs);
                HSSFSheet sheet = (HSSFSheet)templateWorkbook.GetSheet("Arkusz1");
                fs.Close();

                DateTime current = DateTime.Now;
                DateTime thisDay = DateTime.Today;

                Row row = sheet.CreateRow(sheet.LastRowNum + 1);
                row.CreateCell(0).SetCellValue(data);
                row.CreateCell(1).SetCellValue(DateTime.Now.ToShortTimeString());
                row.CreateCell(2).SetCellValue(thisDay.ToString("d"));

                //reinitialize data before having the workbook object write to the Stream
                sheet.ForceFormulaRecalculation = true;
                fs = new FileStream(pathExcel, FileMode.Open, FileAccess.ReadWrite);
                templateWorkbook.Write(fs);
                fs.Close();
                return true;
            }
            catch
            {
                return false;
            }
        }
开发者ID:SwitchON,项目名称:Temperatura,代码行数:30,代码来源:Excel.cs

示例4: OnPostprocessAllAssets

    static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    {
        foreach (string asset in importedAssets)
        {
            if (!filePath.Equals(asset))
                continue;

            using (FileStream stream = File.Open (filePath, FileMode.Open, FileAccess.Read))
            {
                var book = new HSSFWorkbook(stream);

                foreach (string sheetName in sheetNames)
                {
                    var exportPath = "Assets/Resources/Data/" + sheetName + ".asset";
                    
                    // check scriptable object
                    var data = (Entity_daimyo_mst)AssetDatabase.LoadAssetAtPath(exportPath, typeof(Entity_daimyo_mst));
                    if (data == null)
                    {
                        data = ScriptableObject.CreateInstance<Entity_daimyo_mst>();
                        AssetDatabase.CreateAsset((ScriptableObject)data, exportPath);
                        data.hideFlags = HideFlags.NotEditable;
                    }
                    data.param.Clear();

					// check sheet
                    var sheet = book.GetSheet(sheetName);
                    if (sheet == null)
                    {
                        Debug.LogError("[QuestData] sheet not found:" + sheetName);
                        continue;
                    }

                	// add infomation
                    for (int i=1; i<= sheet.LastRowNum; i++)
                    {
                        IRow row = sheet.GetRow(i);
                        ICell cell = null;
                        
                        var p = new Entity_daimyo_mst.Param();
			
					cell = row.GetCell(0); p.daimyoId = (int)(cell == null ? 0 : cell.NumericCellValue);
					cell = row.GetCell(1); p.daimyoName = (cell == null ? "" : cell.StringCellValue);
					cell = row.GetCell(2); p.colorR = (int)(cell == null ? 0 : cell.NumericCellValue);
					cell = row.GetCell(3); p.colorG = (int)(cell == null ? 0 : cell.NumericCellValue);
					cell = row.GetCell(4); p.colorB = (int)(cell == null ? 0 : cell.NumericCellValue);
					cell = row.GetCell(5); p.busyoId = (int)(cell == null ? 0 : cell.NumericCellValue);
					cell = row.GetCell(6); p.senryoku = (int)(cell == null ? 0 : cell.NumericCellValue);

                        data.param.Add(p);
                    }
                    
                    // save scriptable object
                    ScriptableObject obj = AssetDatabase.LoadAssetAtPath(exportPath, typeof(ScriptableObject)) as ScriptableObject;
                    EditorUtility.SetDirty(obj);
                }
            }

        }
    }
开发者ID:zeimoter,项目名称:sengoku2d,代码行数:60,代码来源:daimyo_mst_importer.cs

示例5: RenderDataTableFromExcel

        public static DataTable RenderDataTableFromExcel(Stream ExcelFileStream, string SheetName, int HeaderRowIndex)
        {
            HSSFWorkbook workbook = new HSSFWorkbook(ExcelFileStream);
            HSSFSheet sheet = workbook.GetSheet(SheetName);

            DataTable table = new DataTable();

            HSSFRow headerRow = sheet.GetRow(HeaderRowIndex);
            int cellCount = headerRow.LastCellNum;

            for (int i = headerRow.FirstCellNum; i < cellCount; i++)
            {
                DataColumn column = new DataColumn(headerRow.GetCell(i).StringCellValue);
                table.Columns.Add(column);
            }

            int rowCount = sheet.LastRowNum;

            for (int i = (sheet.FirstRowNum + 1); i < sheet.LastRowNum; i++)
            {
                HSSFRow row = sheet.GetRow(i);
                DataRow dataRow = table.NewRow();

                for (int j = row.FirstCellNum; j < cellCount; j++)
                    dataRow[j] = row.GetCell(j).ToString();
            }

            ExcelFileStream.Close();
            workbook = null;
            sheet = null;
            return table;
        }
开发者ID:notinmood,项目名称:HilandCompany,代码行数:32,代码来源:DataTableRenderToExcel.cs

示例6: ExecuteResult

 public override void ExecuteResult(ControllerContext context)
 {
     var fs = new FileStream(context.HttpContext.Server.MapPath(
         @"\Content\UpdatePeople.xls"), FileMode.Open, FileAccess.Read);
     var wb = new HSSFWorkbook(fs, true);
     var sheet = wb.GetSheet("Sheet1");
     var r = 1;
     foreach (var p in UpdatePeopleRows())
     {
         var row = sheet.CreateRow(r++);
         var c = 0;
         row.CreateCell(c++).SetCellValue(p.PeopleId);
         row.CreateCell(c++).SetCellValue(p.Title);
         row.CreateCell(c++).SetCellValue(p.First);
         row.CreateCell(c++).SetCellValue(p.GoesBy);
         row.CreateCell(c++).SetCellValue(p.Last);
         row.CreateCell(c++).SetCellValue(p.Suffix);
         row.CreateCell(c++).SetCellValue(p.Email1);
         row.CreateCell(c++).SetCellValue(p.Email2);
         row.CreateCell(c++).SetCellValue(p.Gender);
         if (p.BirthDate.HasValue)
             row.CreateCell(c++).SetCellValue(p.BirthDate.Value);
         else
             row.CreateCell(c++, NPOI.SS.UserModel.CellType.Blank);
         if (p.Anniversary.HasValue)
             row.CreateCell(c++).SetCellValue(p.Anniversary.Value);
         else
             row.CreateCell(c++, NPOI.SS.UserModel.CellType.Blank);
         if (p.Joined.HasValue)
             row.CreateCell(c++).SetCellValue(p.Joined.Value);
         else
             row.CreateCell(c++, NPOI.SS.UserModel.CellType.Blank);
         row.CreateCell(c++).SetCellValue(p.Cell);
         row.CreateCell(c++).SetCellValue(p.Work);
         row.CreateCell(c++).SetCellValue(p.Member);
         if (p.Grade.HasValue)
             row.CreateCell(c++).SetCellValue(p.Grade.Value);
         else
             row.CreateCell(c++, NPOI.SS.UserModel.CellType.Blank);
         row.CreateCell(c++).SetCellValue(p.Marital);
         row.CreateCell(c++).SetCellValue(p.FamilyPos);
         row.CreateCell(c++).SetCellValue(p.AltName);
         row.CreateCell(c++).SetCellValue(p.Campus);
         row.CreateCell(c++).SetCellValue(p.School);
         row.CreateCell(c++).SetCellValue(p.Occupation);
         row.CreateCell(c++).SetCellValue(p.Employer);
         if (p.Deceased.HasValue)
             row.CreateCell(c++).SetCellValue(p.Deceased.Value);
         else
             row.CreateCell(c++, NPOI.SS.UserModel.CellType.Blank);
     }
     var Response = context.HttpContext.Response;
     Response.Buffer = true;
     Response.ContentType = "application/vnd.ms-excel";
     Response.AddHeader("Content-Disposition", "attachment;filename=UpdatePeople.xls");
     Response.Charset = "";
     wb.Write(Response.OutputStream);
 }
开发者ID:stevesloka,项目名称:bvcms,代码行数:58,代码来源:UpdatePeopleModel.cs

示例7: OnPostprocessAllAssets

    static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    {
        foreach (string asset in importedAssets) {
            if (!filePath.Equals (asset))
                continue;

            Entity_Job data = (Entity_Job)AssetDatabase.LoadAssetAtPath (exportPath, typeof(Entity_Job));
            if (data == null) {
                data = ScriptableObject.CreateInstance<Entity_Job> ();
                AssetDatabase.CreateAsset ((ScriptableObject)data, exportPath);
                data.hideFlags = HideFlags.NotEditable;
            }

            data.sheets.Clear ();
            using (FileStream stream = File.Open (filePath, FileMode.Open, FileAccess.Read)) {
                IWorkbook book = new HSSFWorkbook (stream);

                foreach(string sheetName in sheetNames) {
                    ISheet sheet = book.GetSheet(sheetName);
                    if( sheet == null ) {
                        Debug.LogError("[QuestData] sheet not found:" + sheetName);
                        continue;
                    }

                    Entity_Job.Sheet s = new Entity_Job.Sheet ();
                    s.name = sheetName;

                    for (int i=1; i<= sheet.LastRowNum; i++) {
                        IRow row = sheet.GetRow (i);
                        ICell cell = null;

                        Entity_Job.Param p = new Entity_Job.Param ();

                    cell = row.GetCell(0); p.id = (int)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(1); p.name = (cell == null ? "" : cell.StringCellValue);
                    cell = row.GetCell(2); p.lv = (int)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(3); p.difficult = (int)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(4); p.attack = (float)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(5); p.defens = (float)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(6); p.sp = (int)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(7); p.cooltime = (float)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(8); p.casttime = (float)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(9); p.effect = (float)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(10); p.point = (int)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(11); p.bonus = (float)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(12); p.type = (int)(cell == null ? 0 : cell.NumericCellValue);
                        s.list.Add (p);
                    }
                    data.sheets.Add(s);
                }
            }

            ScriptableObject obj = AssetDatabase.LoadAssetAtPath (exportPath, typeof(ScriptableObject)) as ScriptableObject;
            EditorUtility.SetDirty (obj);
        }
    }
开发者ID:GochiMMO,项目名称:MMO,代码行数:56,代码来源:SkillData_importer.cs

示例8: ReadExcle

        public string ReadExcle(string path = @"~/up/b.xls", int from = 1)
        {
            HSSFWorkbook _book = new HSSFWorkbook();
            string xlsPath = System.Web.HttpContext.Current.Server.MapPath(path);

            FileStream file = new FileStream(xlsPath, FileMode.Open, FileAccess.Read);
            IWorkbook hssfworkbook = new HSSFWorkbook(file);
            ISheet sheet = hssfworkbook.GetSheet("Sheet1");
            string guid = Guid.NewGuid().ToString();
            string saveFileName = xlsPath.Path(guid);

            StringBuilder sb2 = new StringBuilder();

            string courty = "";

            //获取sheet的首行
            var headerRow = sheet.GetRow(0);

            //一行最后一个方格的编号 即总的列数
            int cellCount = headerRow.LastCellNum;

            //for (int i = headerRow.FirstCellNum; i < cellCount; i++)
            //{

            //}

            //最后一列的标号  即总的行数
            int rowCount = sheet.LastRowNum;

            for (int i = 0; i <= sheet.LastRowNum; i++)
            {

                var row = sheet.GetRow(i);

                if (row != null)
                {
                    courty = row.GetCell(0).ToString();
                    if (!string.IsNullOrWhiteSpace(courty))
                    {
                        courty = courty.Split(' ')[0];
                        sb2.Append(string.Format("'{0}',", courty));

                    }
                }

            }
            var da = sb2.ToString();

            hssfworkbook = null;
            sheet = null;

            //一般只用写这一个就OK了,他会遍历并释放所有资源,但当前版本有问题所以只释放sheet
            return string.Format("../../up/{0}.xls", guid);
            //记录日志
        }
开发者ID:rucila,项目名称:rights,代码行数:55,代码来源:BaseController.cs

示例9: AddExcelUserNPOI

        public void AddExcelUserNPOI()
        {
            FileStream file = new FileStream(@"d:\temp\test.xls", FileMode.Open, FileAccess.Read);
            HSSFWorkbook hssfWork = new HSSFWorkbook(file);
            ISheet iSheet = hssfWork.GetSheet("new sheet");
            iSheet.CreateRow(iSheet.LastRowNum + 1).CreateCell(0).SetCellValue("uuuu");

            FileStream fss = new FileStream(@"d:\temp\test.xls", FileMode.Create);
            hssfWork.Write(fss);
            file.Close();
        }
开发者ID:null2014,项目名称:SeleniumTest,代码行数:11,代码来源:HelpTest.cs

示例10: RenderFromExcel

    /// <summary>
    /// Excel文档流转换成DataTable
    /// </summary>
    /// <param name="excelFileStream">Excel文档流</param>
    /// <param name="sheetName">表名称</param>
    /// <param name="headerRowIndex">标题行索引号,如第一行为0</param>
    /// <returns></returns>
    public static DataTable RenderFromExcel(Stream excelFileStream, string sheetName, int headerRowIndex)
    {
        DataTable table = null;

        using (excelFileStream)
        {
            IWorkbook workbook = new HSSFWorkbook(excelFileStream);
            ISheet sheet = workbook.GetSheet(sheetName);
            table = RenderFromExcel(sheet, headerRowIndex);
        }
        return table;
    }
开发者ID:hehaiquan,项目名称:OA,代码行数:19,代码来源:ExcelRender.cs

示例11: Init

 public static void Init()
 {
     try
     {
         File = new FileStream(dataFolder + @"\DataSpelers.xls", FileMode.Open, FileAccess.Read);
         Workbook = new HSSFWorkbook(File);
         Sheet = Workbook.GetSheet("Users");
     }
     catch (IOException)
     {
         MessageBox.Show("DataSpelers.xls is open, gelieve deze te sluiten en het programma opnieuw op te starten.", "Excel lees fout");
         Environment.Exit(0);
     }
 }
开发者ID:Baellon,项目名称:WK-Calculator,代码行数:14,代码来源:XLSDataSpelers.cs

示例12: OnPostprocessAllAssets

    static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    {
        foreach (string asset in importedAssets) {
            if (!filePath.Equals (asset))
                continue;

            QuestRarityData data = (QuestRarityData)AssetDatabase.LoadAssetAtPath (exportPath, typeof(QuestRarityData));
            if (data == null) {
                data = ScriptableObject.CreateInstance<QuestRarityData> ();
                AssetDatabase.CreateAsset ((ScriptableObject)data, exportPath);
                data.hideFlags = HideFlags.NotEditable;
            }

            data.sheets.Clear ();
            using (FileStream stream = File.Open (filePath, FileMode.Open, FileAccess.Read)) {
                IWorkbook book = new HSSFWorkbook (stream);

                foreach(string sheetName in sheetNames) {
                    ISheet sheet = book.GetSheet(sheetName);
                    if( sheet == null ) {
                        Debug.LogError("[QuestData] sheet not found:" + sheetName);
                        continue;
                    }

                    QuestRarityData.Sheet s = new QuestRarityData.Sheet ();
                    s.name = sheetName;

                    for (int i=1; i< sheet.LastRowNum; i++) {
                        IRow row = sheet.GetRow (i);
                        ICell cell = null;

                        QuestRarityData.Param p = new QuestRarityData.Param ();

                    cell = row.GetCell(0); p.kind = (cell == null ? "" : cell.StringCellValue);
                    cell = row.GetCell(1); p.id = (int)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(2); p.name = (cell == null ? "" : cell.StringCellValue);
                    cell = row.GetCell(3); p.minStep = (int)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(4); p.maxStep = (int)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(5); p.rarity = (int)(cell == null ? 0 : cell.NumericCellValue);
                    cell = row.GetCell(6); p.rarityType = (int)(cell == null ? 0 : cell.NumericCellValue);
                        s.list.Add (p);
                    }
                    data.sheets.Add(s);
                }
            }

            ScriptableObject obj = AssetDatabase.LoadAssetAtPath (exportPath, typeof(ScriptableObject)) as ScriptableObject;
            EditorUtility.SetDirty (obj);
        }
    }
开发者ID:choirdesign,项目名称:onelinerrogue-src,代码行数:50,代码来源:QuestRarityData_importer.cs

示例13: aj_excelEquipmentDown

        public FileResult aj_excelEquipmentDown(q_Equipment_Chiller q)
        {
            HSSFWorkbook wbXLS;
            FileStream fileStream = null;
            MemoryStream outputStream = new MemoryStream();
            try
            {
                db0 = getDB0();
                fileStream = new FileStream(Server.MapPath("~/_Code/RPTExcel/Equipment.xls"), FileMode.Open, FileAccess.ReadWrite);
                wbXLS = new HSSFWorkbook(fileStream);
                ISheet getSheet = wbXLS.GetSheet("設備表");

                Apply_User getUserData = null;
                if (this.UserId != null)
                {
                    getUserData = db0.Apply_User.Where(x => x.USERID == this.UserId).FirstOrDefault();
                }

                SetCellValue(getSheet, "C3", getUserData.USERNAME);
                SetCellValue(getSheet, "E2", DateTime.Now.ToString("yyyy/MM/dd"));
                SetCellValue(getSheet, "E3", getUserData.USERID);

                wbXLS.Write(outputStream);

                outputStream.Position = 0;
                string setFileName = this.UserId + "-01-設備-" + DateTime.Now.ToString("yyyyMMddHHmm") + ".xls";

                if (Request.Browser.Browser == "IE" && Request.Browser.Version == "8.0")
                {
                    byte[] bytes = outputStream.ToArray();
                    Response.Clear();
                    Response.ContentType = "application/xls";
                    Response.AddHeader("content-disposition", "attachment;filename=" + Server.UrlEncode(setFileName));
                    Response.BinaryWrite(bytes);
                    Response.End();
                }

                return File(outputStream, "application/vnd.ms-excel", setFileName);
            }
            catch (Exception ex)
            {
                Log.Write(ex.Message + ex.StackTrace);
                return null;
            }
            finally
            {
                db0.Dispose();
            }
        }
开发者ID:jcincloud,项目名称:C071415_EEI_Electronic,代码行数:49,代码来源:ManagerExcelHandleController.cs

示例14: GetSheet

        public static Sheet GetSheet(HSSFWorkbook workbook, string sheetName)
        {
            if (workbook != null)
            {
                var sheet = workbook.GetSheet(sheetName);
                if (sheet != null)
                {
                    return sheet;
                }

                return workbook.CreateSheet(sheetName);
            }

            return null;
        }
开发者ID:luuksommers,项目名称:resourceextractor,代码行数:15,代码来源:NpoiHelper.cs

示例15: ReadExcle

        public string ReadExcle(string path = @"~/up/a.xls", int from = 1)
        {
            HSSFWorkbook _book = new HSSFWorkbook();
            string xlsPath = System.Web.HttpContext.Current.Server.MapPath(path);

            FileStream file = new FileStream(xlsPath, FileMode.Open, FileAccess.Read);
            IWorkbook hssfworkbook = new HSSFWorkbook(file);
            ISheet sheet = hssfworkbook.GetSheet("Sheet1");
            string guid = Guid.NewGuid().ToString();
            string saveFileName = xlsPath.Path(guid);

            StringBuilder sb = new StringBuilder();
            string temp="";
            //获取sheet的首行
            var headerRow = sheet.GetRow(0);

            //一行最后一个方格的编号 即总的列数
            int cellCount = headerRow.LastCellNum;

            for (int i = headerRow.FirstCellNum; i < cellCount; i++)
            {
                DataColumn column = new DataColumn(headerRow.GetCell(i).StringCellValue);

            }
            //最后一列的标号  即总的行数
            int rowCount = sheet.LastRowNum;

            for (int i = (sheet.FirstRowNum + 1); i < sheet.LastRowNum; i++)
            {
                var row = sheet.GetRow(i);

                for (int j = row.FirstCellNum; j < cellCount; j++)
                {
                    if (row.GetCell(j) != null)
                        sb.Append( row.GetCell(j).ToString());
                }

            }

            hssfworkbook = null;
            sheet = null;

            //一般只用写这一个就OK了,他会遍历并释放所有资源,但当前版本有问题所以只释放sheet
            return string.Format("../../up/{0}.xls", guid);
            //记录日志
        }
开发者ID:vipsms,项目名称:right,代码行数:46,代码来源:BaseController+-+副本.cs


注:本文中的NPOI.HSSF.UserModel.HSSFWorkbook.GetSheet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。