我目前正試圖在Web瀏覽器中打開PDF文件。我從數據庫中檢索pdf的字節數組並將其存儲在應用程序文件夾中。從這裏我不能讓PDF在c#代碼中啓動。任何幫助將不勝感激,因爲我很難過。爲什麼不打開我的PDF文件。 ASP.net,c#
if(dt.Rows.Count > 0)
{
byte[] data = (byte[])dt.Rows[0][0];
string strFileName = Utilities.GetAppBasePath()+Config.GetImages+DateTime.Now.Millisecond.ToString()+".pdf";
System.IO.File.WriteAllBytes(strFileName, data);
OpenPDF(strFileName);
}
protected void OpenPDF(string strFileName)
{
Response.Redirect(strFileName);
}
'從這裏我不能得到PDF在c#代碼啓動。 ' - 你得到一個例外嗎?提供除「不起作用」之外的更多細節將會有所幫助。 –