程晓晖

博客园 首页 新随笔 联系 订阅 管理
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页

2011年3月31日 #

摘要: //int? temp =5;// int a = (int)temp; //5 //int a = Convert.ToInt32(temp);//5int? temp = null;int a = (int)temp; // 报错int a = Convert.ToInt32(temp);//0 阅读全文
posted @ 2011-03-31 00:30 fumen 阅读(130) 评论(0) 推荐(0) 编辑

2011年3月26日 #

摘要: <script type="text/javascript"> var obj = {school:"河北农大"}; function test() { obj.userId = 1; obj["userName"] = "cheng"; alert(obj.school); alert(obj.userId); alert(obj.userName); } </script> 阅读全文
posted @ 2011-03-26 12:06 fumen 阅读(453) 评论(0) 推荐(0) 编辑

2011年3月23日 #

摘要: Tips:使用System.Collections.Generic对象去除数组中的重复值本例只是使用.net类别库解决开发问题不涉算法问题在使用.net 2.0开发邮件系统时,须要能去除收件者等输入值的重复值。所以想到使用System.Collections.Generic对象中IndexOf()协助处理Code://取得字符串数组char[] charSeparators = new char[] { ',', ';' };string[] originalData = originalMailList.Split(charSeparators, String 阅读全文
posted @ 2011-03-23 00:21 fumen 阅读(411) 评论(0) 推荐(0) 编辑

摘要: CONVERT(varchar(12),getdate(), 112) 转换成的格式为20100318 阅读全文
posted @ 2011-03-23 00:19 fumen 阅读(164) 评论(0) 推荐(0) 编辑

2011年3月20日 #

摘要: http://blog.csdn.net/totogogo/archive/2010/06/04/5646564.aspxload 方法的回调函数是不论成功与否都调用,而 $.get(), $.post(), $.getScript() and $.getJSON() 的回调函数只有 response 的状态是 success 才会调用该方法 全局函数 $.each() 可以用来遍历对象(包含 json 对象)或数组$.each() 是以要遍历的对象 / 数组作为第一个参数,以回调函数作为第二个参数。回调函数有2个参数,第一个为对象成员 / 数组的索引,第二个为对应于索引的 element 阅读全文
posted @ 2011-03-20 23:48 fumen 阅读(120) 评论(0) 推荐(0) 编辑

摘要: 一. 使用ifreame来实现跨域问题二.使用脚本实现跨域(MVC程序) http://localhost:7528/home/Test 表示其他网站地址 非本站1.<script type="text/javascript" src="http://localhost:7528/home/Test"></script>后台 public string Test() { return "document.write('<a href=\"http://www.baidu.com\"> 阅读全文
posted @ 2011-03-20 23:39 fumen 阅读(324) 评论(0) 推荐(0) 编辑

2011年3月17日 #

摘要: #region 获取客户端真实IP public static string ClientIP(this Controller ctrl) { string userip = ""; // 如果客户端用了代理服务器,则应该用ServerVariables("HTTP_X_FORWARDED_FOR")方法 if (ctrl.HttpContext.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null) userip = ctrl.HttpContext.Request.Serv 阅读全文
posted @ 2011-03-17 23:51 fumen 阅读(236) 评论(0) 推荐(0) 编辑

摘要: 在使用Convert.ToBase64String()对字符串进行Base64编码时,注意的几点: 例:string s = "Hello"; byte[] bytes = Convert.FromBase64String(s); 以上代码在运行时会抛出FormatException异常.提示为:Base-64字符数组的无效长度原因:当Convert.FromBase64String方法的参数s的长度小于 4 或不是 4 的偶数倍时,将会抛出FormatException。 例: Convert.FromBase64String("Hell"); // 阅读全文
posted @ 2011-03-17 23:25 fumen 阅读(14941) 评论(0) 推荐(0) 编辑

摘要: HttpUtility.UrlEncode、HttpUtility.UrlDecode、Server.UrlEncode、Server.UrlDecode的区分与应用需要注意的几点:1、HttpUtility.UrlEncode,HttpUtility.UrlDecode是静态方法,而Server.UrlEncode,Server.UrlDecode是实例方法。2、Server是HttpServerUtility类的实例,是System.Web.UI.Page的属性。3、用HttpUtility.UrlEncode编码后的字符串和用Server.UrlEncode进行编码后的字符串对象不一样: 阅读全文
posted @ 2011-03-17 09:43 fumen 阅读(346) 评论(0) 推荐(0) 编辑

摘要: Request.UrlReferrer的用法下列情况下,此属性值是有效的:(1)直接使用<a href>链接;(2)通过表单提交的方式,或者说是有PostBack动作的按钮,也或者是通过客户端脚本进行了form.submit()动作;下面这些情况,此属性返回空值:(1)通过IE的收藏,历史,最近链接,首页,或者是在地址栏中直接输入当前页面地址等方式;( ^_^,有些啰嗦 );(2)使用了location.href or location.replace()等客户端脚本方法导航到了当前页面;(3)使用Response.Redirect / Server.Transfer方式,这个小解 阅读全文
posted @ 2011-03-17 00:06 fumen 阅读(35440) 评论(2) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页