那在数据库中img的类型是什么啊,我把它设为img型后,上传图片后,它的img内容为<brinary>而不是路径,那如果我要显示图片该怎么办

解决方案 »

  1.   

    那如果要显示图片的时候该怎么写啊,我如果上传后img中不会有具体的路径的啊.不象在access中一样的
      

  2.   


    给你一段代码看看private void up_pic_Click(object sender, System.EventArgs e)
    {
    DateTime now=DateTime.Now;
    string timetag=now.Year.ToString()+now.Month.ToString("00")+now.Day.ToString("00")+
    now.Hour.ToString("00")+now.Minute.ToString("00")+now.Second.ToString("00")+now.Millisecond.ToString("000");
    string fullfilename="",fileext=""; if(myfile.PostedFile != null && myfile.PostedFile.FileName.Length>0)
    {
    //获得上传文件在客户端的文件名和扩展名
    fullfilename=myfile.PostedFile.FileName.ToString();
    fileext=System.IO.Path.GetExtension(fullfilename); if(fileext.ToLower()==".jpg")
       {
    myfile.PostedFile.SaveAs(System.Web.HttpContext.Current.Server.MapPath("\\up_pic\\")+timetag+fileext);
    show.Text="您上传成功,请继续操作!";
     
    }
    else
    {
    show.Text="请上传.jpg格式的图片!";
    }
     
    }
      

  3.   

    http://www.8384.com.cn/show.aspx?id=117