易截截图软件、单文件、免安装、纯绿色、仅160KB

输出PDF文档到ASP.NET页面


protected
void Page_Load(object sender, EventArgs e)
{
         try
        {
             //query the pdf path
             string pdfna =
this.Request.QueryString["pdf"];
             if (pdfna == null)
                 throw new Exception("This
page can not be accessed directly");
             string pdf = "Reports\\" +
pdfna;
             pdf = Server.MapPath(pdf);
 
             //read all bytes
             if (File.Exists(pdf) == false)
                 throw new Exception("This
report is not created");
             FileStream fs = File.Open(pdf,
FileMode.Open);
             byte[] buffer = new
byte[fs.Length];
             fs.Read(buffer, 0,
buffer.Length);
             fs.Close();
 
             //write to response
             Response.ContentType =
"application/pdf";
            
Response.AddHeader(


相关文档:

asp.net后台与前台的互相调用

一.后台调用前台
1.Page.ClientScript.RegisterStartupScript(type,"",script);
例:
string script = string.Format("<script>alert('Wrong');</script>");
Page.ClientScript.RegisterStartupScript(GetType(), "Load", script);
2.对象.Attributes.Add("事件","script")
例:
e.Row.Attributes.Add("on ......

asp.net 小菜鸟 必学

1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
接收参数:
string a  = Request.QueryString("id");
string b  = Request.QueryString("id1");
2.为按钮添加对话框
Button1.Att ......

asp.net动态生成txt文本文件供用户下载

 一,JS动态创建表单
 var result = "   <form method='post'  action='../xiazai.aspx'><table width='100%' border='0' cellpadding='0' cellspacing='1' bgcolor='#BDB4A2'>"+
                "&l ......

VFP如何调用ASP.NET Web服务中的DataSet

一、ASP.NET Web Service代码
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data.SqlClient;
 
namespace WebService1
{
    /// <sum ......

ASP.NET JS常用方法类

using System.Web;
/// <summary>
/// Javascript常用方法
/// </summary>
public class JS
{
    private static string ScriptStart = "<script type=\"text/javascript\">";
    private static string ScriptEnd = "</script>";
  &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号