摘要: <script type="text/javascript"> $(document).ready(function () { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showMap); } }); var showMap = function (position) { var weidu = position.coords.latitude; var jingdu = position.coords.longitude; var str = weidu + &q 阅读全文
posted @ 2013-04-12 09:23 王者杂货铺 阅读(503) 评论(0) 推荐(0) 编辑
摘要: string clientFilename = FileUpload1.PostedFile.FileName.ToLower(); string serverFilename = ""; if (clientFilename == "") { return; } if (clientFilename.ToLower().IndexOf(".xlsx") > 0) { serverFilename = ".xlsx"; } else { if (clientFilename.ToLower().IndexOf 阅读全文
posted @ 2013-04-10 10:08 王者杂货铺 阅读(395) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Web;public class WeixinInterface : IHttpHandler{HttpContext context = null;string postStr = "";public void ProcessRequest(HttpContext param_context){context = param_context;//以写日志为荣,以打断点为耻.//WriteLog("before valid \n");//valid();//用于验证//WriteLog("af 阅读全文
posted @ 2013-04-08 16:41 王者杂货铺 阅读(540) 评论(0) 推荐(1) 编辑
摘要: /// /// 记录日志 /// 以日期为文件名,一天一个文件名,每条记录为一个日志 /// 格式:时间yyyy-MM-dd HH:mm:ss(24h)+空格+日志主体信息 /// 如:2010-08-08 10:10:10 访问作业系统失败,请检查作业系统是否正常运作。 /// /// 输入:日志文件存放路径 /// 输入:日志信息主体信息 internal static void WriteLog(string strLogPath, string strM... 阅读全文
posted @ 2013-04-08 09:35 王者杂货铺 阅读(163) 评论(0) 推荐(0) 编辑
摘要: function viewObject(obj) { var msg; for (var a in obj) { msg += a + ' '; } alert(msg); } 阅读全文
posted @ 2013-04-03 16:59 王者杂货铺 阅读(319) 评论(0) 推荐(0) 编辑
摘要: protected void dFile(string name) { string path = Server.MapPath("~") + name; //初始化 FileInfo 类的实例,它作为文件路径的包装 FileInfo fi = new FileInfo(path); Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(fi.Name)); //Response.Ad 阅读全文
posted @ 2013-04-02 11:54 王者杂货铺 阅读(104) 评论(0) 推荐(0) 编辑
摘要: $("input[name=test][value=34]").attr("checked",true);//value=34的radio被选中 阅读全文
posted @ 2013-04-01 13:32 王者杂货铺 阅读(350) 评论(0) 推荐(0) 编辑
摘要: protectedvoidButton1_Click(objectsender,EventArgse) { HttpCookiecookie=newHttpCookie("MyCook");//初使化并设置Cookie的名称 DateTimedt=DateTime.Now; TimeSpants=newTimeSpan(0,0,1,0,0);//过期时间为1分钟 cookie.Expires=dt.Add(ts);//设置过期时间 cookie.Values.Add("userid","userid_value"); cookie.V 阅读全文
posted @ 2013-03-27 15:40 王者杂货铺 阅读(312) 评论(0) 推荐(0) 编辑
摘要: public static void AutoScale(Form frm) { frm.Tag = frm.Width.ToString() + "," + frm.Height.ToString(); frm.SizeChanged += new EventHandler(frm_SizeChanged); } static void frm_SizeChanged(object sender, EventArgs e) { string[] tmp = ((Form... 阅读全文
posted @ 2013-03-26 11:24 王者杂货铺 阅读(284) 评论(0) 推荐(0) 编辑
摘要: "^\d+$" //非负整数(正整数 + 0)"^[0-9]*[1-9][0-9]*$" //正整数"^((-\d+)|(0+))$" //非正整数(负整数 + 0)"^-[0-9]*[1-9][0-9]*$" //负整数"^-?\d+$" //整数"^\d+(\.\d+)?$" //非负浮点数(正浮点数 + 0)"^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]* 阅读全文
posted @ 2013-03-26 10:44 王者杂货铺 阅读(134) 评论(0) 推荐(0) 编辑