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
相关文档:
写XML:
protected void btnSave_Click(object sender, EventArgs e)
{
//权限判断
XmlTextWriter xmlw = new XmlTextWriter(Server.MapPath("~\\") + "FriendLink.xml", Encoding.Ge ......
导入jdom1.1版
http://www.jdom.org/dist/binary/
import java.io.FileReader;
import org.jdom.Document;
import org.jdom.input.SAXBuilder;
public class XMLValidate {
public void validate(String xml, String schema) {
try {
SAXBuilder builder = new SAXBuilder(true);
//指定约束方 ......
这篇教程探讨ASP.NET MVC控制器,控制器action和action result。完成此教程后,你会懂得控制器如何被用来控制访问者与ASP.NET MVC网站的交互方式。
理解控制器
MVC 控制器负责对ASP.NET MVC网站的请求作出回应。每一个浏览器请求都被映射到一个特定的控制器。例如,想象你在浏览器地址栏输入以下URL:
http://localhost/P ......
这篇文章被转载的次数最多,其实代码简陋得我自己都看不下去。只不过发表这篇文章时很多人需要这个功能。
这几天写个数据库查询分析器,要用到XML记录用户注册的数据库连接地址、端口等信息,最开始想用java ......