How to open PDF file in a new tab or window instead of downloading it (using asp.net)?

前端 未结 7 1766
南方客
南方客 2020-11-28 10:16

This is the code for downloading the file.

System.IO.FileStream fs = new System.IO.FileStream(Path+\"\\\\\"+fileName, System.IO.FileMode.Open, System.IO.File         


        
7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 10:40

    Use this code. This works like a champ.

    Process process = new Process();
    process.StartInfo.UseShellExecute = true;
    process.StartInfo.FileName = outputPdfFile;
    process.Start();
    

提交回复
热议问题