--
这是通过浏览某图片,把他存放到数据库中
图片image和byte处理,fileupload上传图片string filename = txt_filename.Text;
图片image和byte处理,fileupload上传图片        
string filecomment = txt_filecomment.Text;
图片image和byte处理,fileupload上传图片        
string SlaveFileName = FileUpload1.PostedFile.FileName;
图片image和byte处理,fileupload上传图片        
byte[] FileContent_img = null;
图片image和byte处理,fileupload上传图片        DateTime UploadTime 
= DateTime.Now.Date;
图片image和byte处理,fileupload上传图片
图片image和byte处理,fileupload上传图片        
string id = lbl_id.Text;
图片image和byte处理,fileupload上传图片        RemoteRule remoteRule 
= (RemoteRule)GetRemoteingObjectByType(typeof(RemoteRule), "remoterule");
图片image和byte处理,fileupload上传图片        DataSet ds 
= new DataSet();
图片image和byte处理,fileupload上传图片        
if (id == "")
 

--
显示图片的
图片image和byte处理,fileupload上传图片
图片image和byte处理,fileupload上传图片
byte[] Image_img = (byte[])ds_image.Tables[0].Rows[0]["Image_im"];
图片image和byte处理,fileupload上传图片                            
if (Image_img.Length == 0)
图片image和byte处理,fileupload上传图片                                
return;
图片image和byte处理,fileupload上传图片                            
int filelength = Image_img.Length;
图片image和byte处理,fileupload上传图片                            
string imageName = ds_image.Tables[0].Rows[0][1].ToString() + "1" + ".jpg";
图片image和byte处理,fileupload上传图片                            
string myUrl = HttpContext.Current.Server.MapPath(this.Request.ApplicationPath) + @"\TempDownLoad\" + imageName;
图片image和byte处理,fileupload上传图片                            FileStream fs 
= new FileStream(myUrl, FileMode.OpenOrCreate);
图片image和byte处理,fileupload上传图片                            BinaryWriter w 
= new BinaryWriter(fs);
图片image和byte处理,fileupload上传图片                            w.BaseStream.Write(Image_img, 
0, filelength);
图片image和byte处理,fileupload上传图片                            w.Flush();
图片image和byte处理,fileupload上传图片                            w.Close();
图片image和byte处理,fileupload上传图片
图片image和byte处理,fileupload上传图片                            Image1.ImageUrl 
= Context.Request.ApplicationPath + "/TempDownLoad/" + imageName;
图片image和byte处理,fileupload上传图片                            Bitmap bitmap 
= new Bitmap(myUrl);
图片image和byte处理,fileupload上传图片                            Image1.Width 
= bitmap.Width;
图片image和byte处理,fileupload上传图片                            Image1.Height 
= bitmap.Height; 

相关文章: