自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 资源 (8)
  • 收藏
  • 关注

转载 c#如何将txt文本内容进行清空(C#清空txt文本内容)

System.IO.File.WriteAllText(@"c:\test.txt", string.Empty);

2013-05-25 23:45:01 18318 5

转载 C#复制、粘贴文本信息到剪贴板

http://www.cnblogs.com/michaelxu/archive/2008/11/04/1326184.html复制:private void button1_Click(object sender, System.EventArgs e) {  // Takes the selected text from a text box and puts it on th

2013-05-25 01:46:58 597

转载 C#遍历ComboBox

http://www.cnblogs.com/JuneZhang/archive/2011/12/13/2286872.html C#遍历ComboBox的内容:一:for (int i = 0; i < comboBox1.Items.Count; i++){ MessageBox.Show(comboBox1.GetItemText(comboBox1.Ite

2013-05-24 12:12:02 971

转载 C#读写文件总结

http://www.cnblogs.com/qiantuwuliang/archive/2009/03/12/1409417.html1、使用FileStream读写文件 文件头: using System;using System.Collections.Generic;using System.Text;using System.IO; 读文件核心代码

2013-05-24 12:11:03 461

转载 JDBC批量执行sql .

声明: 非原创,原帖地址http://blog.sina.com.cn/s/blog_4d8a2c970100g59y.html JDBC的批量处理语句包括下面两个方法:addBatch(String):添加需要批量处理的SQL语句或是参数;executeBatch();执行批量处理语句;通常我们会遇到两种批量执行SQL语句的情况:1 多条SQL语句的批量处理;

2013-05-23 16:00:01 592

原创 Hibernate批处理操作优化 (批量插入、更新与删除)

我开发的网站加了个新功能:需要在线上处理表数据的批量合并和更新,昨天下午发布上线,执行该功能后,服务器的load突然增高,变化曲线异常,SA教育了我一番,让我尽快处理,将CPU负载降低。工作所需,我经常要写些程序批量处理数据,每次执行几十万数据处理的时候,我机子的CPU都会飙高,而且数据处理速度会越来越慢。比如第一个1W条要5分钟,第二个1W条就要10分钟,要干其他事情的时候机子也卡的不行

2013-05-23 15:25:36 1425

转载 VS2010 引用DevComponents.DotNetBar .

步骤:1)下载DevComponents.DotNetBar2.dll(VS2010需要v10.0以上版本)2)为工程添加引用,浏览找到DevComponents.DotNetBar2.dll3)打开工具箱,右键【选择项】弹出              单击浏览按钮,选择DevComponents.DotNetBar2.dll4)代码中添加using DevComponen

2013-05-23 11:06:36 2515

转载 DotNetBar教程(二)

