Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
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Êý¾Ý¿â²Ù×÷Àà(´æ´¢¹ý³Ì´¦Àí)

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.ComponentModel;
namespace SQLHelper
{
 /// <summary>
 /// Class1 µÄժҪ˵Ã÷¡£
 /// </summary>
 public class SQLHelper
 {
  // Á¬½ÓÊý¾ÝÔ´
......

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 ......

asp.netÐÔÄÜÓÅ»¯×ܽá

1. C#ÓïÑÔ·½Ãæ
1.1 À¬»ø»ØÊÕ
¡¡À¬»ø»ØÊÕ½â·ÅÁËÊÖ¹¤¹ÜÀí¶ÔÏóµÄ¹¤×÷£¬Ìá¸ßÁ˳ÌÐòµÄ½¡×³ÐÔ£¬µ«¸±×÷ÓþÍÊdzÌÐò´úÂë¿ÉÄܶÔÓÚ¶ÔÏó´´½¨±äµÃËæÒâ¡£
¡¡1.1.1 ±ÜÃâ²»±ØÒªµÄ¶ÔÏó´´½¨
¡¡ÓÉÓÚÀ¬»ø»ØÊյĴú¼Û½Ï¸ß£¬ËùÒÔC#³ÌÐò¿ª·¢Òª×ñÑ­µÄÒ»¸ö»ù±¾Ô­Ôò¾ÍÊDZÜÃâ²»±ØÒªµÄ¶ÔÏó´´½¨¡£ÒÔÏÂÁоÙһЩ³£¼ûµÄÇéÐΡ£
¡¡1.1.1.1 ±ÜÃâÑ­»·´´½¨¶ÔÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