代码改变世界

随笔档案-2010年01月

博客搬家

2010-01-23 20:18 by 三皮开发时, 228 阅读, 收藏,
摘要: 经过一下午的筛选终于从163博客搬到博客园这个大家庭这里,我能感觉到Asp.Net的"喧哗"后,在这个大家庭里我会好好的做个"田鸡"努力的向老鸟们学习,最终成为老鸟. - -! 阅读全文

时间间隔计算

2010-01-23 19:58 by 三皮开发时, 692 阅读, 收藏,
摘要: C#时间间隔计算可以通过时间刻度类TimSpan类实现,这是一个系统类。C#时间间隔计算举例说明:实现两个时间之间C#时间间隔计算: TimeSpan ts1 = new TimeSpan(DateTime.Now.Ticks); //获取当前时间的刻度数 //你的代码或者其他操作 TimeSpan ts2 = new TimeSpan(DateTime.Now.Ticks); TimeSpan ... 阅读全文

前台获取后台数据写法<%#%>..

2010-01-23 19:57 by 三皮开发时, 708 阅读, 收藏,
摘要: 一.共同之处:都是前台调用后台方法或者变量<%=Test()%>... 这种方法在使用控件的text属性下需要注意,可以使用在html控件但不能使用在服务器控件如果设置<asp:TextBox id="text" runat="server" text="<%=Text()%>"></asp:TextBox> 这是有错误的需要使用<%#Text... 阅读全文

ASP.net页面传值6重点.

2010-01-23 19:56 by 三皮开发时, 150 阅读, 收藏,
摘要: 在面试的时候,经常会遇到这样的问题,其实我们会对其中的几种方法比较熟悉,因为项目中经常使用。但是要全面的回答ASP.NET中页面传值的方式,估计往往很难全面。一. 使用QueryString变量    QueryString是一种非常简单也是使用比较多的一种传值方式,但是它将传递的值显示在浏览器的地址栏中,如果是传递一个或多个安全性要求不高或是结构简单的数值时,可以使用这个方法。 Response... 阅读全文

Asp.net面试题

2010-01-23 19:55 by 三皮开发时, 183 阅读, 收藏,
摘要: 1. 简述 private、 protected、 public、 internal 修饰符的访问权限。答: private : 私有成员, 在类的内部才可以访问。 protected : 保护成员,该类内部和继承类中可以访问。 public : 公共成员,完全公开,没有访问限制。 internal: 在同一命名空间内可以访问。2 .列举ASP.NET 页面之间传递值的几种方式。 答: 1.使用Q... 阅读全文

DataList 外部事件获取DataList内部值

2010-01-23 19:54 by 三皮开发时, 205 阅读, 收藏,
摘要: //外部事件 protected void OK_Click(object sender, ImageClickEventArgs e) { foreach (DataListItem item in RoomList.Items) { if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.Alternati... 阅读全文

datalist 嵌套 datalist 及 内部按钮事件触发

2010-01-23 19:53 by 三皮开发时, 622 阅读, 收藏,
摘要: 前台<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="TNT.ETourBusinessPlatform.Web.bar.test" MasterPageFile="~/MasterPage.Master" %><asp:Content ID="Content1" r... 阅读全文

进制之间转换(面试题)

2010-01-23 19:51 by 三皮开发时, 434 阅读, 收藏,
摘要: #include<studio.h>void ex10to2();void ex10to8();void ex10to16();void main(){ int select; do { printf("\n 0-exi 1-10to2 2-10to8 3-10to16\n"); printf("Please Select Operator:"); scanf("%d",&se... 阅读全文

dotnetTextBox使用

2010-01-23 19:50 by 三皮开发时, 345 阅读, 收藏,
摘要: 感觉这网页编辑控件很强大--------------------------------------配置:first: 添加dotnetTextBox.dll文件<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" ValidateRequest="false" Inherits="_Default"... 阅读全文

数据结构链表倒序(面试题)

