当前位置:编程学习 > C#/ASP.NET >>

asp.net代码问题

    protected void Button1_Click(object sender, EventArgs e)
    {
        string res;
        upload up = new upload();
        res = up.Up(file1, "../Uploads/");
        this.Label2.Visible = true;
        this.Label2.Text = up.Resup[Convert.ToInt32(res)];
        this.txtpic.Text = up.s;
        string sql = "update flash set flash1='" + txtpic.Text + "' where id=1";
        DB.execnonsql(sql);

 

这段代码是我用在网页上的,主要想体现的效果是,几张图片轮着放,现在的问题是,我的网页上显示不出这些图片,想请高手帮解释一下这代码的意义,希望能得到解决的办法

追问:那为什么我的网站上不显示我上传的图片呢?显示图片那部分都是空白的

 

答案: protected void Button1_Click(object sender, EventArgs e) // Button1的单击事件
    {
        string res; //变量
        upload up = new upload(); //上传方法
        res = up.Up(file1, "../Uploads/");//上传文件
        this.Label2.Visible = true; //显示Label2
        this.Label2.Text = up.Resup[Convert.ToInt32(res)]; //Label2显示上传后传回来的值
        this.txtpic.Text = up.s;//txtpic显示上传后传回来的值
        string sql = "update flash set flash1='" + txtpic.Text + "' where id=1";// 更新数据库语句
        DB.execnonsql(sql);//执行更新

上一个:asp.net 上传控件推荐
下一个:ASP NET 是什么?

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,