Code
posted @ 2009-09-18 21:10 唐德兵 阅读(473) 评论(1) 编辑

终于在网上找到了解决方案:

在母版页的<head></head>中添加一个

<asp:contentplaceholder id="header" runat="server">
        
</asp:contentplaceholder>

 

然后在内容页中添加一个Content,如下:

<asp:Content ID="Content1" ContentPlaceHolderID="header" Runat="Server">
<link href="css.css" type="text/css" />
<script language="javascript" type="text/javascript">
alert(
"哈哈");
</script>
</asp:Content>

 

Ok,搞定!

posted @ 2008-12-11 19:00 唐德兵 阅读(619) 评论(2) 编辑
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=|DataDirectory|Data.mdb");
        OleDbCommand cmd 
= new OleDbCommand("update student set xm=@xm where xh=@xh", con);

        cmd.Parameters.AddWithValue(
"@xh"this.TextBox1.Text);
        cmd.Parameters.AddWithValue(
"@xm"this.TextBox2.Text);

        con.Open();
        cmd.ExecuteNonQuery();
        con.Close();

上面的代码很简单,只是更新一个字段,但是总是更新不成功!!后来终于在网上找到了解决方法。

OLE形式的SQL参数赋什的顺序必须与SQL语句参数顺序一样

交换一下参数就的顺序就OK了:

cmd.Parameters.AddWithValue("@xm"this.TextBox2.Text);
cmd.Parameters.AddWithValue(
"@xh"this.TextBox1.Text);
posted @ 2008-12-11 18:37 唐德兵 阅读(363) 评论(2) 编辑
DateTime.Now.ToString("yyyyMMddHHmmssffff")
posted @ 2008-12-04 19:36 唐德兵 阅读(192) 评论(0) 编辑
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(string password, string passwordFormat);
posted @ 2008-11-15 20:10 唐德兵 阅读(38) 评论(0) 编辑
            //创建一个矩形对象
            Rectangle rect = new Rectangle();
            //通过一个函数对这个矩形对象赋值,这些值就是屏幕的工作区域
            rect = Screen.GetBounds(this);
            MessageBox.Show("本机器的分辨率是" + rect.Width.ToString() + "*" + rect.Height.ToString());
posted @ 2008-11-06 20:19 唐德兵 阅读(77) 评论(0) 编辑
调用API
   
using System.Runtime.InteropServices;

    [DllImport(
"user32.dll")]
     
public static extern bool ReleaseCapture();
    [DllImport(
"user32.dll")]
    
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
   
public const int WM_SYSCOMMAND = 0x0112;
   
public const int SC_MOVE = 0xF010;
    
public const int HTCAPTION = 0x0002

//在空间的_MouseDown中加入如下代码:


    
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
   {
    ReleaseCapture();
    SendMessage(
this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
   }
posted @ 2008-11-06 18:59 唐德兵 阅读(115) 评论(0) 编辑
摘要: 插入:picPath是图片的路径[代码]读取:[代码]阅读全文
posted @ 2008-11-02 22:48 唐德兵 阅读(72) 评论(0) 编辑
摘要: [代码]阅读全文
posted @ 2008-11-01 17:27 唐德兵 阅读(114) 评论(0) 编辑
摘要: [代码]阅读全文
posted @ 2008-11-01 17:04 唐德兵 阅读(50) 评论(0) 编辑