1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Data.OleDb;
  10. using System.Collections;
  11. using System.IO;
  12.  
  13. /*
  14. 当 IMEX=0 时为“汇出模式”,这个模式开启的 Excel 档案只能用来做“写入”用途。
  15.  
  16. 当 IMEX=1 时为“汇入模式”,这个模式开启的 Excel 档案只能用来做“读取”用途。
  17.  
  18. 当 IMEX=2 时为“连結模式”,这个模式开启的 Excel 档案可同时支援“读取”与“写入”用途。
  19. */
  20. /*
  21.  
  22. 列类型 经典 ADO ADO.Net (OleDb)
  23. 数字 5-adDouble 5-OleDbType.Double
  24. 货币 6-adCurrency 6-OleDbType.Currency
  25. 日期/时间 7-adDate 7-OleDbType.Date
  26. 布尔值 11-adBoolean 11-OleDbType.Boolean
  27. 文本 < 255 202-adVarWChar 130-OleDbType.WChar
  28. 备注 203-adLongVarWChar 130-OleDbType.WChar
  29. */
  30.  
  31. namespace ExcelGenerator
  32. {
  33. /// <summary>
  34. /// http://support.microsoft.com/zh-cn/kb/318452
  35. /// http://www.codeproject.com/Articles/37055/Working-with-MS-Excel-xls-xlsx-Using-MDAC-and-Oled
  36. /// 20150325
  37. /// 涂聚文
  38. /// </summary>
  39. public partial class ExcelFileForm : Form
  40. {
  41. //"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\\test.xls;Extended Properties=Excel 8.0";
  42. //Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsm;Extended Properties = "Excel 12.0 Macro;HDR=YES";
  43. //Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myBinaryExcel2007file.xlsb;Extended Properties="Excel 12.0;HDR=YES";
  44. //Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myOldExcelFile.xls;Extended Properties = "Excel 8.0;HDR=YES";
  45. //Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls; Extended Properties = "Excel 8.0;HDR=Yes;IMEX=1";
  46. string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\\test.xls;Extended Properties=Excel 8.0;HDR=Yes;IMEX=1;";
  47. private OleDbConnection cn;
  48.  
  49. private DataTable dtTables;
  50. private CurrencyManager cm;
  51. private DataTable dtColumns;
  52. private DataView dvColumns;
  53.  
  54. string fileurl = string.Empty;
  55. /// <summary>
  56. /// GetOleDbSchemaTable(OleDbSchemaGuid.Columns,new Object[]{null,null, strTable, null});
  57. /// </summary>
  58. /// <returns></returns>
  59. private DataTable setTable()
  60. {
  61. DataTable dt = new DataTable();
  62. dt.Columns.Add("id",typeof(int));
  63. dt.Columns.Add("name", typeof(string));
  64. dt.Rows.Add(1, "tables");//工作表
  65. dt.Rows.Add(2, "Columns");
  66. //dt.Rows.Add(3, "");
  67. //dt.Rows.Add(4, "");
  68. //dt.Rows.Add(5, "");
  69. //dt.Rows.Add(6, "");
  70.  
  71. return dt;
  72. }
  73.  
  74. /// <summary>
  75. /// /
  76. /// </summary>
  77. public ExcelFileForm()
  78. {
  79. InitializeComponent();
  80. }
  81. /// <summary>
  82. ///
  83. /// </summary>
  84. /// <param name="sender"></param>
  85. /// <param name="e"></param>
  86. private void ExcelFileForm_Load(object sender, EventArgs e)
  87. {
  88. this.comboBox1.DataSource = setTable();
  89. this.comboBox1.DisplayMember = "name";
  90. this.comboBox1.ValueMember = "id";
  91. }
  92. /// <summary>
  93. ///
  94. /// </summary>
  95. /// <param name="sender"></param>
  96. /// <param name="e"></param>
  97. private void button1_Click(object sender, EventArgs e)
  98. {
  99. openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
  100. //JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif
  101. openFileDialog1.FileName = "";
  102. openFileDialog1.Filter = "Excel 2000-2003 files(*.xls)|*.xls|Excel 2007 files (*.xlsx)|*.xlsx";//|(*.xlsx)|*.xlsx Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.* txt files (*.txt)|*.txt|All files (*.*)|*.*"
  103. openFileDialog1.FilterIndex = 1;
  104. openFileDialog1.RestoreDirectory = true;
  105. if (openFileDialog1.ShowDialog() == DialogResult.OK)
  106. {
  107. if (!openFileDialog1.FileName.Equals(String.Empty))
  108. {
  109.  
  110. //connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + openFileDialog1.FileName + ";Extended Properties=Excel 8.0;";
  111. fileurl = openFileDialog1.FileName;
  112.  
  113. string extension = Path.GetExtension(fileurl); //GetFileNameWithoutExtension
  114. this.textBox1.Text = openFileDialog1.FileName;
  115. if (extension == ".xls") //extension==".xls";
  116. {
  117. connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
  118. "Data Source=" + fileurl + ";" +
  119. @"Extended Properties=" + "\"Excel 8.0;HDR=YES;\"";
  120. }
  121. else if (extension==".xlsx")//extension==".xlsx";
  122. {
  123. connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;" +
  124. "Data Source=" + fileurl + ";" +
  125. @"Extended Properties=" + "\"Excel 12.0;HDR=YES;\"";
  126. }
  127. }
  128. }
  129. }
  130. /// <summary>
  131. /// TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE,TABLE_GUID,DESCRIPTION,TABLE_PROPID,DATE_CREATED,DATE_MODIFIED
  132. /// TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,COLUMN_GUID,COLUMN_PROPID,ORDINAL_POSITION,COLUMN_HASDEFAULT,COLUMN_DEFAULT,COLUMN_FLAGS,IS_NULLABLE,DATA_TYPE,TYPE_GUID,CHARACTER_MAXIMUM_LENGTH,CHARACTER_OCTET_LENGTH,NUMERIC_PRECISION,NUMERIC_SCALE,DATETIME_PRECISION,CHARACTER_SET_CATALOG,CHARACTER_SET_SCHEMA,CHARACTER_SET_NAME,COLLATION_CATALOG,COLLATION_SCHEMA,COLLATION_NAME,DOMAIN_CATALOG,DOMAIN_SCHEMA,DOMAIN_NAME,DESCRIPTION
  133. /// </summary>
  134. /// <param name="sender"></param>
  135. /// <param name="e"></param>
  136. private void button2_Click(object sender, EventArgs e)
  137. {
  138. System.Data.OleDb.OleDbConnection ExcelConnection = new System.Data.OleDb.OleDbConnection(connectionString);
  139. ExcelConnection.Open();
  140. //dtTables = ExcelConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
  141. //dtTables = ExcelConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, new object[] { null, null, null, "Sheet1$" });
  142. //dtTables = ExcelConnection.GetSchema("tables");
  143. //this.dataGridView1.DataSource = dtTables;
  144. //ExcelConnection.Close();
  145. //this.textBox2.Text = GetColumnNames(dtTables);
  146.  
  147. GetTablesList();
  148. this.dataGridView2.DataSource= ReadExcelFile().Tables[0];
  149.  
  150. }
  151. /// <summary>
  152. ///
  153. /// </summary>
  154. /// <param name="table"></param>
  155. /// <returns></returns>
  156. public static string GetColumnNames(System.Data.DataTable table)
  157. {
  158. if (table != null)
  159. {
  160. List<string> lstColumn = new List<string>();
  161.  
  162. foreach (System.Data.DataColumn col in table.Columns)
  163. {
  164. lstColumn.Add(col.ColumnName);
  165. }
  166.  
  167. return String.Join(",", lstColumn.ToArray());
  168. }
  169.  
  170. return string.Empty;
  171. //foreach (DataRow row in table.Rows)
  172. //{
  173. // foreach (DataColumn column in table.Columns)
  174. // {
  175. // ColumnName = column.ColumnName;
  176. // ColumnData = row[column].ToString();
  177. // }
  178. //}
  179. }
  180. /// <summary>
  181. ///
  182. /// </summary>
  183. /// <param name="sender"></param>
  184. /// <param name="e"></param>
  185. private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  186. {
  187.  
  188. }
  189. /// <summary>
  190. ///
  191. /// </summary>
  192. private void GetTablesList()
  193. {
  194. try
  195. {
  196. cn = new OleDbConnection(connectionString);
  197. cn.Open();
  198. dtTables = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
  199. this.dataGridView3.DataSource = dtTables;
  200. //dataGridView1.ReadOnly = true;
  201. cn.Close();
  202. }
  203. catch (System.Data.OleDb.OleDbException myException)
  204. {
  205. for (int i = 0; i < myException.Errors.Count; i++)
  206. {
  207. MessageBox.Show("Index #" + i + "\n" +
  208. "Message: " + myException.Errors[i].Message + "\n" +
  209. "Native: " +
  210. myException.Errors[i].NativeError.ToString() + "\n" +
  211. "Source: " + myException.Errors[i].Source + "\n" +
  212. "SQL: " + myException.Errors[i].SQLState + "\n");
  213. }
  214. }
  215.  
  216. GetColumnsList();
  217. }
  218. /// <summary>
  219. ///
  220. /// </summary>
  221. private void GetColumnsList()
  222. {
  223. try
  224. {
  225. if (cm == null)
  226. cm = (CurrencyManager)this.BindingContext[dtTables];
  227.  
  228. cm.PositionChanged += new EventHandler(cm_PositionChanged);
  229.  
  230. int r = cm.Position;
  231.  
  232. String strTable = dtTables.Rows[r]["TABLE_NAME"].ToString();
  233. cn = new OleDbConnection(connectionString);
  234. cn.Open();
  235. dtColumns = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, new Object[] { null, null, strTable, null });//字段名
  236. dvColumns = new DataView(dtColumns);
  237. dvColumns.Sort = "ORDINAL_POSITION";
  238. dataGridView1.DataSource = dvColumns;
  239. //dataGridView1.ReadOnly = true;
  240. cn.Close();
  241.  
  242. this.textBox2.Text = GetColumnNames(dtColumns);
  243. }
  244. catch (Exception ex)
  245. {
  246. ex.Message.ToString();
  247. }
  248. }
  249. /// <summary>
  250. ///
  251. /// </summary>
  252. /// <param name="sender"></param>
  253. /// <param name="e"></param>
  254. private void cm_PositionChanged(object sender, System.EventArgs e)
  255. {
  256. GetColumnsList();
  257. }
  258.  
  259. private void comboBox1_SelectedValueChanged(object sender, EventArgs e)
  260. {
  261.  
  262. }
  263. /// <summary>
  264. ///
  265. /// </summary>
  266. /// <param name="dt2format"></param>
  267. private void FormatTablesGrid(DataTable dt2format)
  268. {
  269. DataGridTableStyle gs = new DataGridTableStyle();
  270. gs.MappingName = dt2format.TableName;
  271.  
  272. DataGridColumnStyle cs = new DataGridTextBoxColumn();
  273.  
  274. cs.MappingName = "TABLE_NAME";
  275. cs.HeaderText = "Table Name";
  276. cs.Width = 75;
  277.  
  278. gs.GridColumnStyles.Add(cs);
  279.  
  280. cs = new DataGridTextBoxColumn();
  281. cs.MappingName = "TABLE_TYPE";
  282. cs.HeaderText = "Table Type";
  283. cs.Width = 75;
  284.  
  285. gs.GridColumnStyles.Add(cs);
  286.  
  287. CurrencyManager cm = (CurrencyManager)this.BindingContext[dt2format];
  288.  
  289. PropertyDescriptor pd = cm.GetItemProperties()["DATE_CREATED"];
  290.  
  291. cs = new DataGridTextBoxColumn(pd, "d");
  292. cs.MappingName = "DATE_CREATED";
  293. cs.HeaderText = "Date Created";
  294. cs.Width = 75;
  295.  
  296. gs.GridColumnStyles.Add(cs);
  297.  
  298. cm = (CurrencyManager)this.BindingContext[dt2format];
  299. pd = cm.GetItemProperties()["DATE_MODIFIED"];
  300.  
  301. cs = new DataGridTextBoxColumn(pd, "d");
  302. cs.MappingName = "DATE_MODIFIED";
  303. cs.HeaderText = "Date Modified";
  304. cs.Width = 75;
  305.  
  306. gs.GridColumnStyles.Add(cs);
  307.  
  308. //dataGridView1.TabIndex.Add(gs);
  309. button2.Enabled = false;
  310.  
  311. }
  312. /// <summary>
  313. /// http://www.codeproject.com/Tips/705470/Read-and-Write-Excel-Documents-Using-OLEDB
  314. /// </summary>
  315. /// <returns></returns>
  316. private string GetConnectionString()
  317. {
  318. Dictionary<string, string> props = new Dictionary<string, string>();
  319.  
  320. // XLSX - Excel 2007, 2010, 2012, 2013
  321. //props["Provider"] = "Microsoft.ACE.OLEDB.12.0;";
  322. //props["Extended Properties"] = "Excel 12.0 XML;"; //
  323. //props["Data Source"] = fileurl;
  324.  
  325. // XLS - Excel 2003 and Older
  326. //props["Provider"] = "Microsoft.Jet.OLEDB.4.0";
  327. //props["Extended Properties"] = "Excel 8.0;";//HDR=Yes;IMEX=1
  328. //props["Data Source"] = fileurl;
  329. //fileurl = this.textBox1.Text.Trim();
  330. string extension = Path.GetExtension(fileurl);
  331. if (extension == ".xls") //extension==".xls";
  332. {
  333. connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
  334. "Data Source=" + fileurl + ";" +
  335. @"Extended Properties=" + "\"Excel 8.0;HDR=YES;\"";
  336.  
  337. // XLS - Excel 2003 and Older
  338. props["Provider"] = "Microsoft.Jet.OLEDB.4.0";
  339. props["Extended Properties"] = "Excel 8.0";//HDR=Yes;IMEX=1
  340. props["Data Source"] = fileurl;
  341. }
  342. else if (extension == ".xlsx")//extension==".xlsx";
  343. {
  344. connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;" +
  345. "Data Source=" + fileurl + ";" +
  346. @"Extended Properties=" + "\"Excel 12.0;HDR=YES;\"";
  347. // XLSX - Excel 2007, 2010, 2012, 2013
  348. props["Provider"] = "Microsoft.ACE.OLEDB.12.0";
  349. props["Data Source"] = fileurl;
  350. props["Extended Properties"] = "Excel 12.0 XML"; //Excel 12.0 XML
  351.  
  352. }
  353.  
  354. StringBuilder sb = new StringBuilder();
  355.  
  356. foreach (KeyValuePair<string, string> prop in props)
  357. {
  358. sb.Append(prop.Key);
  359. sb.Append('=');
  360. sb.Append(prop.Value);
  361. sb.Append(';');
  362. }
  363.  
  364. return sb.ToString();
  365. }
  366. /// <summary>
  367. /// 创建工作表table1
  368. /// </summary>
  369. private void WriteExcelFile()
  370. {
  371. string connectionString = GetConnectionString();
  372.  
  373. using (OleDbConnection conn = new OleDbConnection(connectionString))
  374. {
  375. conn.Open();
  376. OleDbCommand cmd = new OleDbCommand();
  377. cmd.Connection = conn;
  378.  
  379. cmd.CommandText = "CREATE TABLE [table1] (id INT, name VARCHAR, datecol DATE );";//创建工作表table1 及表头
  380. cmd.ExecuteNonQuery();
  381.  
  382. cmd.CommandText = "INSERT INTO [table1](id,name,datecol) VALUES(1,'AAAA','2014-01-01');";
  383. cmd.ExecuteNonQuery();
  384.  
  385. cmd.CommandText = "INSERT INTO [table1](id,name,datecol) VALUES(2, 'BBBB','2014-01-03');";
  386. cmd.ExecuteNonQuery();
  387.  
  388. cmd.CommandText = "INSERT INTO [table1](id,name,datecol) VALUES(3, 'CCCC','2014-01-03');";
  389. cmd.ExecuteNonQuery();
  390.  
  391. cmd.CommandText = "UPDATE [table1] SET name = 'DDDD' WHERE id = 3;";
  392. cmd.ExecuteNonQuery();
  393.  
  394. conn.Close();
  395. }
  396. }
  397. /// <summary>
  398. /// 读工作表
  399. /// </summary>
  400. /// <returns></returns>
  401. private DataSet ReadExcelFile()
  402. {
  403. DataSet ds = new DataSet();
  404.  
  405. string connectionString = GetConnectionString();
  406.  
  407. try
  408. {
  409. using (OleDbConnection conn = new OleDbConnection(connectionString))
  410. {
  411. conn.Open();
  412. OleDbCommand cmd = new OleDbCommand();
  413. cmd.Connection = conn;
  414.  
  415. // Get all Sheets in Excel File
  416. DataTable dtSheet = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
  417.  
  418. // Loop through all Sheets to get data
  419. foreach (DataRow dr in dtSheet.Rows)
  420. {
  421. string sheetName = dr["TABLE_NAME"].ToString();
  422.  
  423. if (!sheetName.EndsWith("$"))
  424. continue;
  425.  
  426. // Get all rows from the Sheet
  427. cmd.CommandText = "SELECT * FROM [" + sheetName + "]";
  428.  
  429. DataTable dt = new DataTable();
  430. dt.TableName = sheetName;
  431.  
  432. OleDbDataAdapter da = new OleDbDataAdapter(cmd);
  433. da.Fill(dt);
  434.  
  435. ds.Tables.Add(dt);
  436. }
  437.  
  438. cmd = null;
  439. conn.Close();
  440. }
  441.  
  442. }
  443. catch (Exception ex)
  444. {
  445. ex.Message.ToString();
  446. }
  447. return ds;
  448. }
  449. /// <summary>
  450. /// 添加一个新工作表
  451. /// </summary>
  452. /// <param name="sender"></param>
  453. /// <param name="e"></param>
  454. private void button3_Click(object sender, EventArgs e)
  455. {
  456. WriteExcelFile();
  457. }
  458. /// <summary>
  459. /// 查询值
  460. /// </summary>
  461. /// <param name="sender"></param>
  462. /// <param name="e"></param>
  463. private void button4_Click(object sender, EventArgs e)
  464. {
  465. //create a string for the query
  466.  
  467. string ExcelQuery;
  468.  
  469. //Sheet1 is the sheet name
  470. //create the query:
  471. //read column with heading A from the Excel file
  472. ArrayList ad = new ArrayList();
  473. ExcelQuery = "SELECT * FROM [Sheet1$] WHERE 序号=5"; // from Sheet1";
  474. DataSet ds = new DataSet();
  475. using (OleDbConnection conn = new OleDbConnection(connectionString))
  476. {
  477. //1.
  478. OleDbCommand cmd = new OleDbCommand(ExcelQuery, conn);
  479. conn.Open();
  480. OleDbDataReader myReader = cmd.ExecuteReader();
  481. if (myReader.Read())
  482. {
  483. ad.Add(myReader[0].ToString()+","+myReader[1].ToString()+","+myReader[2].ToString()+","+myReader[3].ToString()+","+myReader[4].ToString());
  484. }
  485. this.textBox2.Text= String.Join(",", ad.ToArray());
  486.  
  487. //2.
  488. //OleDbDataAdapter command = new OleDbDataAdapter(ExcelQuery, connectionString);
  489. //command.Fill(ds, "ds");
  490. //dataGridView1.DataSource = ds.Tables[0];
  491. }
  492.  
  493. }
  494.  
  495. }
  496.  
  497. }

  数据类型:

