2016年1月17日
摘要: 1 static void Main(string[] args) 2 { 3 //创建连接字符串 4 string constr = "Data Source=PENGYOUQIANG-PC;Initial Catalog=lian... 阅读全文
posted @ 2016-01-17 19:38 海绵全是洞 阅读(355) 评论(0) 推荐(0) 编辑
  2016年1月15日
摘要: 1 2 3 4 效果图:【新知识点】: 1、beginPath():开始绘制路径 2、closePath():结束绘制路径 3、moveTo(x,y):起点坐标 4、lineTo(x,y):下一点坐标 5、stroke():画线 6、fill():填充【注意】: ... 阅读全文
posted @ 2016-01-15 20:01 海绵全是洞 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 代码: 1 2 3 4 【新知识点】: 1、fillStyle //填充的颜色 2、strokeStyle //边框的颜色 3、lineWidth //线宽度【注意】:(不然将不会运行) 属性,方法都用的骆驼命名法,首字母为小写,第二个单词首字母大写;如userNa... 阅读全文
posted @ 2016-01-15 18:46 海绵全是洞 阅读(6552) 评论(0) 推荐(0) 编辑
摘要: 效果图: 代码: 1 2 3 4 【知识点】:fill(填充)、stroke(画线) 1、fillRect(x,y,w,h); //绘制实体方块,默认黑色 2、strokeRect(x,y,w,h); //绘制空心方块 3、x,y:为起始坐标点 w,h... 阅读全文
posted @ 2016-01-15 17:58 海绵全是洞 阅读(3859) 评论(0) 推荐(0) 编辑
摘要: 1、创建画布 【注意】:在创建画布时,如不设置画布高与宽,它的默认值为:宽300,高150 默认颜色为:白色(所以如不修改颜色,根本就看不见)2、得到canvas元素 阅读全文
posted @ 2016-01-15 17:19 海绵全是洞 阅读(186) 评论(0) 推荐(0) 编辑
  2016年1月14日
摘要: 代码: 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using Syst... 阅读全文
posted @ 2016-01-14 21:25 海绵全是洞 阅读(220) 评论(0) 推荐(0) 编辑
  2016年1月12日
摘要: Console.WriteLine("".Equals(string.Empty));//结果:trueString.Empty和string=””是一样的,同样都是需要占用内存空间;但优先推荐使用string.Empty还一种高效判断方法(s.length==0)来判断字符串是否为空字符串;【注意... 阅读全文
posted @ 2016-01-12 20:09 海绵全是洞 阅读(3393) 评论(0) 推荐(0) 编辑
摘要: 三种方法:1、Char.IsDigit (aChar) 指示指定字符串中位于指定位置处的字符是否属于十进制数字类别2、Char.IsNumber(aChar) 指示指定字符串中位于指定位置的字符是否属于数字类别3、aChar>='0'&&aChar<='9' 判断aChar是否... 阅读全文
posted @ 2016-01-12 19:55 海绵全是洞 阅读(3707) 评论(0) 推荐(0) 编辑
摘要: 1、float testfloat = 2323.03; //这样写是错误的,因为C#中默认的数值数据类型为double. 一定要在数字后加上F才行。长类型到短类型的转换需要强制进行。 float testfloat = 2323.03F; //这样写才是正确的。 阅读全文
posted @ 2016-01-12 19:50 海绵全是洞 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1、copy(); 【语法】: public static string Copy (string str); 参数--str 要复制的string 返回值--与str具有相同值的新string// Sample for String.Copy()using System;cla... 阅读全文
posted @ 2016-01-12 19:44 海绵全是洞 阅读(2034) 评论(0) 推荐(0) 编辑