Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : asp.net

asp.netÖÐÏÔʾÔÚÏßÓû§


asp.netÖÐÏÔʾÔÚÏßÓû§
private static System.Threading.Timer timer;
private const int interval = 1000 * 60 * 20;//¼ì²éÔÚÏßÓû§µÄ¼ä¸ôʱ¼ä
/// <summary>
/// ±ØÐèµÄÉè¼ÆÆ÷±äÁ¿¡£
/// </summary>
private System.ComponentModel.IContainer components = null;
public Global()
{
InitializeComponent();
}
protected void Application_Start(Object sender, EventArgs e)
{
if (timer == null)
timer = new System.Threading.Timer(new System.Threading.TimerCallback(ScheduledWorkCallback),
sender, 0, interval);
DataTable userTable = new DataTable();
userTable.Columns.Add("UserID");//Óû§ID
userTable.Columns.Add("UserName");//Óû§ÐÕÃû
userTable.Columns.Add("FirstRequestTime");//µÚÒ»´ÎÇëÇóµÄʱ¼ä
userTable.Columns.Add("LastRequestTime");//×îºóÒ»´ÎÇëÇóµÄʱ¼ä
userTable.Columns.Add("ClientIP");//
userTable.Columns.Add("ClientName");//
userTable.Columns.Add("ClientAgent");//
userTable.PrimaryKey = new DataColumn[]{userTable.Columns[0]};
userTable.AcceptChanges();
Application.Loc ......

asp.net ÔËÐÐÔ­Àí

Ö÷ÒªÀࣺ
¡¡¡¡System.Web.HttpRuntime
¡¡¡¡System.Web.HttpApplicationFactory
¡¡¡¡System.Web.HttpApplication
¡¡¡¡System.Web.Compilation.BuildManager
¡¡¡¡System.Web.Compilation.ApplicationBuildProvider
¡¡¡¡System.Web.Compilation.BuildProvidersCompiler
¡¡¡¡System.Web.UI.PageHandlerFactory
ÇëÇó´¦Àí¼òÒªÁ÷³Ìͼ:
·ÖÎö£º
µ±ÎÒÃÇͨ¹ýä¯ÀÀÆ÷ÏòASP.NET 2.0ÍøÕ¾µÄÒ»¸öasp.netÒ³Ãæ·¢ÆðÇëÇóʱ£¬ÔÚ·þÎñÆ÷¶ËÊ×ÏÈÊÇIISÊÕµ½ÇëÇó£¬IISÒ»¿´ÊÇasp.netÒ³Ãæ£¬ÐÄÀïºÜ¿ªÐÄ£¬ÒòΪÕâ¸öÇëÇó²»ÓÃËü´¦Àí£¬½»¸øASP.NET ISAPI¾ÍÐÐÁË¡£ASP.NET ISAPIµÄ¹¤×÷Ò²±È½ÏÇáËÉ£¬ËûµÄÖ÷ÒªÈÎÎñ¾ÍÊǰ²ÅÅaspnet_wp.exe´¦ÀíÇëÇ󣬲¢¼àÊÓaspnet_wp.exe½ø³ÌµÄÖ´ÐÐÇé¿ö£¬Èç¹ûaspnet_wp.exe½ø³ÌÌ«ÀÛÁË£¬²»ÄܳöÉ«µØÍê³ÉÈÎÎñ£¬ASP.NET ISAPI¾ÍÒªÈÃËûϸڣ¬»»Ò»¸öеÄaspnet_wp.exeÀ´´¦Àí¹¤×÷¡£
¡¡aspnet_wp.exeµÄÖ÷ÒªÈÎÎñÊǽ«ÇëÇ󽻸øÒ»ÏµÁгÆÎªµÄ HTTP ¹ÜµÀµÄÍйܶÔÏó¡£Èç¹û°ÑASP.NET ISAPI±È×öÏúÊÛ¾­Àí£¬ÄÇaspnet_wp.exe¾ÍÊÇÉú²ú¾­Àí£¬¶øHTTP ¹ÜµÀ¾ÍÊÇÉú²úµÄÁ÷Ë®Ïß¡£¸ºÔðÁ÷Ë®ÏßµÄС×é¾ÍÊÇHttpRuntime£¬Éú²ú¾­Àíaspnet_wp.exe»á½«¶©µ¥(HTTPÇëÇó)½»¸øHttpRuntimeС×éµÄ¹¤×÷ÈËÔ±ProcessRequest(HttpW ......

ASP.NETÁ¬½Ó¸÷ÀàÊý¾Ý¿â¼¯½õ

1.C#Á¬½ÓÁ¬½ÓAccess
³ÌÐò´úÂë:
------------------------------------------------------------------------------- using System.Data;
using System.Data.OleDb;
..
string strConnection="Provider=Microsoft.Jet.OleDb.4.0;";
strConnection+=@"Data Source=C:BegASPNETNorthwind.mdb";
OleDbConnection objConnection=new OleDbConnection(strConnection);
..
objConnection.Open();
objConnection.Close();
½âÊÍ:
¡¡Á¬½ÓAccessÊý¾Ý¿âÐèÒªµ¼Èë¶îÍâµÄÃüÃû¿Õ¼ä,ËùÒÔÓÐÁË×îÇ°ÃæµÄÁ½ÌõusingÃüÁî,ÕâÊDZز»¿ÉÉÙµÄ!
¡¡strConnectionÕâ¸ö±äÁ¿Àï´æ·ÅµÄÊÇÁ¬½ÓÊý¾Ý¿âËùÐèÒªµÄÁ¬½Ó×Ö·û´®,ËûÖ¸¶¨ÁËҪʹÓõÄÊý¾ÝÌṩÕߺÍҪʹÓõÄÊý¾ÝÔ´.
¡¡"Provider=Microsoft.Jet.OleDb.4.0;"ÊÇÖ¸Êý¾ÝÌṩÕß,ÕâÀïʹÓõÄÊÇMicrosoft JetÒýÇæ,Ò²¾ÍÊÇAccessÖеÄÊý¾ÝÒýÇæ,asp.net¾ÍÊÇ¿¿Õâ¸öºÍAccessµÄÊý¾Ý¿âÁ¬½ÓµÄ.
¡¡"Data Source=C:\BegASPNET\Northwind.mdb"ÊÇÖ¸Ã÷Êý¾ÝÔ´µÄλÖÃ,ËûµÄ±ê×¼ÐÎʽÊÇ"Data Source=MyDrive:MyPath\MyFile.MDB".
PS:
¡¡1."+="ºóÃæµÄ"@"·ûºÅÊÇ·ÀÖ¹½«ºóÃæ×Ö·û´®ÖеÄ"\"½âÎöÎ ......

ASP.NETÎļþÉÏ´«£¬ÎªÃ¿¸öÓû§½¨Á¢Ò»¸öÉÏ´«Ä¿Â¼

ÎļþÉÏ´«½çÃæ¼È¿ÉÒÔÓÃHtmlµÄinput file¿Ø¼þ£¬ÓÖ¿ÉÒÔÓÃFileUpload¿Ø¼þ£¬Ö»Òª½«HtmlµÄinput file¿Ø¼þ¼ÓÉÏrunat="server"£¬¾Í»á·¢ÏÖÁ½ÕߵŦÄÜÍêÈ«ÊÇһģһÑù£¬ÉÏ´«µÄ´úÂëÊǹ²Óõ쬲»ÐèÒª×öÈκθı䡣ÎÒÏë΢ÈíÔÚ½«Html¿Ø¼þ½«³É±ê×¼¿Ø¼þʱӦ¸ÃÖ»ÊǶà¼ÓÁËrunat="server"°É¡£·ÅÈëÉÏÊöÁ½ÕßµÄÈÎÒ»¿Ø¼þºó£¬Ìí¼ÓÒ»¸ö±ê×¼µÄButton°´Å¥£¨Html°´Å¥Ò²ÐУ¬²»¹ýÐèÒª¼ÓÉÏrunat="server"),Ë«»÷Button°´Å¥£¬²úÉúµã»÷ʼþ¡£ÔÚµã»÷ʼþÖÐдÈëÒÔÏ´úÂ룺
Ê×Ïȼì²éÊÇ·ñÒѾ­Ñ¡ÁËÎļþ
if (this.myFile.PostedFile != null)
{
¼ì²éÎļþ¸ùĿ¼ÊÇ·ñ´æÔÚ£¬²»´æÔÚ¾ÍÒª´´½¨
if (!System.IO.Directory.Exists(Server.MapPath("~")+@"\photoes"))
{
      System.IO.Directory.CreateDirectory(Server.MapPath("~")+@"\photoes");
}
´Ë´¦Server.MapPath("~")ÓÃÀ´±íʾÏîÄ¿¸ùĿ¼µÄÎïÀí·¾¶¡£
½ÓÏÂÀ´´´½¨Óû§Îļþ¼Ð£¬¸ù¾ÝÓû§ID´´½¨
if(!System.IO.Directory.Exists(Server.MapPath("~")+@"\photoes\"+userID))
{
     System.IO.Directory.CreateDirectory(Server.MapPath("~")+@"\photoes\"+userID)
}
string orignalName = this.myFile2.Po ......

Tip/Trick: Url Rewriting with ASP.NET

 
People often ask me for guidance on how they can dynamically "re-write" URLs and/or have the ability to publish cleaner URL end-points within their ASP.NET web applications.  This blog post summarizes a few approaches you can take to cleanly map or rewrite URLs with ASP.NET, and have the option to structure the URLs of your application however you want.
Why does URL mapping and rewriting matter?
The most common scenarios where developers want greater flexibility with URLs are:
1) Handling cases where you want to restructure the pages within your web application, and you want to ensure that people who have bookmarked old URLs don't break when you move pages around.  Url-rewriting enables you to transparently forward requests to the new page location without breaking browsers.
2) Improving the search relevancy of pages on your site with search engines like Google, Yahoo and Live.  Specifically, URL Rewriting can often make it easier to embed common keywords int ......

asp.netÕýÔò±í´ïʽ´óÈ«

Ö»ÄÜÊäÈëÊý×Ö£º"^[0-9]*$"¡£
Ö»ÄÜÊäÈënλµÄÊý×Ö£º"^\d{n}$"¡£
Ö»ÄÜÊäÈëÖÁÉÙnλµÄÊý×Ö£º"^\d{n,}$"¡£
Ö»ÄÜÊäÈëm~nλµÄÊý×Ö£º¡£"^\d{m,n}$"
Ö»ÄÜÊäÈëÁãºÍ·ÇÁ㿪ͷµÄÊý×Ö£º"^(0|[1-9][0-9]*)$"¡£
Ö»ÄÜÊäÈëÓÐÁ½Î»Ð¡ÊýµÄÕýʵÊý£º"^[0-9]+(.[0-9]{2})?$"¡£
Ö»ÄÜÊäÈëÓÐ1~3λСÊýµÄÕýʵÊý£º"^[0-9]+(.[0-9]{1,3})?$"¡£
Ö»ÄÜÊäÈë·ÇÁãµÄÕýÕûÊý£º"^\+?[1-9][0-9]*$"¡£
Ö»ÄÜÊäÈë·ÇÁãµÄ¸ºÕûÊý£º"^\-[1-9][]0-9"*$¡£
Ö»ÄÜÊäÈ볤¶ÈΪ3µÄ×Ö·û£º"^.{3}$"¡£
Ö»ÄÜÊäÈëÓÉ26¸öÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º"^[A-Za-z]+$"¡£
Ö»ÄÜÊäÈëÓÉ26¸ö´óдӢÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º"^[A-Z]+$"¡£
Ö»ÄÜÊäÈëÓÉ26¸öСдӢÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º"^[a-z]+$"¡£
Ö»ÄÜÊäÈëÓÉÊý×ÖºÍ26¸öÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º"^[A-Za-z0-9]+$"¡£
Ö»ÄÜÊäÈëÓÉÊý×Ö¡¢26¸öÓ¢ÎÄ×Öĸ»òÕßÏ»®Ïß×é³ÉµÄ×Ö·û´®£º"^\w+$"¡£
ÑéÖ¤Óû§ÃÜÂ룺"^[a-zA-Z]\w{5,17}$"ÕýÈ·¸ñʽΪ£ºÒÔ×Öĸ¿ªÍ·£¬³¤¶ÈÔÚ6~18Ö®¼ä£¬Ö»Äܰüº¬×Ö·û¡¢Êý×ÖºÍÏ»®Ïß¡£
ÑéÖ¤ÊÇ·ñº¬ÓÐ^%&',;=?$\"µÈ×Ö·û£º"[^%&',;=?$\x22]+"¡£
Ö»ÄÜÊäÈ뺺×Ö£º"^[\u4e00-\u9fa5]{0,}$"¡£
ÑéÖ¤EmailµØÖ·£º"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"¡£
ÑéÖ¤InternetURL£º"^http:/ ......
×ܼǼÊý:2672; ×ÜÒ³Êý:446; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [409] [410] [411] [412] 413 [414] [415] [416] [417] [418]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