
技术摘要-NET
文章平均质量分 66
privates
这个作者很懒,什么都没留下…
展开
-
GridView生成.csv文件
string filename=DateTime.Now.ToString()+".csv";int rowCount = gridViewDL.Rows.Count + 1;int colCount = gridViewDL.Columns.Count;string[] arr = new string[colCount];StringWriter fileWriter = new StringWriter();//标题设置arr[0]="";arr[1]="";arr[2]="";fileWriter.原创 2010-11-26 17:32:00 · 625 阅读 · 0 评论 -
让文本框只能输入数字和一位小数点
onpaste="return false":禁止粘贴原创 2012-06-12 15:55:36 · 325 阅读 · 0 评论 -
程序中进程的读取、关闭
根据进程名判断进程是否存在 : /// /// 判断进程是否存在 /// /// 进程名 /// 存在值变为>0 /// private bool GetProgram(string procName, out int count) {原创 2012-06-12 15:53:09 · 290 阅读 · 0 评论 -
根据年月日得到日期是星期几
string CaculateWeekDay(int y, int m, int d) { if (m == 1) { m = 13; y--; } if (m == 2) { m = 14; y--; } int week = (d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 +原创 2012-06-12 15:57:22 · 281 阅读 · 0 评论 -
div中文字超过指定字符长度即换行
原创 2012-06-12 15:56:44 · 457 阅读 · 0 评论 -
.NET面试常见题目
一、一列数字规则如下:1、1、2、3、5、8、13、21、34..........求第30位数是多少,用递归算法实现 public class demo { /** * 实现方法 * @param i * @return */ public static int Foo(int i) { if (i原创 2012-02-16 16:18:08 · 289 阅读 · 0 评论 -
网页输出中文文档名乱码解决方式
string fileName = DateTime.Now.ToString("yyyyMMdd") + "中文名.xls"; string UserAgent = Request.ServerVariables["http_user_agent"].ToLower(); if (UserAgent.IndexOf("firefox") =原创 2012-02-23 17:58:54 · 312 阅读 · 0 评论 -
根据年月日得到日期是星期几
string CaculateWeekDay(int y, int m, int d) { if (m == 1) { m = 13; y--; } if (m == 2) { m = 14; y--; } int week = (d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 +原创 2012-02-23 17:54:15 · 218 阅读 · 0 评论 -
NPOI 生成Excel 的——常用
把自己常用的整理了出来,(*^__^*) 嘻嘻…… 有关文件输出文件名乱码的问题 有设置Excel中的一些样式问题 有直接保存Excel的 更多NPOI的实例说明:http://www.cnblogs.com/tonyqus/archive/2009/04/12/1434209.html 这个可是别个大虾滴。 using System; using System.Col原创 2011-12-15 16:58:44 · 1071 阅读 · 0 评论 -
.net 自带 发邮件
using System.Net.Mail; /// /// 发送邮件程序 /// /// 发送人邮件地址 /// 发送人显示名称 /// 发送给谁(邮件地址) /// 标题 /// 内容 /// 邮件登录名 /// 邮件密码 /// 邮件服务器 ///原创 2010-11-26 17:30:00 · 381 阅读 · 0 评论 -
读取.csv文件数据
using System.IO;private void UploadFile() { try { if (!FileUpload1.HasFile) { Response.Write("文件不存在"); return; } string fileExtension = Path.GetExtension(FileUpload1原创 2010-12-16 10:50:00 · 651 阅读 · 0 评论 -
GridView 生成Excel
private void ExportResult() { try { string filename = "text.xls"; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Charset = ""; HttpContext.Current.Response.AppendH原创 2010-12-09 10:13:00 · 563 阅读 · 0 评论 -
FileUpload图片上传 以及图片下载
private void UpImg() { string image = picFile.PostedFile.FileName; string imageType = image.Substring(image.LastIndexOf(".") + 1).ToUpper(); if (imageType == "JPG" || imageType == "JPEG" || imageType == "GIF" || imageType == "PNG"原创 2010-11-29 15:49:00 · 568 阅读 · 0 评论 -
将Excel转换成CSV
需要添加引用:Microsoft.Office.Interop.Excelusing Excel = Microsoft.Office.Interop.Excel;调用:SaveAsExcel(@"D:\TEST.xls",@"D:\TEST.CSV"); /// /// 将Excel转换成CSV /// /// Excel路径 /// CSV要保存的路径 public static void S原创 2013-12-17 16:53:54 · 684 阅读 · 0 评论