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 –
做它不能意味着根本没有这种可能性 –