Êä³ö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(
Ïà¹ØÎĵµ£º
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 ......
Õâ¸öÊôÐÔÊÇÓÃÀ´ÑéÖ¤¿Í»§¶ËÓû§µÄÊäÈëµÄ,ÓÃÀ´ÑéÖ¤Óû§µÄÊäÈëÖÐÊÇ·ñÓÐΣÏÕ×Ö·ûµÄ,Õâ¸öÊôÐÔµÄĬÈÏֵΪtrue,΢ÈíÖ®ËùÒÔÕâô×öÊÇΪÁËÌá¸ßasp.net³ÌÐòµÄ°²È«ÐÔ,ËùÒԺܶà³ÌÐòÔ±¼´Ê¹²»ÖªµÀÔõôÀ´·ÀÓùºÚ¿ÍµÄ¹¥»÷,asp.netµÄһЩĬÈÏÊôÐÔµÈÄÚÈÝÒѾ¶Ô°²È«½øÐÐÁË¿ØÖÆ,ÕâÒ²ÊÇΪʲôasp.netµÄ³ÌÐòÏà¶ÔÀ´Ëµ±È½Ï°²È«µÄÔÒò!
¡¡¡¡¼ÈÈ»Õâ¸öÊô ......
using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
namespace class_new
{
/// <summary>
/// DataClass µÄժҪ˵Ã÷¡£
/// </summary>
public class DataClass
{
private string strConnection="";
&n ......
ASP.NET 4°üÀ¨ÁËһϵÁÐеÄÔËÐÐÊ±ÌØÐÔ£¬¿ÉÒÔ°ïÖúÄã½øÒ»²½ÓÅ»¯ÄãµÄÍøÕ¾¡£ÆäÖÐһЩÐÂÌØÐÔ¿ÉÒÔÓÃÀ´½øÐÐSEOÓÅ»¯ÒÔÌá¸ßÍøÕ¾ÔÚËÑË÷ÒýÇæÖеÄÅÅÃûºÍÈ¨ÖØ£¬ÕâÐ©ÌØÐÔ°üÀ¨£º
еÄPage.MetaKeywords ºÍ Page.MetaDescription ÊôÐÔ
Õë¶ÔASP.NET Web FormsµÄÐÂURLµ¼ÏòÖ§³Ö
еÄResponse.RedirectPermanent()·½·¨
ÏÂÃæÊÇÈçºÎÀûÓÃÕâÐ ......
GET /Img.ashx?img=svn_work.gif HTTP/1.1
Accept: */*
Referer: http://www.svnhost.cn/
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5 ......