2010-01-23 19:49 by 三皮开发时, 645 阅读, 收藏,
摘要: Node* ReverseList(Node *head) { if((head->next == NULL) || (head == NULL)) return head; Node *temp1 = head; Node *temp2; Node *temp3 = temp1->next; temp1->next = NULL; while(temp3->next !=... 阅读全文

类似百度谷歌搜索,搜索出关键字显红色

2010-01-23 19:46 by 三皮开发时, 518 阅读, 收藏,
摘要: DinaSet.cs 用于将搜索的关键字放入数组,用于替换关键字用,令搜索的关键字显红色using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Text;using System.Collections;using System.IO;/// <summary&... 阅读全文

快捷键技巧小积累

2010-01-23 19:41 by 三皮开发时, 203 阅读, 收藏,
摘要: 1.F12:转到定义----vs平台2.ctrl+a,k,f 页面前台代码(xml)排序,后台代码排序 ctrl+a,e,d3.全选,ctrl+shit+L rose, power Designer 连接线为直线。4.window键(ctrl右边那个)+r =运行,windows键+E=我的电脑,windows键+D=显示桌面.5.ctrl+e,c 注释 ctrl+e,u 取消注释 ctrl+e,... 阅读全文

frameset 与弹出层拖拽结合使用

2010-01-23 19:39 by 三皮开发时, 871 阅读, 收藏,
摘要: Default.aspx left.aspx right.aspx top.aspx link.aspx分别是主页、左部、 右部、顶部、弹出层------------------------------------------------------------------------Default.aspx<%@ Page Language="C#" AutoEventWireup="tr... 阅读全文

XML与DataSet操作使用

2010-01-23 19:37 by 三皮开发时, 310 阅读, 收藏,
摘要: 1.基本 protected void Button1_Click(object sender, EventArgs e) { SqlConnection con = GetCon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from tb_VoteItem"; cmd.Connection = con; Sq... 阅读全文

GrideView选中和悬浮效果

2010-01-23 19:35 by 三皮开发时, 330 阅读, 收藏,
摘要: 深色的是单击鼠标选中的,浅一点的是鼠标悬停在上面的,具体是:鼠标停在某行上是,该行自动变成上图所示的浅一些的背景色,单击的话,背景色变深,上次单击选中的行背景色恢复最初。下面是代码:protected void GvSelectResult_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataCo... 阅读全文

数据控件的使用心得

2010-01-23 19:34 by 三皮开发时, 268 阅读, 收藏,
摘要: 1.DataList--实现了跨表传值方法前台:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DataList.aspx.cs" Inherits="DataList" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://... 阅读全文

天天UP

2010-01-23 19:33 by 三皮开发时, 188 阅读, 收藏,
摘要: 每天晚上,请你问自己这些问题:1, 今天我是否克服了技术上新的困难?2, 今天我是否多读了一些新书?3, 今天我是否就某方面的问题与人进行了交流?4, 今天我是否多认识了一个新同事或新朋友并准备与他们保持联络?5, 今天我是否更多的接触到身处的行业需求,现状,和发展?精通技术精通技术是技术人员的根本要求,也是技术人员人生发展的必经之路,只有首先精确掌握一门技术,才能触类旁通的掌握其他技术。精通技术... 阅读全文

程序员与程序

2010-01-23 19:28 by 三皮开发时, 148 阅读, 收藏,
摘要: 程序就是程序员行为的一个反影, 一段好的代码是指在特定的环境下, 用最少的资源产生最大的效益, 程序员写出好的程序并从中获得质感与生活的提升. 阅读全文

验证码 观赏指数:*

2010-01-23 19:23 by 三皮开发时, 158 阅读, 收藏,
摘要: 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.We... 阅读全文

发送邮件

2010-01-23 19:22 by 三皮开发时, 150 阅读, 收藏,
摘要: using System.Net.Mail;//使用该命名空间public void button1_onclick(object sender EventArgs e){//Message 对应:发件人地址,接收邮件地址,邮件的标题,邮件的内容 MailMessage myMail = new MailMessage(TextBox2.Text.Trim(), TextBox1.Text.Tri... 阅读全文

老忘的WebConfig连接字串格式

2010-01-23 19:16 by 三皮开发时, 198 阅读, 收藏,
摘要: 1. <connectionStrings> <add name="db_StudentConnectionString" connectionString="Data Source=.;Initial Catalog=db_Student;Integrated Security=True"/> </connectionStrings>Data Source=... 阅读全文

GridView排序

2010-01-23 19:12 by 三皮开发时, 326 阅读, 收藏,
摘要: using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using ... 阅读全文

GridView实践2

2010-01-23 19:08 by 三皮开发时, 249 阅读, 收藏,
摘要: using System;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebContr... 阅读全文

GirdView实践1

2010-01-23 19:07 by 三皮开发时, 156 阅读, 收藏,
摘要: using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;usi... 阅读全文

GridView应用篇2

2010-01-23 19:03 by 三皮开发时, 173 阅读, 收藏,
摘要: 11.GridView一般换行与强制换行:效果图:首先设置<asp:BoundField DataField="家庭住址" HeaderText="家庭住址" ItemStyle-Width="100" />gridview里有一列绑定的数据很长,显示的时候在一行里面显示,页面拉得很宽。原因是连续英文段为一个整体导致的,在RowDataBound中添加上了一句e.Row.Cells[2... 阅读全文

GridView应用篇1

2010-01-23 19:00 by 三皮开发时, 198 阅读, 收藏,
摘要: 1.GridView无代码分页排序:效果图:1.AllowSorting设为True,aspx代码中是AllowSorting="True";2.默认1页10条,如果要修改每页条数,修改PageSize即可,在aspx代码中是PageSize="12"。3.默认的是单向排序的,右击GridView弹出“属性”,选择AllowSorting为True即可。2.GridView... 阅读全文

IE和FF兼容性问题

2010-01-22 19:32 by 三皮开发时, 315 阅读, 收藏,
摘要: Firefox浏览器良好支持W3C标准,是目前对CSS支持最好的浏览器,而ie是出现的比较早,在w3c支持方面做的一直不是很好,所以两种浏览器在很多方面不尽相同。 下面总结一下这两种浏览器的兼容问题: 1.集合类对象问题 说明:IE下,可以使用()或[]获取集合类对象; Firefox下,只能使用[]获取集合类对象. 解决方法:统一使用[]获取集合类对象. 2.HTML对象获取问题 FireFox... 阅读全文

导航条背景色点击更替交换

2010-01-22 19:30 by 三皮开发时, 383 阅读, 收藏,
摘要: /*2-5Click背景变换*/ function ChangeBgLi01(i, count) { for (var m = 1; m <= count; m++) { if (m != 6&&m!=1) { var d1 = document.getElementById("li0" + m); d1.className = ""; } else { if (m == 6... 阅读全文

数据转json数据

2010-01-22 19:17 by 三皮开发时, 439 阅读, 收藏,
摘要: 1.GetJson公共类 :将new DataSet().Talbe[0] 转Json 数据 格式{ users:[{"name":"zhangsan","age":12},{"name":"lisi","age":13}] };可以得出表名为:users 两行两列数据 name age zhangsan 12 lisi 13另外需要个引用:Newtonsoft.Json.dll csdn上好多~... 阅读全文

JQuery智能感应

2010-01-22 19:15 by 三皮开发时, 320 阅读, 收藏,
摘要: 学JQuery的路上....在学JQuery UI 时 需要jquery-ui-all-min-lastest.js (UI控件的JS代码需调用)文件&&jquery-min-lastest.js(压缩后的jQuery类库)文件&&jquery-1.3.2-vsdoc.js(JQuery在vs2008上智能感应)文件问题:在使用时,调用前两个文件 再调用智能感应文件... 阅读全文

jQuery验证validate插件

2010-01-22 19:13 by 三皮开发时, 432 阅读, 收藏,
摘要: 灰常好用jquery.validate.js当然还是用插件....别忘记引用JQuery 自带类库-------------------------------------------使用前介绍下label属性当用label标签把一段文本和一个控件绑定之后,用户点击文本,相关的控件就会获得焦点。隐式绑定不需使用for属性,直接把文本和控件嵌入在<label>标签中就行了。如:<l... 阅读全文

学习事务

2010-01-22 19:10 by 三皮开发时, 178 阅读, 收藏,
摘要: 事务和存储过程的联系create procedure SP_Transaction@AccountBalance float,@AccountName nchar(20)as--声明一个变量用来标记事务,如果更改数据没错就提交事务,否则回滚declare @Sign bitselect @Sign=0--事务的开始begin transaction--修改 客户ID=1 的 账户余额=100upd... 阅读全文

Sql查询时加自动增长列

2010-01-22 19:08 by 三皮开发时, 774 阅读, 收藏,
摘要: 1:没有主键的情形: Select identity(int,1,1) as iid,* into #tmp from TableName Select * from #tmp Drop table #tmp2:有主键的情形: Select (Select sum(1) from TableName where KeyField <= a.KeyField) as iid,* from Ta... 阅读全文