Sampson-Li
Sampson.Li学习经验总结博客 学历代表过去,能力代表现在.学习力代表未来!
摘要: 在开发过程中.数组和集合的处理是最让我们担心.一般会用for or foreach 来处理一些操作.这里介绍一些常用的集合跟数组的操作函数.首先举例2个集合A,B.List<int> listA = new List<int> {1,2,3,5,7,9};List<int> listB = new List<int> {13,4,17,29,2};listA.AddRange(listB);把集合A.B合并List<int> Result = listA.Union(listB).ToList<int>(); //剔除重复 阅读全文
posted @ 2011-11-09 12:01 Sampson 阅读(62928) 评论(0) 推荐(4) 编辑
摘要: 省市级联是每个web网站必不可少的部分.这里小弟为大家分享一下在mvc中无刷新的部门职位级联菜单首先在view页面JS代码:1<scripttype="text/javascript"src="/Scripts/jquery-1.4.1.min.js"></script>2<scriptlanguage="javascript"type="text/javascript">3$(document).ready(function(){4$("#DepartmentID&q 阅读全文
posted @ 2011-11-08 10:26 Sampson 阅读(1326) 评论(1) 推荐(1) 编辑
摘要: js实现div跟谁鼠标悬浮移动显示1<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN">2<HTML>3<style>4#hint{5width:198px;6border:1pxsolid#000000;7background:#99ff33;8position:absolute;9z-index:9;10padding:6px;11line-height:17px;12text-align:left;13top:1520px;14}15</style>16< 阅读全文
posted @ 2011-11-07 16:56 Sampson 阅读(3593) 评论(0) 推荐(0) 编辑
摘要: 网站开发最让我们头疼的就是数据的架构.本地开发很轻松.程序只需要打包dll就可以了,但是数据库要架设到空间服务器上,就要转移.一不小心就会忘了一些存储过程,触发器,约束.这里为大家提供几个查用的检查.能够快速找出有哪些东西是忘记传了.很实用.有好的方法,请知道.该条语句查询返回所有的用户表select * from sysobjects where xtype='u' ---查询所有触发器select * from sysobjects where xtype='TR' ---查询所有触发器--读取库中的所有表名select name from sysobjec 阅读全文
posted @ 2011-11-07 15:09 Sampson 阅读(763) 评论(0) 推荐(0) 编辑
摘要: 基于网站seo,做了一采集百度和Google搜索关键字结果的采集.在这里与大家分享一下先看先效果图代码附加:View Code1privatevoidbaidu_Click(objectsender,EventArgse)2{3intnum=100;//搜索条数4stringurl="http://www.baidu.com/s?wd="+txtSearch.Text.Trim()+"&rn="+num+"";5stringhtml=search(url,"gb2312");6BaiduSearchbaid 阅读全文
posted @ 2011-11-07 13:44 Sampson 阅读(6604) 评论(88) 推荐(5) 编辑
摘要: //简单使用的水印类.public class WaterMark { private bool _textMark = false; private bool _imgMark = false; private string _text = ""; private string _imgPath = ""; private int _markX = 0; private int _markY = 0; private float _transparency = 1; private string _fontFamily = "宋体" 阅读全文
posted @ 2011-11-07 11:53 Sampson 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 最近老是遗忘很多sql函数.今天就花时间总结一下,也方便以后查找.也为各位同行们提供一个方便最常用的就是日期函数1 select getdate() as 'wawa_getdate' --当前时间2 select getutcdate() as 'wawa_getutcdate' --获取utc时间3 select day(getdate()) as 'wawa_day' --取出天4 select month(getdate()) as 'wawa_month' --取出月5 select year(getdate()) as 阅读全文
posted @ 2011-11-07 09:18 Sampson 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 昨天看了一会linq的书.今天哪来练练手.写了个简单的linq分页.在这里拿出来与大家共享一下.适合小数据型分页.因为他是先读取完全数据,然后在进行分页.好了直接贴出代码首页新建一个aspx页面然后在后台aspx.cs文件中1protectedvoidPage_Load(objectsender,EventArgse)2{3if(!IsPostBack)4{5intCurPage=1;6intPageSize=5;7int.TryParse(Request["CurPage"],outCurPage);8if(CurPage==0)9CurPage=1;10//获取总数据集 阅读全文
posted @ 2011-11-04 10:46 Sampson 阅读(27663) 评论(2) 推荐(1) 编辑
摘要: 分享一个百度写字版的demo,不知道怎么了,现在百度木有了,估计是用户体验不是很好吧.木有太多人用. 源码附加/Files/liguanghui/baiduWrite.rar<html><head><meta http-equiv="Content-Type" content="text/html;charset=gb2312"><title>百度在线手写板代码</title><style>#sx{color:#00C;text-decoration:underline;cursor 阅读全文
posted @ 2011-11-04 09:56 Sampson 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 网上有很多利用pop3,jmail组件来接收邮件和附件的.但代码都是有点晕头,一次运行不成功能.这里我也找了写资料写了一demo,测试过,木有问题.可以直接使用.后续将对已读和未读邮件进行筛选. (打算用vs自带的mail组件或者smtp在写一个demo),望大家互相交流一下.优化一下代码,这个demo只是雏形 .首先应现在项目中引用LumiSoft.Net.dll文件protected void Page_Load(object sender, EventArgs e) { List<Mime> dd =GetEmails(); //dd中就可以查找出邮件的内容、主题、发件... 阅读全文
posted @ 2011-11-03 16:44 Sampson 阅读(2344) 评论(2) 推荐(0) 编辑