protected void Button2_Click(object sender, EventArgs e)
{
UploadLogic bl = new UploadLogic();
input = ListBox1.SelectedIndex >= 0 ? ListBox1.SelectedItem.ToString() : "";
DataSet ds = new DataSet();
ds = bl.Content_details(input);
if (ds.Tables[0].Rows.Count > 0)
{
Byte[] bytes = (Byte[])ds.Tables[0].Rows[0].ItemArray.GetValue(3);
Response.Buffer = true;
Response.Charset = "utf-16";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentEncoding = System.Text.Encoding.GetEncoding("windows-1250");
Response.ContentType = ds.Tables[0].Rows[0].ItemArray.GetValue(2).ToString();
Response.AddHeader("content-disposition", string.Format("File_Path; filename={0}", input));
Response.OutputStream.Write(bytes, 0, input.Length);
Response.BinaryWrite(bytes);
Response.Flush();
Response.End();
}
else
{
Label1.Text = "No File Found..!";
}
}
我写了这段代码,但它只从数据库下载文件。如果我想播放音频和视频,那我该怎么做呢?