摘要: 转载自:http://blog.csdn.net/rocky69/article/details/7259697NET 讀取Excel 2007的xlsx文件和讀取老的.xls文件是一樣的,都是用Oledb讀取,僅僅連接字符串不同而已。讀取xlsx 用的是Microsoft.Ace.OleDb.12.0;具體操作方法如下:public static DataTable GetExcelToDataTableBySheet(string FileFullPath, string SheetName){//string strConn = "Provider=Microsoft.Jet. 阅读全文
posted @ 2013-01-27 22:22 追风浪子 阅读(17538) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://blog.csdn.net/zhangnan20100811/article/details/6458158以读取access数据集的方式读取For excel 2007:private DataSet GetExcelData(string str){string strCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + str + ";Extended Properties=/"Excel 12.0;HDR=YES/"";OleDbConnecti 阅读全文
posted @ 2013-01-27 22:21 追风浪子 阅读(677) 评论(1) 推荐(0) 编辑
摘要: 转载自:http://blog.csdn.net/zhangnan20100811/article/details/6458158using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.OleDb;using System.Drawing;using System.Text;using System.Windows.Forms;namespace ReadExcel07{public partial class Form1 : Fo 阅读全文
posted @ 2013-01-27 22:20 追风浪子 阅读(1666) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://www.cnblogs.com/SissyNong/archive/2009/09/22/1571752.html一、获取当前文件的路径 1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName 获取模块的完整路径,包括文件名。 2. System.Environment.CurrentDirectory 获取和设置当前目录(该进程从中启动的目录)的完全限定目录。 3. System.IO.Directory.GetCurrentDirectory() 获取应用程序的当前工作目录。这个不一定 阅读全文
posted @ 2013-01-27 21:23 追风浪子 阅读(602) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://blog.sina.com.cn/s/blog_407fb5bc0100kczw.html一. 二进制转换成图片 MemoryStream ms = new MemoryStream(bytes); ms.Position = 0; Image img = Image.FromStream(ms); ms.Close(); this.pictureBox1.Image二. C#中byte[]与string的转换代码1、System.Text.UnicodeEncoding converter = new System.Text.UnicodeEncoding(); b.. 阅读全文
posted @ 2013-01-27 19:50 追风浪子 阅读(735) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://www.cnblogs.com/adam/archive/2008/06/15/1222702.htmlusing System;using System.Collections.Generic;using System.IO.Compression;using System.Text;using System.Data;using System.IO;using System.Runtime.Serialization;using System.Runtime.Serialization.Formatters.Binary;using System.Xml;namesp 阅读全文
posted @ 2013-01-27 19:39 追风浪子 阅读(579) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://www.mysjtu.com/page/M0/S232/232232.html环境:.net 3.5(.net 2.0应该也是可以的,没测过)前面记得加using System.Configuration; //需要添加System.Configuration.dll的引用using System.Xml;/// <summary> /// 修改配置文件(appSettings)/// </summary> /// <param name="key"></param> /// <param name 阅读全文
posted @ 2013-01-27 14:34 追风浪子 阅读(1286) 评论(0) 推荐(0) 编辑