else if (thePDF == false && theType == "generic")
{
string outputpath = System.Configuration.ConfigurationManager.AppSettings["genericoutputdocpath"];
string fname = (new Random().Next()).ToString() + ".rtf";
FileStream tw = new FileStream(outputpath + "\\" + fname, FileMode.Create);
tw.Write(buffer, 0, buffer.Length);
tw.Close();
Response.ContentType = "application/msword";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);
//File.Delete(outputpath + "\\" + fname);
Response.End();
}
ASKER
ASKER
protected void displayDocument(bool thePDF, string theType, byte[] buffer)
{
if (theType == "sc1")
{
outputpath = System.Configuration.ConfigurationManager.AppSettings["rmpoutputdocpath"];
}
else if (theType == "sc2")
{
outputpath = System.Configuration.ConfigurationManager.AppSettings["genericoutputdocpath"];
}
if (thePDF == true)
{
fname = (new Random().Next()).ToString() + ".pdf";
Response.ContentType = "application/pdf";
}
else if (thePDF == false)
{
fname = (new Random().Next()).ToString() + ".rtf";
Response.ContentType = "application/msword";
}
FileStream tw = new FileStream(outputpath + "\\" + fname, FileMode.Create);
tw.Write(buffer, 0, buffer.Length);
tw.Close();
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);
//File.Delete(outputpath + "\\" + fname);
Response.End();
}
ASKER
The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.
TRUSTED BY
Response.ContentType = "application/rtf";