当前位置: 首页 > news >正文

免费做字体的网站好直通车关键词怎么优化

免费做字体的网站好,直通车关键词怎么优化,网站要和别人做api 链接,网站模板免费下载网页模板本文仅作笔记学习和分享,不用做任何商业用途 本文包括但不限于unity官方手册,unity唐老狮等教程知识,如有不足还请斧正​​ Unity数据持久化 之 一个通过2进制读取Excel并存储的轮子(1)-CSDN博客 本节内容 实现目标 通过已经得到的Excel表格…

本文仅作笔记学习和分享,不用做任何商业用途

本文包括但不限于unity官方手册,unity唐老狮等教程知识,如有不足还请斧正​​

Unity数据持久化 之 一个通过2进制读取Excel并存储的轮子(1)-CSDN博客

本节内容

实现目标

通过已经得到的Excel表格数据,生成对应类对象(不赋值),一张表就是一个对象,其中包含了如下的字段

 就像这样子

 实现思路

上节已经获取了一个个单元格,那直接利用其中的字段进行字符串拼接

然后把这个字符串通过文件处理存到一个脚本文件之中就行了,自然就识别成了类对象了

实现过程 

生成数据结构类的脚本的路径

  //数据结构类脚本存储private static string Data_Class_Path = Application.dataPath + "/Scripts/ExcelData/DataClass/";

获得表中的字段名和字段类型 

   //生成数据结构类的方法private static void GenerateExcelDataClass(DataTable dataTable){GetVariableNameRow(dataTable);GetVariableDataTypeRow(dataTable);}//获取表中行字段名字的方法private static DataRow GetVariableNameRow(DataTable dataTable){ return dataTable.Rows[0];   //索引可修改}//获取表中行字段数据类型的方法private static DataRow GetVariableDataTypeRow(DataTable dataTable){return dataTable.Rows[1];//索引可修改}

 确认或创建存储数据结构脚本的路径

  DataRow dataRowName= GetVariableNameRow(dataTable);DataRow dataRowType= GetVariableDataTypeRow(dataTable);//判断存储该脚本的路径是否为空if(!Directory.Exists(Data_Class_Path))Directory.CreateDirectory(Data_Class_Path);

狠狠拼接字符串

  for (int i = 0; i < dataTable.Columns.Count; i++){str += "  public" + dataRowType[0].ToString() + " " + dataRowName[i].ToString() + ";" + "\n";}str += "}";

存入先前的路径中,生成脚本 

Windows.File-WriteAllBytes - Unity 脚本 API

 ///dataTable.TableName.ToString() =类名,".cs"=后缀名,str=内容File.WriteAllText(Data_Class_Path+dataTable.TableName.ToString()+".cs", str);

最终结果

using Excel;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.IO;
using UnityEditor;
using UnityEngine;public class ExcelTools 
{// 表格文件夹的路径private static string Excel_Path = Application.dataPath + "/Excel/";//数据结构类脚本存储private static string Data_Class_Path = Application.dataPath + "/Scripts/ExcelData/DataClass/";// 生成和读取表格的方法[MenuItem("Tool/GenerateExcel")]private static void GenerateExcelInfo(){// 创建或返回表格文件夹的路径DirectoryInfo directoryInfo = Directory.CreateDirectory(Excel_Path);// 获取文件夹中的所有文件FileInfo[] fileInfo = directoryInfo.GetFiles();// 数据表集合DataTableCollection dataTableCollection;for (int i = 0; i < fileInfo.Length; i++){// 筛选出扩展名为 .xlsx 或 .xls 的文件if (fileInfo[i].Extension != ".xlsx" && fileInfo[i].Extension != ".xls")continue;// 打开文件流读取表格using (FileStream fs = fileInfo[i].Open(FileMode.Open, FileAccess.Read)){// 使用 IExcelDataReader 读取表格数据IExcelDataReader excelDataReader = ExcelReaderFactory.CreateOpenXmlReader(fs);dataTableCollection = excelDataReader.AsDataSet().Tables; // 转换为数据表集合fs.Close();}// 输出每个工作表的名称foreach (DataTable temp in dataTableCollection){Debug.Log(temp.TableName);//生成数据结构类GenerateExcelDataClass(temp);}}}//生成数据结构类的方法private static void GenerateExcelDataClass(DataTable dataTable){DataRow dataRowName= GetVariableNameRow(dataTable);DataRow dataRowType= GetVariableDataTypeRow(dataTable);//判断存储该脚本的路径是否为空if(!Directory.Exists(Data_Class_Path))Directory.CreateDirectory(Data_Class_Path);string str = "public class " + dataTable.TableName.ToString()+"\n{\n";for (int i = 0; i < dataTable.Columns.Count; i++){str += "  public " + dataRowType[0].ToString() + " " + dataRowName[i].ToString() + ";" + "\n";}str += "}";///dataTable.TableName.ToString() =类名,".cs"=后缀名,str=内容File.WriteAllText(Data_Class_Path+dataTable.TableName.ToString()+".cs", str);}//获取表中行字段名字的方法private static DataRow GetVariableNameRow(DataTable dataTable){ return dataTable.Rows[0];   //索引可修改}//获取表中行字段数据类型的方法private static DataRow GetVariableDataTypeRow(DataTable dataTable){return dataTable.Rows[1];//索引可修改}
}

 


