骆驼空间站

简单就是美,不受任何商业的驱使,我们有自己的圈子

博客园 首页 新随笔 联系 订阅 管理

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Diagnostics;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = 0;
        string content;
        SqlConnection conn = new SqlConnection("server=.;database=ncu;uid=sa;password=19841010");
        conn.Open();
      
       
        id = Convert.ToInt32(Request.QueryString["id"]);
        SqlCommand cmd1 = new SqlCommand("select count(id) from book",conn);
        int to = 0;
        to = Convert.ToInt32(cmd1.ExecuteScalar());
        if (id > to)
            Response.Write("invalidate!");
        else
        {
            SqlCommand cmd = new SqlCommand("select content from book where id='" + id + "'", conn);
            content = Convert.ToString(cmd.ExecuteScalar());
            Response.Write(content);
            conn.Close();
        }

       

 

    }

 

 

    protected void Button1_Click(object sender, EventArgs e)
    {
        System.Diagnostics.Process.Start(@"f:\setup.exe");


    }
}

posted on 2006-07-19 14:58  骆驼SPACE  阅读(194)  评论(0)    收藏  举报