2013年1月18日
摘要: 编写程序的时候,经常需要用的项目根目录。自己总结如下 1、取得控制台应用程序的根目录方法 方法1、Environment.CurrentDirectory 取得或设置当前工作目录的完整限定路径 方法2、AppDomain.CurrentDomain.BaseDirectory 获取基目录,它由程序集冲突解决程序用来探测程序集 2、取得Web应用程序的根目录方法 方法1、HttpRuntime.AppDomainAppPath.ToString();//获取承载在当前应用程序域中的应用程序的应用程序目录的物理驱动器路径。用于App_Data中获取 方法2、Serv... 阅读全文
posted @ 2013-01-18 16:56 钱一 阅读(169) 评论(0) 推荐(0)
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Reflection;namespaceAssmest{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();this.Text=string.Format(String.Format(" 阅读全文
posted @ 2013-01-18 16:48 钱一 阅读(2683) 评论(0) 推荐(0)
  2011年9月12日
摘要: 编辑器加载中...只有你的页面是ASP.NET调用的,你的Page类里的Response对象才有意义。 如果你需要在你自己的类里调用Response,请用System.Web.HttpContext.Current.Response。 阅读全文
posted @ 2011-09-12 20:27 钱一 阅读(928) 评论(0) 推荐(0)
  2011年8月22日
摘要: 在Winform中向DataGridView控件添加数据 阅读全文
posted @ 2011-08-22 22:58 钱一 阅读(666) 评论(0) 推荐(2)
  2011年6月9日
摘要: 当使用asp.net的CustomValidator控件的时候,可以在server端验证,也可以在客户端验证在server端代码如下:protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args) { int i = 0; if (int.TryParse(this.TextBox1.Text, out i)) { args.IsValid = i % 2 == 0; } else { args.IsValid = false; } }注:验证一个textbox1接收的值是不 阅读全文
posted @ 2011-06-09 23:28 钱一 阅读(1063) 评论(0) 推荐(1)
  2011年6月5日
摘要: 想用两个下拉列表,显示省份和所在城市,当在选择了省份 在城市下拉列表中中显示出相应的城市 管她好与不好,做一下笔记 $("Select1").onchange = function () { if ($("Select1").selectedIndex == 1) { $("Select2").length = 0; var op = document.createElement("option"); op.value = "chaoyang"; op.text = "朝阳区" 阅读全文
posted @ 2011-06-05 21:38 钱一 阅读(130) 评论(0) 推荐(0)
  2011年5月30日
摘要: 添加五个button按钮,想为其添加onclick事件,并获取value<html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <script type="text/javascript"> window.onload = function () { var a = document.getElementsByName("abc"); for (var i = 0; i < a.length; 阅读全文
posted @ 2011-05-30 23:29 钱一 阅读(156) 评论(0) 推荐(0)
  2011年4月29日
摘要: 怎么用火狐调试javascipt呢?对于我这个初学者还真不会,于是百度一下,记录下来,当作今天的总结!在Firefox 的菜单栏目中点“工具”-》“附加组件”-》找到“Firebug”组件,进行安装。然后f12ok! 阅读全文
posted @ 2011-04-29 00:00 钱一 阅读(165) 评论(0) 推荐(0)