
学习小记
文章平均质量分 66
denuvead
学习阶段
展开
-
C#的一些面试题
1. 简述 private、 protected、 public、 internal 修饰符的访问权限。答 . private : 私有成员, 在类的内部才可以访问。 protected : 保护成员,该类内部和继承类中可以访问。 public : 公共成员,完全公开,没有访问限制。 internal: 在同一命名空间内可以访问。2 .列举A原创 2008-04-09 09:48:00 · 432 阅读 · 0 评论 -
使用母版页时内容页如何使用css
由于网站的主要频道页和列表页的头部和底部都是一样的,如果将每个页面放在单独的页面中,当头部和底部需要更改时维护量太大。于是想把头部和底部做成母版页,频道页和列表页的具体内容放到内容页中。这样当头和底需要改动时,只要修改一下母版页就可以了。好处有了,问题也接着来了。原来在频道页和列表页中有其各自的css引入和一些javascript函数,当使用母版页时,放在内容页中这些css样式和jav转载 2008-07-28 09:56:00 · 1191 阅读 · 0 评论 -
让低版本的浏览器也支持hover(JS实现)
<!--body { background:#fff; }table { border:solid 1px #ccc; color:#ccc; }table:hover,table.hover { border-color:#900; color:#333; }ul li:hover,ul li.hover { background:#ee转载 2008-07-30 10:03:00 · 718 阅读 · 2 评论 -
T-sql DateTime数据类型的格式转换
数据库中有个字段叫orderTime,是DateTime类型的数据,如果我们用以下SQL语句把它取出来:selectorderTimefrom orders则会把时间都显示出来,而如果改成下面的SQL语句:selectorderTime = convert(varchar(10),orderTime,120)from orders则会显示YYYY-MM-DD的格式,如:2006-06-13实转载 2008-07-30 13:41:00 · 1537 阅读 · 0 评论 -
结构体
using System;using System.Collections.Generic;using System.Text;namespace struct02...{ public struct CoOrds ...{ public int x, y; public CoOrds(int p1, int p2) ...{原创 2008-05-19 21:37:00 · 386 阅读 · 0 评论 -
ArrayList的小小例子
using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace arraylist...{ class arraylist_example ...{ public void PrintValues(IEnumerable myList)原创 2008-05-19 22:21:00 · 444 阅读 · 0 评论 -
HashtableExample
using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace HashtableExample...{ class Program ...{ static void Main(string[] args) ...{原创 2008-05-19 22:31:00 · 334 阅读 · 0 评论 -
枚举的例子
using System;using System.Collections.Generic;using System.Text;namespace enumtrasform...{ enum Range : long ...{ Max = 2147483648L, Min = 255L }; class Program ...{ static void Main原创 2008-05-19 21:20:00 · 613 阅读 · 0 评论 -
asp.net的TextBox回车触发事件
一//直接在js中写script language="javascript"> function EnterTextBox() { if(event.keyCode == 13 && document.all["TextBox1"].value != "") { event.keyCode = 9; e转载 2008-08-04 19:41:00 · 1221 阅读 · 1 评论 -
Boxing and Unboxing
using System;using System.Collections.Generic;using System.Collections;using System.Text;namespace Boxing{ class Program { static void Main(string[] args) { int count;原创 2008-05-22 20:31:00 · 383 阅读 · 0 评论 -
解决IE7一下版本的最小宽度。最大可以使用类似方法
min-width: 750px;*width: expression( document.body.clientWidth < 750 ? "750px" : "100%" );原创 2008-08-07 11:51:00 · 1416 阅读 · 0 评论 -
T-SQL中的比较实用技巧,处理数字为小数点后两位和判断类型显示不同文字
ALTER PROCEDURE [dbo].[sp_GetListPortfolio]@AccountId uniqueidentifierasselect PortfolioId, AccountId, PortfolioName, CreateDate, CAST(TotalCost as decimal(38,2)) as TotalCo原创 2008-05-28 13:44:00 · 1094 阅读 · 1 评论 -
关于数据绑定的时候判断Repeater中数据改变其整行颜色
PagedDataSource版 protected void rpInCome_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)原创 2008-06-10 17:38:00 · 4722 阅读 · 2 评论 -
正则号码
Ext.apply(Ext.form.VTypes, { telphone: function isTel(s) { var patrn=/^(/+?/d{2,4})?-?/d{3,4}(-)?/d{7,8}((-)?/d{3,4})?$|(((/+?/d{2,4})?-?)|0)?(1[35][0-9]{9})+$/; if (!patrn.exec(s)) return原创 2008-06-10 17:59:00 · 485 阅读 · 0 评论 -
xml及dataset的一些小记
DataSet newds = new DataSet(); DataTable newdt = dt.Copy(); newdt.Namespace = "PortfolioInfo"; System.Type typestring = System.Type.GetTy原创 2008-06-18 15:30:00 · 586 阅读 · 0 评论 -
C# 网页代码转换及 其他
//过滤html public static string GethtmlEncode(string str) { if (str == null) { return ""; } else { StringBuilder s原创 2008-09-07 10:48:00 · 650 阅读 · 0 评论 -
sql 数据库连接 暨 ado.net 小例
using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;namespace CommandDemo{ class Program { static void Ma原创 2008-09-09 19:44:00 · 505 阅读 · 0 评论 -
与按钮雷同的超链接
a:link, a:visited { display: block; width: 6em; /* dimensions needed for IE5.x/Win */ padding: 0.2em; line-height: 1.4; background-color: #94B8E9; border: 1px solid black;原创 2008-09-08 21:18:00 · 500 阅读 · 0 评论 -
XSL:XSL基础学习第二部分
本实例目的:用comment()访问XML中的注释语句 Student003.xslxml version="1.0" encoding="gb2312" ?>xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">xsl:template match="/">xsl:apply-t转载 2008-05-11 09:14:00 · 481 阅读 · 0 评论 -
C# 文本框只能输入数字和退格键
private void TextBox_KeyPress(object sender, KeyPressEventArgs e) ...{ if(e.KeyChar!=8&&!Char.IsDigit(e.KeyChar)) ...{ e.Handled = true; } }//或者private void TextBox_KeyPress(object sende原创 2008-04-30 12:47:00 · 2660 阅读 · 1 评论 -
简易静态方法使用
using System;using System.Collections.Generic;using System.Text;namespace condition...{ class Program ...{ static void Main(string[] args) ...{ //按照条件表达式输出原创 2008-05-01 08:39:00 · 417 阅读 · 0 评论 -
c# repeater分页代码(比第一种效果好)
Default.aspx 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.原创 2008-04-26 14:08:00 · 2690 阅读 · 1 评论 -
在textBox中只允许输入整数或小数和使用退格键。
最佳方案第一个. private void textBox1_KeyPress(object sender, KeyPressEventArgs e) ...{ //IsNumber:指定字符串中位于指定位置的字符是否属于数字类别 //IsPunctuation:指定字符串中位于指定位置的字符是否属于标点符号类别原创 2008-05-07 12:08:00 · 1650 阅读 · 1 评论 -
ListBox实现更改选中项目的顺序
窗体很简单 我主要是要做一下功能;简单的实现了下,没有做比较严谨的规划和按钮限制考虑, 有兴趣的朋友可以改进功能,大体上就下面的这样的个窗体代码如下: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;u原创 2008-05-07 22:27:00 · 3373 阅读 · 0 评论 -
XML的增加项目.添加属性 等
private void SaveXml() ...{ XmlDocument doc = new XmlDocument(); string path = Setting.Instance.QuestionXmlFile; doc.Load(path); XmlNodeList nodeli原创 2008-05-09 16:29:00 · 659 阅读 · 0 评论 -
判断字符串中是否有指定的字符
static void Main(string[] args) ...{ string s = "1.234"; int i = s.IndexOf(.); //使用区分,没有的话 它也会有一个.所以我们要减去1 int j = s.Split(.).Count()-1;原创 2008-05-10 11:03:00 · 1371 阅读 · 0 评论 -
XSLT轻松入门:XPath的语法
4.XPath的语法我们在前面已经提到过,XPath是用来帮助XSLT在XML源文档中查找定位信息的语言。在实际使用过程中,XPath和XSLT总是混在一起使用,在上面一章的语法例子中我们已经有使用到XPath的语法,只是没有明确点出。但W3C将它们分成两个标准,所以我们也将它们拆成两章来讲解。 4.XPath的语法 4.1 当前位置 4.2 寻址操作 4.3 运算符 4.4 功能函数 4.1转载 2008-05-11 09:57:00 · 462 阅读 · 0 评论 -
C#基础学习之异常捕获用法小例
using System;using System.Collections.Generic;using System.Text;namespace Message...{ class FileOperation ...{ public void FileOpen(string filename) ...{ throw new Exc原创 2008-05-11 18:38:00 · 425 阅读 · 0 评论 -
C#基础学习之构造方法及静态方法联动 举例
using System;using System.Collections.Generic;using System.Text;namespace staticway...{ //定义基类 class CommaFile ...{ public CommaFile(string filename) ...{ Console.W原创 2008-05-11 20:34:00 · 350 阅读 · 0 评论 -
C#基础学习之获取ip与readonly用法小例
using System;using System.Collections.Generic;using System.Text;using System.Net;namespace readonly...{ class workstation ...{ public const string HostName = "lenovo-e590f938";原创 2008-05-11 20:52:00 · 369 阅读 · 0 评论 -
C#基础学习之练手
using System;using System.Collections.Generic;using System.Text;namespace DerivedClass{ class DataBase { public int common; public DataBase() { common = 100;原创 2008-05-11 21:07:00 · 606 阅读 · 0 评论 -
XSL:XSL基础学习第三部分
本实例目的:转义字符的用法 xml version="1.0" encoding="gb2312" ?>xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">xsl:template match="/">成绩<90学生名单:xsl:apply-templates select="转载 2008-05-11 09:22:00 · 606 阅读 · 0 评论 -
XSL:XSL基础学习第四部分
本实例目的:用CHOOSE实现多重条件Student015.xmlxml version="1.0" encoding="gb2312"?>xml-stylesheet type="text/xsl" href="Student015.xsl" ?>成绩单> 这里只有男同学的情况 -->学生> 学号>0000001学号>姓名>张三姓名>分数>81分数>学生>学生>学号>0000002转载 2008-05-11 09:31:00 · 504 阅读 · 0 评论 -
C#基础学习之枚举用法小例
using System;using System.Collections.Generic;using System.Text;namespace @enum...{ enum Days ...{ Sat = 1, Sun, Mon, Tue, Wed, Thu, Fri原创 2008-05-11 21:12:00 · 443 阅读 · 0 评论 -
XSL-FO学习笔记
能够生成PDF文件,总是件让我感到很神秘的事情。我以前用过的生成PDF的方法有1)将相关文件用相应的软件打开,“打印”到一个文件如ali.prn,然后手工将ali.prn改为ali.ps,再用GostView打开ali.ps,最后用其convert功能生成pdf文件,有一定比率的不成功;2)利用Acrobat Distiller;3)利用Acrobat PDFWriter。 现在,可以通过xsl转载 2008-05-10 22:36:00 · 1969 阅读 · 0 评论 -
substring的用法
学会substring的用法,加油哦。下面还有更多要学的。下面是网上摘抄的资料:string substring(string, number, number?) 备注 该字符串中的每个字符都被认为具有数字位置:第一个字符的位置是 1,第二个字符的位置是 2,依此类推。如果未指定第三个参数,将返回从第二个参数指定的位置开始直到字符串结尾的子字符串。如果参数不是字符串类型原创 2008-05-11 08:51:00 · 2107 阅读 · 1 评论 -
一个使用sql实现分页的例子
ALTER procedure [dbo].[up_GetFundPortfolio]( @Total int output, @PageIndex int = 1, @PageSize int = 30)asset nocount onselect ROW_NUMBER() over (order by Symbol de原创 2008-06-24 15:15:00 · 562 阅读 · 0 评论