Asp.net ÎļþÉÏ´«£¨Vb.net°æ£©
ÔÚAsp.netÖÐʵÏÖÎļþµÄÉÏ´«¹¦ÄÜ£¬ÊǷdz£¼òµ¥µÄÒ»¼þÊÂÇ飬ֻÐèÒªÀûÓÃ΢ÈíÌṩµÄFileUpload¿Ø¼þ¼´¿ÉÇáËÉʵÏÖ¡£
LargeFileUpload.aspx´úÂëÈçÏÂ
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="LargeFileUpload.aspx.vb"
Inherits="LargeFileUpload" %>
<!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 runat="server">
<title>Upload LargeFile</title>
</head>
<body>
<form id="form1" runat="server" enctype="multipart/form-data">
<! ×¢ÒâÔÚformÖбØÐëÓÐenctype="multipart/form-data"£¬±íʾ±íµ¥ÖÐÓÐÉÏ´«Îļþ£¬·ñÔòÎļþÎÞ·¨ÉÏ´«>
<div>
<center>
<asp:FileUpload ID="FileUpload1" runat="server" Width="336px" /><br />
<!runat="server" ±íʾ´Ë¿Ø¼þÊÇ·þÎñÆ÷¿Ø¼þ>
<asp:Button ID="btnUpload" runat="server" Text="Upload" />
<asp:Button ID="btnReset" runat="server" Text="Reset" />
</center>
</div>
</form>
</body>
</html>LargeFileUpload.aspx.vb´úÂëÈçÏ£ºPartial Class LargeFileUpload
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Me.IsPostBack Then
'Upload file
Call UploadFiles()
End If
End Sub
Private Sub UploadFiles()
Try
Ïà¹ØÎĵµ£º
ĸ°æÒ³Ãæ
-- н¨Ò»Ä¸°æÒ³Ãæ
-- ÔÚÊʵ±Î»ÖüÓÈë´úÂ룺
<asp:ContentPlaceHolder ID="ContentPlaceHolder3" runat="server">
...ÕâÖ®¼äµÄÄÚÈÝÈç¹ûûÓÐContentÄÚÈÝ£¬½«»áµÃµ½ÏÔʾ£»
...Èç¹ûÓÐContentÄÚÈÝ£¬½«»á±»ContentÄÚÈÝÌæ»»µô
</asp:ContentPlaceHolder>
ContentÒ³Ãæ
-- н¨Ò»WEB´°Ìå
-- ÔÚÊʵ± ......
ʾÀýÒ»
ÔÚGlobal.asax.csÎļþÖУº
protected void Application_Start(Object sender, EventArgs e)
{
System.Timers.Timer timer1 = new System.Timers.Timer();
&nbs ......
ÓÐÈËÒ²ÎÊÁ˸öÔÚÏßͳ¼ÆµÄÎÊÌ⣬ÎҵļûÒâÊÇÕâÑùµÄ£º
ÔÚApplication_StartʼþÖмÓÈëÒÔÏ´úÂ룺
Application.Lock();
Application.["UserCount"]=0;
Application.Unlock();
Session_Startʼ ......
ASP.NET»ñÈ¡¿Í»§¶ËÐÅÏ¢,ÔÝʱ¾ÍÕ⼸¸ö,ÓдýÌí¼Ó~~
1. ÔÚASP.NETÖÐרÓÃÊôÐÔ£º
»ñÈ¡·þÎñÆ÷µçÄÔÃû£ºPage.Server.ManchineName
»ñÈ¡Óû§ÐÅÏ¢£ºPage.User
»ñÈ¡¿Í»§¶ËµçÄÔÃû£ºPage.Request.UserHostName
»ñÈ¡¿Í»§¶ËµçÄÔIP£ºPage.Request.UserHostAddress
2. ÔÚÍøÂç±à³ÌÖеÄͨÓ÷½·¨£º
»ñÈ¡µ±Ç°µçÄÔÃû£ºstatic System. ......
Ò»°ãÊÇ·ÅÔÚGlobal.asaxÖУ¬´úÂëÈçÏ£º
<%@ Application Language="C#" %>
<mce:script runat="server"><!--
void Application_Start(object sender, EventArgs e)
{
// ÔÚÓ¦ÓóÌÐòÆô¶¯Ê±ÔËÐеĴúÂë
//Application["online"] = 10;//ÉèÖÃĬÈÏÔÚÏßÈËÊý,ÔÚÐéÄâ¿Õ¼äÉÏ£¬ÕâÀï²»»á ......