Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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(


Ïà¹ØÎĵµ£º

dz̸ASP.net°²È«±à³Ì

ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......

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

c# asp.net ×Ö·û´®¼ÓÃܽâÃܵÄÀà


using System;   
using System.Collections.Generic;   
using System.Text;   
using System.Security.Cryptography;//CryptographyÃÜÂëÊõ   
namespace DAL   
{   
    public class Enc ......

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ÖеÄSEOÓÅ»¯

ASP.NET 4°üÀ¨ÁËһϵÁÐеÄÔËÐÐʱÌØÐÔ£¬¿ÉÒÔ°ïÖúÄã½øÒ»²½ÓÅ»¯ÄãµÄÍøÕ¾¡£ÆäÖÐһЩÐÂÌØÐÔ¿ÉÒÔÓÃÀ´½øÐÐSEOÓÅ»¯ÒÔÌá¸ßÍøÕ¾ÔÚËÑË÷ÒýÇæÖеÄÅÅÃûºÍȨÖØ£¬ÕâЩÌØÐÔ°üÀ¨£º
еÄPage.MetaKeywords ºÍ Page.MetaDescription ÊôÐÔ
Õë¶ÔASP.NET Web FormsµÄÐÂURLµ¼ÏòÖ§³Ö
еÄResponse.RedirectPermanent()·½·¨
ÏÂÃæÊÇÈçºÎÀûÓÃÕâÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