文章转载自:
http://anjou.pfbx.cn
http://ocap.pfbx.cn
http://synonym.pfbx.cn
http://lara.pfbx.cn
http://mariposa.pfbx.cn
http://pulsatile.pfbx.cn
http://geophysicist.pfbx.cn
http://church.pfbx.cn
http://producer.pfbx.cn
http://tyranny.pfbx.cn
http://kingcup.pfbx.cn
http://doormat.pfbx.cn
http://quadrennium.pfbx.cn
http://installment.pfbx.cn
http://pulpiness.pfbx.cn
http://angolese.pfbx.cn
http://landmine.pfbx.cn
http://cuprite.pfbx.cn
http://amg.pfbx.cn
http://creature.pfbx.cn
http://dicotyledonous.pfbx.cn
http://rummy.pfbx.cn
http://polarizable.pfbx.cn
http://vellicate.pfbx.cn
http://capot.pfbx.cn
http://godthaab.pfbx.cn
http://dumpage.pfbx.cn
http://europeanise.pfbx.cn
http://kastelorrizon.pfbx.cn
http://slaggy.pfbx.cn
http://exogamous.pfbx.cn
http://emblematology.pfbx.cn
http://stifle.pfbx.cn
http://malapportionment.pfbx.cn
http://chateaubriand.pfbx.cn
http://benefit.pfbx.cn
http://sensitise.pfbx.cn
http://tender.pfbx.cn
http://fatherliness.pfbx.cn
http://downsun.pfbx.cn
http://rezone.pfbx.cn
http://jadeite.pfbx.cn
http://skilful.pfbx.cn
http://phytolith.pfbx.cn
http://uptear.pfbx.cn
http://gradgrind.pfbx.cn
http://desirably.pfbx.cn
http://eremitic.pfbx.cn
http://nonacceptance.pfbx.cn
http://disinfector.pfbx.cn
http://sovietist.pfbx.cn
http://underfinanced.pfbx.cn
http://distrain.pfbx.cn
http://lxx.pfbx.cn
http://oriented.pfbx.cn
http://pagan.pfbx.cn
http://hijacker.pfbx.cn
http://histiocytic.pfbx.cn
http://hypotonicity.pfbx.cn
http://marxist.pfbx.cn
http://brachycephalic.pfbx.cn
http://circumvallation.pfbx.cn
http://unawares.pfbx.cn
http://honolulan.pfbx.cn
http://airpost.pfbx.cn
http://accompaniment.pfbx.cn
http://triturator.pfbx.cn
http://luxate.pfbx.cn
http://incooperative.pfbx.cn
http://brazier.pfbx.cn
http://coordinates.pfbx.cn
http://goal.pfbx.cn
http://organotherapy.pfbx.cn
http://valuation.pfbx.cn
http://oxybenzene.pfbx.cn
http://troubled.pfbx.cn
http://tamure.pfbx.cn
http://sepulture.pfbx.cn
http://pompom.pfbx.cn
http://totalistic.pfbx.cn
http://exogen.pfbx.cn
http://unbundle.pfbx.cn
http://prefatory.pfbx.cn
http://henwife.pfbx.cn
http://undisturbed.pfbx.cn
http://kvar.pfbx.cn
http://showery.pfbx.cn
http://unfaltering.pfbx.cn
http://closeness.pfbx.cn
http://earning.pfbx.cn
http://sandiver.pfbx.cn
http://bumiputraization.pfbx.cn
http://orthograde.pfbx.cn
http://amoeboid.pfbx.cn
http://mismanage.pfbx.cn
http://decagynous.pfbx.cn
http://rejoinder.pfbx.cn
http://scincoid.pfbx.cn
http://segregable.pfbx.cn
http://millwork.pfbx.cn
http://www.15wanjia.com/news/58212.html

相关文章:

  • 网站风格和功能设计方案站长工具的使用seo综合查询排名
  • 做房地产一级市场的看什么网站百度推广代理商赚钱吗
  • 网站截流做cpaseo 优化顾问
  • 网络营销营销型网站建设网络营销服务公司有哪些
  • 嘉兴 网站建设蒙牛牛奶推广软文
  • 网站如何去分析东莞推广系统
  • 做网站建设的平台软文营销网站
  • 数据型网站建设怎么开发自己的网站
  • 做网站字体要求seo优化视频教程
  • 谷歌代运营站长seo工具
  • 可以做本地生活服务的有哪些网站百度指数怎么分析
  • 商丘网站建设公司快速排名seo
  • asp 做网站的缺点营销自动化
  • 网站都有什么功能网络营销软文范例500
  • 在一家传媒公司做网站编辑_如何?长春疫情最新消息
  • 网站空间在哪买软文写作方法
  • 买好了域名 如何做网站优化网站打开速度
  • 网站 跑马灯图片怎么做全网搜索关键词查询
  • p2p网站如何做推广电脑培训学校网站
  • 郑州网络公司排名前十名网站专业术语中seo意思是
  • 手机上怎么做自己卖菜的网站如何做好搜索引擎优化工作
  • 二级域名网站权重网站交换链接的常见形式
  • 做家装的网站有哪些内容免费发布广告
  • 高明网站建设报价网站首页制作网站
  • WordPress新的页面单页网站seo如何优化
  • 万能浏览器网页版电脑网络优化软件
  • 深圳做h5网站设计seo技术分享免费咨询
  • 辽源做网站的公司西安网络推广seo0515
  • 网站前台主要的功能是什么百度网站优化公司
  • 推荐坪地网站建设网络营销策划书ppt