随笔分类 - asp.net
摘要:/************************************************************************************ 功能说明:XML处理基类* 作者:;* 版本:V0.1(C#2.0);时间:2006-12-13** *******************************************************************************/using System;using System.Data;using System.Configuration;using System.Web;using Sy
阅读全文
摘要:http://blog.csdn.net/zhengguangyi130/article/details/8062418获取数据库中所有的表SELECT SysObjects.name AS Tablename FROM sysobjects WHERE xtype = 'U'获取数据库中所有表的列名SELECT SysColumns.name AS Columnsname, SysObjects.name AS Tablename FROM SysObjects, SysColumns WHERE Sysobjects.Xtype='u' AND Sysobj
阅读全文
摘要:http://paulfzm.iteye.com/blog/394886C#代码//////获取汉字的首字母和全拼///publicclassChineseCode{protectedstring_CnTxt;protectedstring_EnTxt;//////要获取字母的汉字///publicstringCnTxt{get{return_CnTxt;}set{_CnTxt=value;}}//////汉字的首字母///publicstringEnTxt{get{return_EnTxt;}set{_EnTxt=value;}}//////构造方法///publicChineseCode(
阅读全文
摘要:http://blog.csdn.net/cpcpc/article/details/7029763下面给出一个在网上下载的一个已经封装好的类[csharp]view plaincopyusingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.UI.WebControls;usingSystem.Web.UI;usingSystem.Data;usingSystem.Text;usingSystem.Globalization;usingSystem.IO;names
阅读全文
摘要:一台服务器上所有数据库(也可能是部分数据库)的大小是我们经常需要了解的,它不仅能让我们知道目前数据库使用磁盘的比例,而且定期搜集这些信息,还能了解数据库一段时间的数据增量,更为常用的是在做数据迁移和升级时,方便规划新服务器磁盘容量。这里介绍三种统计数据库大小的方法:方法一:使用 sp_spaceuseddeclare @dbname varchar(100) declare db_cur cursor forselect name from sys.sysdatabases where dbid>4 and name'distribution'open db_curfet
阅读全文
摘要:http://www.cnblogs.com/jinzhao/archive/2009/10/09/1579473.html解决方法:1.引用usingSystem.Web.SessionState;2.在aspx类实现IReadOnlySessionState接口。如:publicclass{ClassName}:IHttpHandler,IReadOnlySessionState{…}原因:“IReadOnlySessionState”,指定目标HTTP处理程序只需要具有对话访问状态值的读访问权限。实际上是ashx文件首先是实现了IHttpHandler接口。但要访问page中的sessi
阅读全文
摘要:http://blog.csdn.net/dysj4099/article/details/4197323最近做的ASP.NET项目要求有数据库备份功能,研究了一下网上的代码,现将实现方法与需要注意的问题与大家分享。 1.首先添加Interop.SQLDMO.dll的引用(如果直接想在页面中写备份的代码,就直接在Web下引用,如果写成类库,就必须在类库项目下添加)。 2.以下使用类库项目为例:添加DBOperator类,加入以下代码:using System;using System.Data;using System.Configuration;using System.Web;using
阅读全文
摘要:http://www.cnblogs.com/xxyishutong/archive/2013/09/17/3326375.html Everyday Italian Giada De Laurentiis 2005 30.00 Harry Potter J K. Rowling 2005 29.99 XQuery Kick Start James McGovern Per Bothner Kurt Cagle James Linn Vaidyanathan Nagarajan 2...
阅读全文
摘要:1.this.Close(); 只是关闭当前窗口,若不是主窗体的话,是无法退出程序的,另外若有托管线程(非主线程),也无法干净地退出;2.Application.Exit(); 强制所有消息中止,退出所有的窗体,但是若有托管线程(非主线程),也无法干净地退出;3.Application.ExitThread(); 强制中止调用线程上的所有消息,同样面临其它线程无法正确退出的问题;4.System.Environment.Exit(0); 这是最彻底的退出方式,不管什么线程都被强制退出,把程序结束的很干净
阅读全文
摘要:http://www.cnblogs.com/wifi/archive/2011/11/25/2262664.html先用C#写个简单的exe,这里我就用winFormProgram.cs这里加了个启动参数大气象usingSystem;usingSystem.Collections.Generic;usingSystem.Windows.Forms;namespaceWindowsApplication1{staticclassProgram{//////应用程序的主入口点。///[STAThread]staticvoidMain(string[]args){Application.Enabl
阅读全文
摘要:Newtonsoft.Json序列化和反序列这里下载:http://www.newtonsoft.com/products/json/安装: 1.解压下载文件,得到Newtonsoft.Json.dll 2.在项目中添加引用..序列化和反序列在.net项目中:Product product = new Product();product.Name = "Apple";product.Expiry = new DateTime(2008, 12, 28);product.Price = 3.99M;product.Sizes = new string[] { "Sm
阅读全文