C# 获取文件信息并导出Excel,Xml报表
using System;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
// 添加引用 -> .NET -> Microsoft.Office.Interop.Excel(2003->11.0, 2007->12.0)
namespace WinFormTable
{
public partial class FormTable : Form
{
#region
private DataTable table;
private ChineseLunisolarCalendar lunarCalendar;
#endregion
public FormTable()
{
#region
InitializeComponent();
lunarCalendar = new ChineseLunisolarCalendar(); // 中国阴历。
table = new DataTable("File");
table.Locale = CultureInfo.InvariantCulture; // 固定区域。
DataColumn column = table.Columns.Add("Name", typeof(String));
table.Columns.Add("Length", typeof(Decimal));
table.Columns.Add("CreationTime", typeof(DateTime));
table.Constraints.Add("PK", column, true); // 创建主键。
table.DefaultView.ApplyDefaultSort = true; // 使用默认排序。
GridViewStyle();
&nbs
相关文档:
SAX概念
SAX是Simple API for XML的缩写,它并不是由W3C官方所提出的标准,可以说是“民间”的事实标准。实际上,它是一种社区性质的讨论产物。虽然如此,在XML中对SAX的应用丝毫不比DOM少,几乎所有的XML解析器都会支持它。
与DOM比较而言,SAX是一种轻量型的方法。我们知道,在处理DOM的时候,我们需要读 ......
测试用的xml文件
<?xml version="1.0" encoding="UTF-8"?>
<schools>
<school id='111'>测试学校</school>
<school id='222'>测试学校22
<class id='2.1'>测试班级222</class>
</school>
</schools>
测试用的JavaScript代码
$().ready(function ......
在很多情况下, 我们会用到XML,比如说配置文件等.C#提供了XML类.
这里我只是简单的写一下XML文件的生成,解析就不多说了.
第一种方法
DataBase db = DataBaseFactory.CreateDataBase(DataBaseType.MySql, strMysql);
......
这篇文章被转载的次数最多,其实代码简陋得我自己都看不下去。只不过发表这篇文章时很多人需要这个功能。
这几天写个数据库查询分析器,要用到XML记录用户注册的数据库连接地址、端口等信息,最开始想用java ......