Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP.NET FileUploadÓ¦ÓÃʵÀý

Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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>ÎÞ±êÌâÒ³</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:FileUpload ID="FileUpload1" runat="server" />
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
      <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="FileUpload1"
            ErrorMessage="±ØÐëÊÇ jpg»òÕßgifÎļþ" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\W+)\$?)(\\(\W[\W].*))+(.jpg|.Jpg|.gif|.Gif){$article$}quot;></asp:RegularExpressionValidator>
    </form>
</body>
</html>
Default.aspx.cs:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
   protected void Button1_Click(object sender, EventArgs e)
    {
        String savePath = @"F:\111\";
        if (FileUpload1.HasFile)
        {
            String filename;
    &


Ïà¹ØÎĵµ£º

ÍøÂç°ì¹«oaÔ´Âë(Ô´´úÂëc#¿ª·¢£¬asp.net)

OAÔ´ÂëΪÎÒ¹¤×÷ÊÒ¾«ÐÄ´òÔì,ÓÃÁËÈýÄêµÄʱ¼ä,²ÅÐÞÕýÍêÉÆµÄ´óÐͰ칫ϵͳ.
Ϊ¶ÀÁ¢¿ª·¢,²»´æÔÚ°æÈ¨¾À·×,²»»á¸øÄú´øÀ´Âé·³,´úÂëÍêÕû£¬Öø×÷ȨµÇ¼ÇºÅ£º2008SR14608.
OA×îÐÂÉý¼¶£¬¹¤×÷Á÷¸üÇ¿´ó£¬±íµ¥¶¨Òå¸üÎȶ¨
ÇëÈÏ×¼ÁªÏµ·½Ê½£¬½÷·À¼Ùð¡£
Ϊ½ÚÔ¼¿ª·¢³É±¾£¬OAÔ´Âë¿ÉÒÔ·ÖÄ£¿é½øÐÐÌṩ
ÓÀ¾Ãά»¤£¬Óг¥2´Î¿ª·¢
Èí¼þ¹¦ÄÜ·ÖΪרҵ° ......

asp.netµÄÔÚÏßÈËÊýͳ¼Æ

Ò»°ãÊÇ·ÅÔÚGlobal.asaxÖУ¬´úÂëÈçÏ£º
<%@ Application Language="C#" %>
<mce:script runat="server"><!--
void Application_Start(object sender, EventArgs e)
{
// ÔÚÓ¦ÓóÌÐòÆô¶¯Ê±ÔËÐеĴúÂë
//Application["online"] = 10;//ÉèÖÃĬÈÏÔÚÏßÈËÊý,ÔÚÐéÄâ¿Õ¼äÉÏ£¬ÕâÀï²»»á ......

asp.netÖС°Ïß³ÌÕý±»ÖÐÖ¹¡±Òì³£µÄ½â¾ö·½·¨

asp.netÖГÏß³ÌÕý±»ÖÐÖ¹”Òì³£µÄ½â¾ö·½·¨
ÔÚÏîÄ¿À︺ÔðÒì³£´¦Àí²¿·Ö£ºÒì³£ÐÅÏ¢µÄдÈ룬¶ÁÈ¡£¬²é¿´£¬Òò´Ë¾Í¿ÉÒÔ¿´µ½¸÷ÖÖÒì³££¬ÊÜÒæ·Ëdz
¿´µ½ÓÐN¶àµÄ“Ïß³ÌÕý±»ÖÐÖ¹”Òì³££¬¶øÇÒÀ´×Ôͬһ¸öÒ³Ãæ¡£
System.Threading.ThreadAbortException: Ïß³ÌÕý±»ÖÐÖ¹¡£
at System.Threading.Thread.AbortInternal( ......

Asp.net ÖÐ CookieµÄʹÓ÷½·¨

·½·¨1:
±ÈÈ罨Á¢Ò»¸öÃûΪcnlive£¬ÖµÎª"123"µÄcookie
HttpCookie cookie = new HttpCookie["cnlive"];
cookie.Value = "123";
Response.AppendCookie(cookie);
È¡¸Õ²ÅдÈëµÄCookieÖµ:
HttpCookie cookie = Request.Cookies["cnlive"];
cookieValue = cookie.Value;
ÔÚÒ»¸öCookieÖд¢´æ¶à¸öÐÅÏ¢:
HttpCookie cookie ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