摘要: 1:进入网页时淡入淡出的效果。在头部head之间加入此代码,你会发现点击链接的时候,网页现实的是淡入淡出的效果。此代码含义如下:Page-Exit”(离开网页)、”Site-Enter”(进入站点)、”Site-Exit”(离开站点)其中”Duration=1.0″可以设定每个周期的时间为多久,单位是秒(现在设置的是每周期1秒)。2:把滔滔(微博客)完美放到你的博客中。试用于各种程序语言。演示见本站公告.红色部分注意事项:改成你的QQ号。 1就是只显示一条信息。这是JS文件路径。下载地址:http://www.lusongsong.com/reed/dkapi.js3:彻底屏蔽鼠标右键。此段代 阅读全文
posted @ 2013-06-28 23:36 勇仔X 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 将List<string> 转换为 字符串List<string> listStr = new List<string>();listStr.Add("a");listStr.Add("b");listStr.Add("c"); //以下代码实现:将listStr转换为一串以‘,’分隔开的字符串并显示出来string myStr = string.Join(",", listStr.ToArray());MessageBox.Show(myStr); //显示结果 a,b,c以上 阅读全文
posted @ 2013-06-16 09:53 勇仔X 阅读(2086) 评论(0) 推荐(0) 编辑
摘要: SqlHelper.csusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Configuration;using System.Data.SqlClient;using System.Data;namespace WpfApplication1.DAL{ static class SqlHelper { public static readonly string connstr = ConfigurationManager.Con... 阅读全文
posted @ 2013-06-13 10:41 勇仔X 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 下面的代码示例演示 GetRolesForUser 方法的示例实现public override string[] GetRolesForUser(string username){ if (username == null || username == "") throw new ProviderException("User name cannot be empty or null."); string tmpRoleNames = ""; OdbcConnection conn = new OdbcConnection(conn 阅读全文
posted @ 2013-06-06 18:27 勇仔X 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 第一步:引用 log4net.dll (注意版本)第二步:在网站根目录下的 Global.asax 文件中的Application_Start方法中添加如下代码protected void Application_Start(object sender, EventArgs e) { //1,读取配置文件中的内容,进行初始化 log4net.Config.XmlConfigurator.Configure(); }第三步:在网站根目录下的 Web.config 文件中添加如下代码 ... 阅读全文
posted @ 2013-06-05 18:52 勇仔X 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 如果该dataGridView是跟数据库绑定的,则可以触发DataBindingComplete事件://DataGridView控件隔行显示不同的颜色 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) { if (this.dataGridView1.Rows.Count != 0) { for (int i = 0; i < this.d... 阅读全文
posted @ 2013-05-31 11:45 勇仔X 阅读(490) 评论(0) 推荐(0) 编辑
摘要: 父窗口 Main//学生档案管理 private void button1_Click(object sender, EventArgs e) { this.Enabled = false;//当前窗体不可用 StudentInfo si = new StudentInfo(this);//初始化要打开的窗体,Form1为要打开的窗体的类名。 si.ShowDialog();//显示新的窗体。 }子窗口StudentInfopublic partial class StudentInfo... 阅读全文
posted @ 2013-05-30 18:55 勇仔X 阅读(602) 评论(0) 推荐(0) 编辑
摘要: 介绍一下分散管理的方式,即通过多个web.config来配置文件的访问权限。首先,web.config的作用我们应该知道两点:1、web.config的设置将作用于所在目录及所在目录下的所有子文件下的资源——一般指.net资源,如aspx、ashx、ascx等文件,对.html、js、css等则不起作用,当然,不同的iis版本下有所不同,在此不做讨论。2、子目录下的web.config文件将覆盖从父目录继承下来的设置。接下来,我们新建一个测试项目,项目资源如下图:上图中的Admin文件夹是受保护的,只有通过省份验证的用户可以访问,所以,我们在根目录下的web.config配置文件中做如下配置: 阅读全文
posted @ 2013-05-29 15:07 勇仔X 阅读(247) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace PhotoSite{ public partial class aspx模版 : System.Web.UI.Page { //#1初始化页面之前 protected void Page_PreInit(object sender, EventArgs e) ... 阅读全文
posted @ 2013-05-28 20:23 勇仔X 阅读(201) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Security;using System.Web.SessionState;namespace Web{ public class Global : System.Web.HttpApplication { //当第一次请求到达网站,被HttpApplication处理之前触发 //在应用程序启动时运行的代码 protected void ... 阅读全文
posted @ 2013-05-28 19:23 勇仔X 阅读(118) 评论(0) 推荐(0) 编辑