知识在于积累(.NET之路……)

导航

10 2010 档案

C#直接打开文件
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->string filePath = @"/Dir/aa.txt"; //相对路径System.Diagnostics.Process.Start(Server.MapPath(filePath)); 阅读全文

posted @ 2010-10-25 11:43 汤尼 阅读(384) 评论(0) 推荐(0)

C#之文件下载
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->string path="/Dir/01.txt"; //文件相对路径string Files = Server.MapPath(path); if (File.Exists(Files)) { try { System.IO.FileInfo DownloadFile = new System.IO.FileInfo(Files); string fileName = Do 阅读全文

posted @ 2010-10-25 11:08 汤尼 阅读(157) 评论(0) 推荐(0)

C#获取当前页面的URL地址
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#region 获取页面地址 /// <summary> /// 获取页面地址 /// </summary> /// <returns></returns> public static string GetUrl() { string strTemp = "http://"; if (System.Web.HttpContext 阅读全文

posted @ 2010-10-25 11:05 汤尼 阅读(934) 评论(1) 推荐(0)

Asp.net fileupload用法
摘要:文件类型验证 protected void Button1_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { fileExt = System.IO.Path.GetExtension(FileUpload1.FileName); if (fileExt == ".jpg" || fileExt == ".gif") { try { FileUpload1.SaveAs(Server.MapPath("upload") + "\\" + F 阅读全文

posted @ 2010-10-13 12:35 汤尼 阅读(500) 评论(0) 推荐(0)

SQL语句 返回一个数据表的字段,类型和大小及数据库中的表名和详细信息等
摘要:一、在数据库里,我有一个表tb1的结构如下:用一条SQL语句返回这个表的列名、类型及大小,如下:实现的SQL语句为:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->SELECT c.name As 'colName', t.name 'colType', c.prec 'colSize'FROM systypes t,syscolumns cWHERE t.xtype=c.xtypeAND c. 阅读全文

posted @ 2010-10-12 09:31 汤尼 阅读(848) 评论(0) 推荐(0)

Asp.net操作Excel文件事例小结,基于ExtAspNet控件库
摘要:SQL查询Excel文件的语句:SELECT * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source=D:\hxl\gxjt\gxjt\pay\excel\list.xls;Extended Properties=Excel 8.0; HDR=YES; IMEX=1')...Sheet1$注:如遇到如下问题:1)、已拒绝对 OLE DB 访问接口 'Microsoft.Jet.OLEDB.4.0' 的即席访问。必须通过链接服务器来访问此访问接口。 答:登录数据库用户必须具有sa权限 阅读全文

posted @ 2010-10-11 09:48 汤尼 阅读(250) 评论(0) 推荐(0)

在存储过程中自定义表,插入数据并查询
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->declare @totalNum intSet @totalNum=5declare @indextable1 table(id int identity(1,1),totalNum int)declare @i intSEt @i=0while @i<@totalNumbegininsert into @indextable1(totalNum) values(@totalNum)Se 阅读全文

posted @ 2010-10-09 15:31 汤尼 阅读(273) 评论(0) 推荐(0)

C++中,设置中文简体
摘要:C++中,设置中文简体Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include<locale>setlocale(LC_ALL,"chs"); 阅读全文

posted @ 2010-10-09 10:33 汤尼 阅读(535) 评论(0) 推荐(0)