Short System.Int16 2
Long System.Int32 3
Single System.Single 4
Double System.Double 5
Currency System.Decimal 6
DateTime System.DateTime 7
Bit System.Boolean 11
Byte System.Byte 17
GUID System.Guid 72
BigBinary System.Byte[] 204
LongBinary System.Byte[] 205
VarBinary System.Byte[] 204
LongText System.String 203
VarChar System.String 202
Decimal System.Decimal 131

/*
MetaDataCollections
DataSourceInformation
DataTypes
Restrictions
ReservedWords
Columns
Indexes
Procedures
Tables
Views
*/

Excel Metadata的更多相关文章

  1. SQLite metadata

    http://www.devart.com/dotconnect/sqlite/docs/MetaData.html https://github.com/sqlitebrowser/sqlitebr ...

  2. Excel解析easyexcel工具类

    Excel解析easyexcel工具类 easyexcel解决POI解析Excel出现OOM <!-- https://mvnrepository.com/artifact/com.alibab ...

  3. java五行代码导出Excel

    目录 先看代码 再看效果 EasyExcel 附: Java按模板导出Excel---基于Aspose实现 Java无模板导出Excel,Apache-POI插件实现 已经写过两种Excel导出插件了 ...

  4. Excel解析工具easyexcel全面探索

    1. Excel解析工具easyexcel全面探索 1.1. 简介 之前我们想到Excel解析一般是使用POI,但POI存在一个严重的问题,就是非常消耗内存.所以阿里人员对它进行了重写从而诞生了eas ...

  5. SpringBoot整合easyexcel实现Excel的导入与导出

    导出 在一般不管大的或者小的系统中,各家的产品都一样,闲的无聊的时候都喜欢让我们这些程序员导出一些数据出来供他观赏,非说这是必须需求,非做不可,那么我们就只能苦逼的哼哧哼哧的写bug喽. 之前使用PO ...

  6. 使用 EasyExcel 读取Excel(两种方式)

    引入 jar 包 <dependency> <groupId>com.alibaba</groupId> <artifactId>easyexcel&l ...

  7. JAVA使用easyexcel操作Excel

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.                                               本 ...

  8. EasyExcel实现导入excel

    https://blog.csdn.net/rexueqingchun/article/details/91870372 1.pom.xml配置依赖包 <!-- xls格式excel依赖包 -- ...

  9. SpringBoot基于easyexcel导出和写入Excel

      easyexcel是阿里巴巴旗下开源项目,主要用于Excel文件的导入和导出处理,今天我们利用SpringBoot和easyexcel实战演示如何导出和写入Excel文件. 一.加入我们需要的ea ...

