要执行您需要的操作,您必须将文件下载到客户端。人们提到的 Response.Redirect 重定向到 URL。要在浏览器中打开它,您需要以下内容:private void Button1_OnClick(object sender, EventeArgs e){Response.ContentType = "application/pdf";Response.AppendHeader("Content-Disposition", "inline; filename=MyFile.pdf");Response.TransmitFile(myselect.SelectedValue.ToString());Response.End();}对于 Content-Disposition,您有两种选择:Response.AppendHeader("Content-Disposition", "attachment;filename=somefile.ext") : Prompt will appear for file downloadResponse.AppendHeader("Content-Disposition", "inline;filename=somefile.ext") : the browser will try to open the file within the browser.