07 2012 档案
Js_DOM简单案例
摘要:1、单击后文字变大显示获取值属性2、简单时钟获取当前本机时间<html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <script type="text/javascript"> window.onload = function () { setTime(); } function setTime() { var div = document.getElementById("d1"); var tim 阅读全文
posted @ 2012-07-27 22:27 Fan帥帥 阅读(2000) 评论(0) 推荐(1)
一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10
摘要:一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE102012-04-25 16:29:04| 分类: 学习 |字号 订阅在网站开发中不免因为各种兼容问题苦恼,针对兼容问题,其实IE给出了解决方案Google也给出了解决方案百度也应用了这种方案去解决IE的兼容问题百度源代码如下<!Doctype html><html xmlns=http://www.w3.org/1999/xhtml xmlns:bd=http://www.baidu.com/2010/xbdml><head><meta http-equiv=Content-Type 阅读全文
posted @ 2012-07-27 21:01 Fan帥帥 阅读(34459) 评论(4) 推荐(3)
string 补充
摘要:1 1.取字符串长度 2 string str="中国"; 3 int Len=str.Length; //得到字符串的长度 4 2、字符串转为比特码 5 byte[] bytStr=System.Text.Encoding.Default.GetBytes(str); 6 len=bytStr.Length; 7 3.字符串相加 8 System.Text.StringBuilder sb=new System.Text.StringBuilder(); 9 sb.Append("中华"); 10 sb.Ap... 阅读全文
posted @ 2012-07-27 00:30 Fan帥帥 阅读(492) 评论(0) 推荐(0)
c# sql数据分页的应用
摘要:namespace SQL{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } int pageIndex = 1; //页码 int pageSize = 3; //每页3条 int pageCount; //共几页 private void Form1_Load(object sender, EventArgs e) { ... 阅读全文
posted @ 2012-07-23 22:28 Fan帥帥 阅读(1724) 评论(0) 推荐(0)
T-sql 基础(全)
摘要:--检查约束,选中,右键,CHECK约束,添加,标志起名--表达式,EmpAge>=0 and EmpAge<=150--唯一约束--选中,右键,索引,键--添加, 类型唯一键--列 字段名--标志,UQ- +字段名--默认约束--下面属性--默认值或绑定--清除表数据--truncate table dbo.tblStudent ----约束长度--LEN(长度)=11--datetime 默认约束--('2012-07-10')--需要设置字符串类型--获取当前时间--GETDATE()--在默认约束里写上、GETDATE()--死锁问题,编辑和设计要分开,不然 阅读全文
posted @ 2012-07-23 22:13 Fan帥帥 阅读(852) 评论(0) 推荐(0)
ADO.NET--SQL-Helper
摘要:1 using System; 2 using System.Data; 3 using System.Collections.Generic; 4 using System.Linq; 5 using System.Text; 6 using System.Data.SqlClient; 7 using System.Text.RegularExpressions; 8 public class SQLhelper 9 { //连接数据库 10 static string strconn=System.Configuration.Configurat... 阅读全文
posted @ 2012-07-23 22:08 Fan帥帥 阅读(632) 评论(0) 推荐(0)
JavaScript笔记
摘要:1、什么是javascript? javascript是一种脚本语言。脚本,一条条的文字命令。执行是由系统的一个解释器,将其一条条的翻译成机器可识别的指令,然后执行。常见的脚本:批处理脚本、T-sql脚本、vbscript等。 javascript是解释型语言,无需编译就可以随时运行、即使有语法问题也不提示。 javascript代码放到<script>标签中,script可以放在<head>/<body>等任意位置,而且可以不止一个<script>标签。alert函数是弹出消息窗口,newData()是创建一个Data累的对象,默认值就是当前时 阅读全文
posted @ 2012-07-23 22:00 Fan帥帥 阅读(416) 评论(0) 推荐(0)
参数化导入、导出数据
摘要:1、导入数据using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;using System.Data.SqlClient;namespace 参数导入{ public partial class Form1 : Form { public Fo... 阅读全文
posted @ 2012-07-14 00:29 Fan帥帥 阅读(306) 评论(0) 推荐(0)
值类型和引用类型的区别
摘要:C#的两大数据类型分别值类型和引用类型。很多人或许闭着眼睛都能说出值类型包括简单类型、结构体类型和枚举类型,引用类型包括自定义类、数组、接口、委托等,但是当被问及两者之间的联系和区别,什么时候用struct什么时候用class时,就常常混淆不消了。为此,了解值类型和引用类型的本质差异就变的很有必要了。1.值类型直接存储其值,变量本身就包含了其实例数据,而引用类型保存的只是实例数据的内存引用。因此,一个值类型变量就永远不会影响到其他的值类型变量,而两个引用类型变量则很有可能指向同一地址,从而发生相互影响。2.从内存分配上来看,值类型通常分配在线程的堆栈上,作用域结束时,所占空间自行释放,效率高, 阅读全文
posted @ 2012-07-13 01:22 Fan帥帥 阅读(320) 评论(0) 推荐(0)
简单版用户登录
摘要:简单实现: 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 9 using System.Data.SqlClient;10 using System.Text.RegularExpressions;11 12 namespace 用户登录13 { 阅读全文
posted @ 2012-07-13 01:09 Fan帥帥 阅读(225) 评论(0) 推荐(0)
T-SQL的基础代码
摘要:1、建立连接数据库 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Data; 6 using System.Data.SqlClient; 7 8 9 namespace 连接数据库10 {11 class Program12 {13 static void Main(string[] args)14 { //要连接数据库就要一个连接字符串,连接数据库的实例名,数据库... 阅读全文
posted @ 2012-07-13 01:00 Fan帥帥 阅读(253) 评论(0) 推荐(0)
四个经典例题
摘要:1、文件的复制static void Main(string[] args) { FileStream filer = new FileStream(@"dotnet基础加强练习.txt", FileMode.Open, FileAccess.Read); FileStream filew = new FileStream(@"2.txt", FileMode.Create, FileAccess.Write); byte[] by =new byte[100]; int count = 0; using... 阅读全文
posted @ 2012-07-13 00:55 Fan帥帥 阅读(202) 评论(0) 推荐(0)
string_示例
摘要:1、走马灯static void Main(string[] args){ string str = "我是一个走马灯"; while (true) { Console.Clear(); string head = str[0].ToString(); string body = str.Substring(1); str = body + head; Console.WriteL... 阅读全文
posted @ 2012-07-13 00:27 Fan帥帥 阅读(226) 评论(0) 推荐(0)
继承_封装_多态 02
摘要:真假Dcuknamespace Duck{ abstract class SubDuck { public abstract string Name { get; set; } //string name; //public string Name //{ // get { return name; } // set { name = value; } //} public void Sw... 阅读全文
posted @ 2012-07-13 00:20 Fan帥帥 阅读(216) 评论(0) 推荐(0)
继承_封装_多态 01
摘要:// 练习:// 写一个Person和Student,姓名(name)性别(gender)年龄(age)由父类构造方法初始化// 年龄默认为0,性别随机,姓名有子类指定调用// 创建一个Student对象,并做自我介绍// 同时实现:实例化一个Student对象,指定姓名,性别,年龄namespace 继承_封装_多态{class Program{static void Main(string[] args){Student s1 = new Student("张三",12);s1.SayHello();Student s2 = new Student("小王&q 阅读全文
posted @ 2012-07-13 00:14 Fan帥帥 阅读(146) 评论(0) 推荐(0)
动态窗口的实现
摘要:public Form1() { InitializeComponent(); // 默认情况下,窗体由操作系统分配位子 StartPosition = FormStartPosition.Manual; Location = new Point(0, 0); } int seed = 5; private void timer1_Tick(object sender, EventArgs e) { // 此时写在里... 阅读全文
posted @ 2012-07-13 00:11 Fan帥帥 阅读(179) 评论(0) 推荐(0)
练习_最大数和素数
摘要:1、求min与max间数的所有奇数的和 static void Main(string[] args) { Console.WriteLine(res); Console.ReadKey(); } private static int Munodd(int min,int max) { int num = 0; for (int i = min; i <= max; i++) { if (i % 2 == 1) { num += i; } } return num; }2、找数组中... 阅读全文
posted @ 2012-07-13 00:09 Fan帥帥 阅读(182) 评论(0) 推荐(0)