string FileName = "Help";
string ContentType = string.Empty;
byte[] FileDate = null;
CoectionString = CryptorEngine.Decrypt(ConfigurationManager.Coect ionStrings["MyCoection"].CoectionString, true);
SqlCoection ConMain = new SqlCoection();
ConMain.CoectionString = CoectionString;
ConMain.Open();
SqlCommand CmdMain = new SqlCommand();
CmdMain.Coection = ConMain;
CmdMain.CommandType = CommandType.StoredProcedure;
CmdMain.CommandText = "SP_ShowHelpFile";
SqlDataReader DrData = CmdMain.ExecuteReader();
DrData.Read();
ContentType = DrData["FileExtension"].ToString();
FileDate = (byte[])DrData["FileData"];
DrData.Close();
ConMain.Close();
Response.ContentType = ContentType;
Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName);
Response.OutputStream.Write(FileDate, 0, FileDate.Length);
Response.Flush();
ممنون میشم راهنمایی کنید.
برچسب:
نویسنده: خنج