0
我想在文件類型的輸入控件中顯示圖像。首先,我從數據庫中讀取var二進制數據,然後將其轉換爲內存流,但我無法將變量傳遞給<input type="file" />
。我該怎麼做?如何在代碼後面設置HTML輸入文件值
<input type="file" name="images" id="images" runat=server />
SqlConnection con = new SqlConnection(stcon);
SqlCommand command = new SqlCommand();
command.CommandText = "select * from image where ImageId=4";
command.Connection = con;
SqlDataAdapter adapt = new SqlDataAdapter(command);
DataTable dt = new DataTable();
adapt.Fill(dt);
MemoryStream memStream = new MemoryStream((byte[])dt.Rows[0][1]);
Stream str;
memStream.CopyTo(str);
我想在代碼behiend –
做它不能意味着根本沒有這種可能性 –