Êä³ö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(
Ïà¹ØÎĵµ£º
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;//CryptographyÃÜÂëÊõ
namespace DAL
{
public class Enc ......
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.ComponentModel;
namespace SQLHelper
{
/// <summary>
/// Class1 µÄժҪ˵Ã÷¡£
/// </summary>
public class SQLHelper
{
// Á¬½ÓÊý¾ÝÔ´
......
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 4°üÀ¨ÁËһϵÁÐеÄÔËÐÐÊ±ÌØÐÔ£¬¿ÉÒÔ°ïÖúÄã½øÒ»²½ÓÅ»¯ÄãµÄÍøÕ¾¡£ÆäÖÐһЩÐÂÌØÐÔ¿ÉÒÔÓÃÀ´½øÐÐSEOÓÅ»¯ÒÔÌá¸ßÍøÕ¾ÔÚËÑË÷ÒýÇæÖеÄÅÅÃûºÍÈ¨ÖØ£¬ÕâÐ©ÌØÐÔ°üÀ¨£º
еÄPage.MetaKeywords ºÍ Page.MetaDescription ÊôÐÔ
Õë¶ÔASP.NET Web FormsµÄÐÂURLµ¼ÏòÖ§³Ö
еÄResponse.RedirectPermanent()·½·¨
ÏÂÃæÊÇÈçºÎÀûÓÃÕâÐ ......
ÎÊÌâÌá³ö:
ÔÚÓ¦ÓóÌÐòÖо³£ÐèÒª²éѯÊý¾Ý¡£µ±²éѯ½á¹ûÊý¾ÝÁ¿±È½Ï´óµÄʱºò£¬¼ìË÷½á¹û¡¢½çÃæÏÔʾ¶¼ÐèÒª»¨·Ñ´óÁ¿µÄʱ¼ä¡£ÎªÁ˱ÜÃâÕâ¸öÎÊÌ⣬Ӧ¸Ãÿ´ÎÖ»¼ìË÷²¿·ÖÊý¾Ý£¬Ò²¾ÍÊÇʹÓó£¼ûµÄ·ÖÒ³·½Ê½À´´¦Àí¡£·ÖÒ³µÄÎÊÌâÔÚasp.netÖкÃÏñ·Ç³£¼òµ¥£¬Ö»ÒªÔÚGridViewÖÐÆôÓ÷ÖÒ³¾Í¿ÉÒÔÁË¡£ÆôÓ÷ÖÒ³ºó£¬GridView¹ØÁªÊý¾ÝÔ´¿Ø¼þ£¬ÒÀ¾É»á¼ÓÔØ ......