ASP.NETÖÐÈÃͼƬÒÔ¶þ½øÖƵÄÐÎʽ´æ´¢ÔÚÊý¾Ý¿âÖÐ
½ñÔçÓиöÍøÓÑÎʵ½ÎÒÕâÎÊÌ⣬ÒÔÇ°ÎÒ¶¼ÊÇÖ±½ÓÔÚÊý¾Ý¿âÖдæÎļþÃûµÄ£¬»¹Ã»ÓÐÊÔ¹ý´æ´¢ÕûÕÅͼƬµ½Êý¾Ý¿âÖУ¬ÉÏÍøËÑË÷ÁËһϣ¬×Ô¼ºÓÖ²âÊÔÁËÒ»·¬£¬´úÂëÈçÏ£º
½¨Á¢±£´æͼƬµÄ±íµÄSQLÓï¾ä£º
Sql´úÂë < width="14" height="15" src="javascripts/syntaxhighlighter/clipboard_new.swf" pluginspage="http://www.macromedia.com/go/getflashplayer">
USE [niunantest]
GO
/****** ¶ÔÏó: Table [dbo].[picdata] ½Å±¾ÈÕÆÚ: 03/30/2010 14:51:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[picdata](
[id] [int] IDENTITY(1,1) NOT NULL,
[content] [image] NULL,
[createdate] [datetime] NOT NULL CONSTRAINT [DF_picdata_createdate] DEFAULT (getdate()),
CONSTRAINT [PK_picdata] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
ÏÂÃæÊDZ£´æͼƬµ½Êý¾Ý¿âÖеĴúÂëƬ¶Î£º
C#´úÂë < width="14" height="15" src="javascripts/syntaxhighlighter/clipboard_new.swf" pluginspage="http://www.macromedia.com/go/getflashplayer">
int len = fu.PostedFile.ContentLength; // ͼƬ´óС
byte[] pic = new byte[len]; // ´´½¨Ò»¸ö×Ö½ÚÊý×飬´óСΪͼƬµÄ´óС£¬Êý¾Ý¿âÖоʹ洢Õâ¸ö¶«Î÷
fu.PostedFile.InputStream.Read(pic,&n
Ïà¹ØÎĵµ£º
ÔÚ.netÖÐͨ¹ýÕâÖÖ·½Ê½ÒýÓÃjsÎļþ
<script type="text/javascript" src="setday0.js"></script>
È»ºóÔÚÒ³ÃæÖе÷ÓÃsetday0.jsÎļþÖеķ½·¨ÍùÍù»á³ö´í£¡µ«ÊÇÄãÈç¹û°Ñsetday0.jsÎļþµÄÄÚÈÝÖ±½Ó·Åµ½¸ÃÒ³ÃæÖÐÀ´ÓÖÒ»µãÎÊÌâҲûÓС£Õâ¸öÎÊÌâÀ§»óÁËÎҺܾã¬ÔÚ1.1µÄʱºò¾ÍÓöµ½Á˵±Ê±Ã»°ì·¨¾ÍÔÚÒ³ÃæÖÐÖØдjs´úÂë¡£½ñÌ ......
ÔÚ.Net 4.0֮ǰÎÒÃÇΪÁË×ö³öËÑË÷ÒýÇæÓѺõģ¬¶ÔÓû§Ò²ÓѺõÄurl¶¼ÊÇÐèÒª×Ô¼ºÊµÏÖUrlÖØд£¬ÏÖÔÚ²»ÐèÒªÁË£¬.Net 4.0ΪÎÒÃÇ×öÕâÒ»ÇС£UrlRoutingÖ®ËùÒÔ³Æ֮ΪRoutingÊÇÒòΪËü²»µ«ÊµÏÖÁËUrlÖØд»¹¿ÉÒÔͨ¹ý²ÎÊýµÃµ½ÖØдºóµÄUrlÔÚÒ³ÃæÉÏʹÓá£
1. Url Routing µÄͨ³£Ó÷¨
UrlRoutingÔÚAsp.Net MvcÏîÄ¿Öб»¹ã·ºÊ¹Óã¬ÔÚMvcÖкܺà ......
網Ö·£ºhttp://localhost:1897/News/Press/Content.aspx/123?id=1#toc
Request.ApplicationPath
/
Request.PhysicalPath
D:\Projects\Solution\web\News\Press\Content.aspx
System.IO.Path.GetDirectoryName(Request.PhysicalPath)
D:\Projects\Solution\web\News\Press
Request.PhysicalApplicationPath
D ......
ʵÏÖ·½·¨¾ÍÊǸøµ¥Ôª¸ñÌî³äÎÒÃÇÏëÒªµÄ¸ñʽ´úÂë¡£
==============C#==============
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script run ......
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace TLibrary.ObjectHelper
{
public class CookiesHelper
{
#region ......