ʹÓÃASP.NETÉÏ´«¶à¸öÎļþµ½Êý¾Ý¿â
Èç¹û½ö½öÊÇÉÏ´«Ò»¸öÎļþ,×îºÃÊÇʹÓÃFileUpload¿Ø¼þ, ¿ÉÒÔʹÓÃFileUpload1.FileContent.LengthµÃµ½Îļþ´óС, FileUpload1.FileBytesµÃµ½Æä×Ö½ÚÊý×é, ´úÂëÂÔ.
Èç¹ûÒªÉÏ´«¶à¸öÎļþ, Æä¿Í»§¶Ë´úÂëÓëʹÓÃASP.NETÉÏ´«¶à¸öÎļþµ½·þÎñÆ÷»ù±¾Ïàͬ, ±¾ÀýÖмÓÈëÁËÏÂÔØµÄʾÀý´úÂë¡£
Ч¹ûͼÈçÏÂ:
Êý¾Ý¿â½Å±¾
create database FileDB
go
use FileDB
go
create table dbo.Files
(
id int identity primary key
,FileName varchar(50) not null
,FileSize int not null
,FileData image not null
--,UpTime DateTime default getdate()
--,DownLoadTimes int default 0
)
go
Ò³Ãæ´úÂë:MutlileFileUploadToDB.aspx
view plaincopy to clipboardprint?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MutlileFileUploadToDB.aspx.cs" Inherits="MutlileFileUploadToDB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>¶àÎļþÉÏ´«µ½Êý¾Ý¿âDemo</title>
<link href="css/writemail.css" mce_href="css/writemail.css" rel="stylesheet" type="text/css" />
<mce:script type="text/javascript"><!--
var MAXFILES = 5;
//Îļþ¼ÆÊýÆ÷
var fileCount = 0;
function addAttach(noAlert) {
if (fileCount >= MAXFILES && !noAlert) {
alert("×î¶àÖ»ÄÜÌí¼Ó" + MAXFILES + "¸ö¸½¼þ£¡");
re
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔǰµÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕß¶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
×Ô¼ºÔÚ¿ª·¢ÖÐÅöµ½µÄ+ÁËһЩÔÚÍøÉÏËѵ½µÄ¡£¡£ºÍ´ó¼Ò·ÖÏíÏ¡£
DropdownlistÎÞˢеÄÀý×Ó¡£xml.
ÀýÈçÎı¾ÑéÖ¤!
ÏÂÃæÊÇÒ»¸öµ¥Ñ¡°´Å¦Ç°Ì¨²»Ë¢ÐµÄÀý×Ó.ÓкõľÍÍùÉÏÌù
<mce:script language="javascript"><!--
function SetButton()
{
if(document.all.rdoByHuman.checked==true)
{
......
=================================================================================
How to enable an ASP.NET WebService to listen to HTTP POST calls
=================================================================================
Imagine you developed an ASP.NET WebService, but the client that nee ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý [·µ»ØÄ¿Â¼]
´«ËͲÎÊý£º
response.write("£¼script£¾window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')£¼/script£¾")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥ ......
1.ʲôÊǸöÐÔ»¯·þÎñ ¸öÐÔ»¯·þÎñÊÇÒ»ÖÖ¼¼Êõ¿ò¼Ü£¬ÎªÓû§ÌṩÁË×Ô¶¨ÒåÕ¾µãÍâ¹Û¡¢ÄÚÈÝ¡¢²¼¾Ö¡¢½ÇÉ«¹ÜÀíµÈ¹¦ÄÜ£¬ÈçͬQQ¿Õ¼äµÈ¡£ 2.¸öÐÔ»¯·þÎñÐèÒª³ÌÐòԱѧϰÄÄЩ·½Ã棬²ÅÄÜʵÏÖÕâЩ¹¦ÄÜ ¸öÐÔ»¯·þÎñÊÇÒ»¸ö¿ò¼Ü£¬Õâ¸ö¿ò¼Ü°üº¬3¸öºËÐŦÄÜ£º¸öÐÔ»¯Óû§ÅäÖá¢web²¿¼þ¡¢³ÉÔ±×ʸñÓë½ÇÉ«¹ÜÀí¡£ÎÒÃǾÍÊÇÒª×ÅÖØÑ§Ï°Õâ3¸ö¹¦ÄÜ¡ ......