在DotNetBar教程(一)里,用一个实例介绍了DotNetBar在.NET环境下的使用(原文见http://www.cnblogs.com/hans_gis/archive/2010/07/13/1776817.html),在本篇里,介绍一下ExpandablePanel控件的用法。从其名称Expandable中可以意识到该控件是个具有伸缩性的控件,如此可以利用这个特点高效的利用有限的界面。

2013-05-23 10:43:00 2919

转载 DotNetBar教程(一)

DotNetBar是一组用于.NET Framework环境下的一组组件集,利用该组件集能够打造绚丽并且实用的应用程序界面,给开发人员提供极大的便利。关于DotNetBar,详情请参考其官方网站:http://www.devcomponents.com 该组件集目前最新版本是8.8(不知最近有没有升级版本),可以从该网站上下载到试用期为一个月的试用版本。  正常安装了DotNetBar组件集(

2013-05-23 10:42:19 1382

转载 C#重命文件

页面包括3个控件,1文本框输入路径2多选按钮重命名条件3提交按钮protected void Page_Load(object sender, EventArgs e)    {    }    protected void Button1_Click(object sender, EventArgs e)    {        string path = str

2013-05-23 01:47:15 579

转载 dede织梦_采集规则技巧-过滤-替换

接口@me=str_replace('被替换字','替换字',@me);官方自带{dede:trim replace=''}]*)>(.*){/dede:trim}{dede:trim replace=''}]*)>(.*){/dede:trim}{dede:trim replace=''}{/dede:trim}{dede:trim replace=''}]*)>(.

2013-05-21 01:15:02 1582

转载 struts2核心工作流程与原理

1. Struts2架构图 这是Struts2官方站点提供的Struts 2 的整体结构。  2. Struts2部分类介绍 这部分从Struts2参考文档中翻译就可以了。 ActionMapper         ActionMapper其实是HttpServletRequest和Action调用请求的一个映射,它屏蔽了Action对于Request等 java

2013-05-14 14:57:59 543

转载 一篇很全面的freemarker教程

http://relive123-yahoo-com-cn.iteye.com/blog/818013以下内容全部是网上收集:企业网站源码下载 FreeMarker的模板文件并不比HTML页面复杂多少,FreeMarker模板文件主要由如下4个部分组成: 1,文本:直接输出的部分 2,注释:格式部分,不会输出 3,插值:即${...}或#{...}格式的部分,将使用数据模型

2013-05-14 14:41:50 416

转载 JAVA自定义标签教程及实例代码

Test.jsp  企业网站源码下载 HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">      My JSP 'Test.jsp' starting page         This is my JSP page.     Date : new java.util.Date().toString()

2013-05-14 14:31:01 523

原创 解决织梦DedeCMS恶意注册的方法

如果你的站正在备受垃圾会员注册,和群发广告文章的煎熬,那么,恭喜你,只用一招,几乎就可以耳根清静啦!     具体方法是:在member 目录下面的index.php , reg_new.php文件里面加上来路的判断,代码为:      $flag=0;     if( stristr ($_SERVER['HTTP_REFERER'],"sql8.net")) {   $fl

2013-05-12 16:47:23 636

转载 2009-06-16 17:27 服务器:消息 823,级别 24,状态2,行1,连接中断

http://hi.baidu.com/wangfeng200810/item/0613b8b4a9820e44ba0e12f2 当你在查询分析器用select * 查询时会报上面的错误,你可以用topch或where子句查询,dbcc checktable('表1',REPAIR_ALLOW_DATA_LOSS) go 查询分析器提示: 服务器: 消息 7919,

2013-05-07 10:40:13 2122

转载 C# 生成随机数

private static char[] constant = { '0','1','2','3','4','5','6','7','8','9', 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w'

2013-05-06 09:50:59 787

转载 关于sqlite3使用top的一些规则总结

最近需要做一些关于sqlite3里使用像在sqlserver 里top的一些语法,即根据条件显示前几条的数据记录,在sqlite3中没有top这样的语法,查了好多资料终于找到了可以实现相同效果的sqlite3 sql语句,供大家交流:sqlite3 sql是用limit这样的语法来实现的:例:select * from table where name='Xiao ming' orde

2013-05-05 23:44:52 668

转载 sqlite 中主键id自增的方法

困扰了一段时间,先前的解决方法是定义静态变量rid=0,然后把++rid插入数据库的id列中,但是每次重启的时候,rid就自动从0开始,就会导致有相同的id,插入数据库发生错误。今天在网上又查了一下,发现了以前试过的一个方法,定义Id 为INTEGER PRIMARY KEY,然后每次进行插入数据操作的时候,在id列插入空值,以前操作的时候没有成功,检索出来的数据id列为空值,没有预期的效果,但是

2013-05-05 23:44:04 3980

jQueryAPI,ajax十分好用

jQuery 核心函数 jQuery(expr, [context]) jQuery(html, [ownerDoc]) jQuery(html, props) jQuery(elements) jQuery() jQuery(callback) jQuery 对象访问 each(callback) size() length selector context get() get(index) index(subject) 数据缓存 data([name] , [value]) data(obj) removeData(name) $.data([el], [key], [val]) 队列控制 queue(name ,[cb|queue]) dequeue(name) clearQueue([queueName]) 插件机制 jQuery.fn.extend(object) jQuery.extend(object) 多库共存 jQuery.noConflict([ex]) 属性 属性 attr(name) attr(properties) attr(key, value) attr(key, fn) removeAttr(name) CSS 类 addClass(class | fn) removeClass([class | fn]) toggleClass(class|fn [, sw]) HTML代码/文本/值 html( [val | fn] ) text( [val | fn] )

2012-05-14

delphi动态虚拟覆盖重载重定义的区别

DELPHI中方法的类型及其覆盖、重载 1、静态方法是方法的缺省类型,对它就像对通常的过程和函数那样调用,编译器知道这些方法的地址,所以调用一个静态方法时它能把运行信息静态地链接进可执行文件,所以,静态方法速度最快,但它们却不能被覆盖来支持多态性。 2、虚拟方法和静态方法的调用方式相同。由于虚拟方法能被覆盖,在代码中调用一个指定的虚拟方法时编译器并不知道它的地址,因此,编译器通过建立虚拟方法表(VMT)来查找在运行时的函数地址。所有的虚拟方法在运行时通过VMT来高度,一个对象的VMT表中除了自己定义的虚拟方法外,还有它的祚的所有的虚拟方法,因此虚拟方法比动态方法用的内存要多,但它执行得比较快。 3、动态方法跟虚拟方法基本相似,只是它们的高度系统不同。编译器为每一个动态方法指定一个独一无二的数字,用这个数字和动态方法的地址构造一个动态方法表(DMT)。不像VMT表,在DMT表中仅有它声明的动态方法,并且这个方法需要祖先的DMT表来访问它蓁的动态方法。正因为这样动态方法比虚拟方法用的内存要少,但执行起来罗慢,因为有可能要到祚对象的DMT中查找动态法。 4、OP通过覆盖使一方法在不同的派生类间表现出不同的行为。OP中能被覆盖的方法是在声明时被标识为virtual或dynamic的方法。为了覆盖一个方法,在派生类的声明中用override代替virtual或dynamic。用了override后,编译器就会用新的方法替换VMT中原先的方法,而原先的方法也还存在,而如果用override再次声明一个静态方法,则是真正的覆盖,是用新的方法完全替换在祖先类中的同明方法。 5、方法重载的意义:比如说,你要写一个求两数商的函数(当然只是个比喻),你希望这个函数可以处理所有的数值类型,但PASCAL的运算对类型实行严格检查,你不得不用不同的程序来运算不同类型的数值,这样你就必须为每一种类型写一个同样功能的函数,并使用不同的函数名,坏处我想你是知道的。而重载却可以解决这个问题,同样的函数名,编译器可以用不同的形参类型决定调用哪个函数。Top dynamic和virtual的不同之处 delphi动态虚拟覆盖重载重定义的区别 (www.ip8000.com www.sql8.net)

2010-11-24

delphi动态虚拟覆盖重载重定义的区别

DELPHI中方法的类型及其覆盖、重载 1、静态方法是方法的缺省类型,对它就像对通常的过程和函数那样调用,编译器知道这些方法的地址,所以调用一个静态方法时它能把运行信息静态地链接进可执行文件,所以,静态方法速度最快,但它们却不能被覆盖来支持多态性。 2、虚拟方法和静态方法的调用方式相同。由于虚拟方法能被覆盖,在代码中调用一个指定的虚拟方法时编译器并不知道它的地址,因此,编译器通过建立虚拟方法表(VMT)来查找在运行时的函数地址。所有的虚拟方法在运行时通过VMT来高度,一个对象的VMT表中除了自己定义的虚拟方法外,还有它的祚的所有的虚拟方法,因此虚拟方法比动态方法用的内存要多,但它执行得比较快。 3、动态方法跟虚拟方法基本相似,只是它们的高度系统不同。编译器为每一个动态方法指定一个独一无二的数字,用这个数字和动态方法的地址构造一个动态方法表(DMT)。不像VMT表,在DMT表中仅有它声明的动态方法,并且这个方法需要祖先的DMT表来访问它蓁的动态方法。正因为这样动态方法比虚拟方法用的内存要少,但执行起来罗慢,因为有可能要到祚对象的DMT中查找动态法。 4、OP通过覆盖使一方法在不同的派生类间表现出不同的行为。OP中能被覆盖的方法是在声明时被标识为virtual或dynamic的方法。为了覆盖一个方法,在派生类的声明中用override代替virtual或dynamic。用了override后,编译器就会用新的方法替换VMT中原先的方法,而原先的方法也还存在,而如果用override再次声明一个静态方法,则是真正的覆盖,是用新的方法完全替换在祖先类中的同明方法。 5、方法重载的意义:比如说,你要写一个求两数商的函数(当然只是个比喻),你希望这个函数可以处理所有的数值类型,但PASCAL的运算对类型实行严格检查,你不得不用不同的程序来运算不同类型的数值,这样你就必须为每一种类型写一个同样功能的函数,并使用不同的函数名,坏处我想你是知道的。而重载却可以解决这个问题,同样的函数名,编译器可以用不同的形参类型决定调用哪个函数。Top www.ip8000.com sql8.net

2010-11-24

高清缩略图代码,可删除原图不会出现在XXX.jpg正在使用中,水印代正在研究中

我在网上用了很多的相关代码或者缩略图水印类,但是都有一个问题就是删除不了原图 public static void myGetThumbnailImage(string SourceFile, string strSavePathFile, int ThumbWidth, int ThumbHeight, string BgColor) { System.Drawing.Image oImg = System.Drawing.Image.FromFile(SourceFile); //小图 int intwidth, intheight; if (oImg.Width > oImg.Height) { if (oImg.Width > ThumbWidth) { intwidth = ThumbWidth; intheight = (oImg.Height * ThumbWidth) / oImg.Width; } else { intwidth = oImg.Width; intheight = oImg.Height; } } else { if (oImg.Height > ThumbHeight) { intwidth = (oImg.Width * ThumbHeight) / oImg.Height; intheight = ThumbHeight; } else { intwidth = oImg.Width; intheight = oImg.Height; } } //构造一个指定宽高的Bitmap Bitmap bitmay = new Bitmap(intwidth, intheight); Graphics g = Graphics.FromImage(bitmay); Color myColor; if (BgColor == null) myColor = Color.FromName("white"); else myColor = Color.FromName(BgColor); //用指定的颜色填充Bitmap g.Clear(myColor); g.InterpolationMode = InterpolationMode.HighQualityBicubic; //开始画图 g.DrawImage(oImg, new Rectangle(0, 0, intwidth, intheight), new Rectangle(0, 0, oImg.Width, oImg.Height), GraphicsUnit.Pixel); bitmay.Save(strSavePathFile, System.Drawing.Imaging.ImageFormat.Jpeg); g.Dispose(); bitmay.Dispose(); oImg.Dispose(); //删除源图 try { File.Delete(SourceFile); } catch { } }

2009-09-29

软件开发文档|需求说明|设计说明|国简标准-软件

软件开发文档|需求说明|设计说明|国简标准-软件

2009-03-12

经典cookie购物车源码[GridView实现]

特别说明请注意: 根许多网友反应, using Maticsoft.Functions; 这些代码看不懂 其实Functions 这个dll是我定义常用的函数类,如果需要跟我联系索取http://sql8.net 下面有我的群号, 其中 ArtsShop.Model.Arts_Product _p = new ArtsShop.Model.Arts_Product(); ArtsShop.BLL.Arts_Product p = new ArtsShop.BLL.Arts_Product(); _p = p.GetModel(id); 这是我的商品信息的类,三层结构,这个在用时你们只能换成你们自己的,这些代码完全可以删除, 比如 MyDr[1] = _p.Title; 用来读取商品名的,你们可以改MyDr[1] = dr["productname"].ToString();就行了, AddToCart.aspx页面代码 无标题页 <asp:TextBox ID="TextBox1" runat="server" Text='' Width="44px"> <asp:Label ID="Label1" runat="server" Text=''> 保存 取消 编辑 继续购物 清空购物车 下订单 AddToCart.aspx.cs页面代码 using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using Maticsoft.Functions;public partial class AddToCart : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { int ProID; HttpCookie cookie; bool Tempbl = false; string Tempstr; if (!Page.IsPostBack) { if (!object.Equals(Request.QueryString["id"], null)) { ProID = int.Parse(Request.QueryString["id"]); //创购物车cookie yxy .//sql8.net if (object.Equals(Request.Cookies["ztbscart"], null)) cookie = new HttpCookie("ztbscart"); else cookie = Request.Cookies["ztbscart"]; //判断是否已存在于购物车内 yxy // sql8.net for (int i = 0; i < cookie.Values.Keys.Count; i++) { if (!object.Equals(cookie.Values.Keys[i], null)) { Tempstr = cookie.Values.AllKeys[i].ToString(); if (Tempstr.Trim() != "") { if (ProID == int.Parse(cookie.Values.AllKeys[i])) { Tempbl = true; break; } } } } //不未购买过则加入购物车 yxy //sql8.net if (!Tempbl) cookie.Values.Add(ProID.ToString(), "1"); else { } TimeSpan ts = new TimeSpan(0, 0, 10, 0); cookie.Expires = DateTime.Now + ts; Response.AppendCookie(cookie); } BindGrid(); } } //绑定数据 yxy //sql8.net private void BindGrid() { DataTable MyDt; DataRow MyDr; string str = ""; MyDt = new DataTable(); MyDt.Columns.Add(new DataColumn("id", str.GetType())); MyDt.Columns.Add(new DataColumn("Title", str.GetType())); MyDt.Columns.Add(new DataColumn("Num", str.GetType())); MyDt.Columns.Add(new DataColumn("Price", str.GetType())); MyDt.Columns.Add(new DataColumn("Discount", str.GetType())); MyDt.Columns.Add(new DataColumn("Vipprice", str.GetType())); MyDt.Columns.Add(new DataColumn("Totle", str.GetType())); if (!object.Equals(Request.Cookies["ztbscart"], null)) { HttpCookie cookie = Request.Cookies["ztbscart"]; double Totle; //Response.Write("|" + Request.Cookies["ztbscart"].Values.Keys[1].ToString() + "|"); //Response.End(); for (int i = 0; i < cookie.Values.Keys.Count; i++) { int id; MyDr = MyDt.NewRow(); if (cookie.Values.AllKeys[i] != "" && cookie.Values[i] != "") { id = int.Parse(cookie.Values.AllKeys[i].ToString()); ArtsShop.Model.Arts_Product _p = new ArtsShop.Model.Arts_Product(); ArtsShop.BLL.Arts_Product p = new ArtsShop.BLL.Arts_Product(); _p = p.GetModel(id); MyDr[0] = id; MyDr[1] = _p.Title; MyDr[2] = cookie.Values[i]; MyDr[3] = _p.Price; MyDr[4] = _p.Discount; MyDr[5] = _p.Vipprice1; Totle = double.Parse(MyDr[2].ToString()) * double.Parse(MyDr[5].ToString()); MyDr[6] = Totle; MyDt.Rows.Add(MyDr); } } GridView1.DataSource = MyDt.DefaultView; GridView1.DataBind(); } } protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { //编辑某行数量 yxy //sql8.net GridView1.EditIndex = e.NewEditIndex; BindGrid(); } protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { //取消更新 yxy //sql8.net GridView1.EditIndex = -1; BindGrid(); } protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { //更新数量 yxy //sql8.net string num; TextBox tempbx = new TextBox(); Label templb = new Label(); tempbx = (TextBox)(GridView1.Rows[e.RowIndex].Cells[6]).Controls[1]; num = tempbx.Text.ToString(); HttpCookie cookie = new HttpCookie("ztbscart"); for (int i = 0; i < GridView1.Rows.Count; i++) { string id; string tempnum; id = GridView1.Rows[i].Cells[1].Text.ToString(); if (e.RowIndex == i) tempnum = num; else { templb = (Label)(GridView1.Rows[i].Cells[6]).Controls[1]; tempnum = templb.Text.ToString(); } if (tempnum.Trim() == "") tempnum = "0"; //Response.Write("ID:"+id.ToString() + "Num:"+tempnum+":"+i+"");//测试用途 yxy//sql8.net cookie.Values.Add(id, tempnum); } //Response.End(); TimeSpan ts = new TimeSpan(0, 0, 10, 0); cookie.Expires = DateTime.Now + ts; Response.AppendCookie(cookie); GridView1.EditIndex = -1; Message.GoTo("AddToCart.aspx"); } protected void LinkButton4_Click(object sender, EventArgs e) { //继续购物 yxy //sql8.net Message.WebClose(); } protected void LinkButton3_Click(object sender, EventArgs e) { //清空购物车 yxy //sql8.net CheckBox tempcb = new CheckBox(); HttpCookie cookie = new HttpCookie("ztbscart"); Label templb = new Label(); for (int i = 0; i < GridView1.Rows.Count; i++) { tempcb = (CheckBox)(GridView1.Rows[i].Cells[0]).Controls[1]; if (!tempcb.Checked) { string id; string tempnum; id = GridView1.Rows[i].Cells[1].Text.ToString(); templb = (Label)(GridView1.Rows[i].Cells[6]).Controls[1]; tempnum = templb.Text.ToString(); if (tempnum.Trim() == "") tempnum = "0"; //Response.Write("ID:"+id.ToString() + "Num:"+tempnum+":"+i+"");//测试用途 yxy//sql8.net cookie.Values.Add(id, tempnum); } } TimeSpan ts = new TimeSpan(0, 0, 10, 0); cookie.Expires = DateTime.Now + ts; Response.AppendCookie(cookie); Message.GoTo("AddToCart.aspx"); } protected void CheckAll_CheckedChanged(object sender, EventArgs e) { //全选事件 yxy //sql8.net CheckBox tempcb = new CheckBox(); bool tempbl; tempcb = (CheckBox)(GridView1.HeaderRow.Cells[0]).Controls[1]; tempbl = tempcb.Checked; for (int i = 0; i < GridView1.Rows.Count; i++) { tempcb = (CheckBox)(GridView1.Rows[i].Cells[0]).Controls[1]; tempcb.Checked = tempbl; } } } _________________________________________________________________________ 如转载请注明原出处 www.sql8.net

2008-09-11

图书店源码asp数据sql

书库源码asp数据sql如果有问题请上www.sql8.net交流

2008-09-09

图书店系统.net2003 sql2000

很好用的,购物车不错,如果问题可到www.sql8.net交流

2008-09-09

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除