随机推荐

  1. springMVC传递一组对象的接受方式

    受益此大神:https://blog.csdn.net/cgd_8523/article/details/80022331 同时借鉴代码!!!! 我只用了一种方法,就记下这一种 需求:前台存在动态添加 ...

  2. max,min无法使用的问题

    遇到了包含algorithm头文件以后 min或max函数不能用的问题 改成__min和__max以后就可以了

  3. Java中关键字final用法

    ///首先声明,本文转载自博客园的海子,链接:http://www.cnblogs.com/dolphin0520/p/3736238.html 浅析Java中的final关键字 谈到final关键字 ...

  4. KMP算法再解 (看毛片算法真是人如其名,哦不,法如其名。)

    KMP算法主要解决字符串匹配问题,其中失配数组next很关键: 看毛片算法真是人如其名,哦不,法如其名. 看了这篇博客,转载过来看一波: 原博客地址:https://blog.csdn.net/sta ...

  5. vue环境搭建简介

    简单整理下vue的安装的新建项目 安装node.js和npm 参考其他教程 安装vue npm install vue 安装脚手架 vue-cli npm install --global vue-c ...

  6. 常见 CentOS 7 安装问题

    问题一: 解决办法:网上安装文章推荐的的刻录工具多是 ultraiso,有时候可能会出现错误,这时候最简单的解决办法是换由RedHat推荐的刻录工具,fedora media writer,不过这个工 ...

  7. 微信 oauth 登录 ,回调两次,一个坑,记录一下。

    在做微信某个功能的时候,大致需求是:静默授权,得到openId ,然后拿着openId调用接口,判断是否关注.如果是关注的,则发放礼券.每个我网站的会员只会发放一次礼券.如果第二次则会提示已领取过礼券 ...

  8. ActionBarCompat 教程-实现Action Bar

    http://www.mobiletuts.me 自Action Bar设计概念在Android 3.0(API 11) 中被Google引入以后,Action Bar这种设计模式迅速被各APP厂商( ...

  9. (转)OpenStack构架知识梳理

    http://www.cnblogs.com/kevingrace/p/8459034.html-------------------Openstack架构概念图-简单汇总 原文:http://www ...

  10. 关于c#中委托与事件的一些理解

    文章目的:作者(初学者)在学习c#的过程中,对事件.委托及其中的“object sender,EventArgs e”一直感觉理解不透,因此在网上找了一些资料,学习并整理出了该篇笔记,希望能将自己的心 ...