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.PostedFile.FileName;//»ñÈ¡¿Í»§»úÉÏ´«ÎļþµÄ·¾¶
int lastdotlocation = orignalName.LastIndexOf(".");
string extendName = orignalName.Substring(lastdotlocation);//»ñÈ¡À©Õ¹Ãû
if (extendName != ".gif" && extendName != ".jpg" && extendName != ".jpeg" && extendName != ".png")
{
Response.Write("Wrong format");
Response.End();
}//¼ì²éÎļþ¸ñʽ
string newName = DateTime.Now.Millisecond.ToString() + "_" + myFile2.PostedFile.ContentLength.ToString() + extendName;//¶ÔÎļþ½øÐÐÖØÃüÃû
myFile.PostedFile.SaveAs(Server.MapPath("~") + @"\photoes\" +userID+@"\"+ newName);
}
Ïà¹ØÎĵµ£º
˳±ãÌáÒ»ÏÂaspÖÐSessionµÄ¹¤×÷ÔÀí£º
aspµÄSessionÊǾßÓнø³ÌÒÀÀµÐԵġ£ASP Session״̬´æÓÚIISµÄ½ø³ÌÖУ¬Ò²¾ÍÊÇinetinfo.exeÕâ¸ö³ÌÐò¡£ËùÒÔµ±inetinfo.exe½ø³Ì±ÀÀ£Ê±£¬ÕâЩÐÅÏ¢Ò²¾Í¶ªÊ§¡£ÁíÍâ£¬ÖØÆð»òÕ߹رÕIIS·þÎñ¶¼»áÔì³ÉÐÅÏ¢µÄ¶ªÊ§¡£
asp.net SessionµÄʵÏÖ
asp.netµÄSessionÊÇ»ùÓÚHttpModule¼¼Êõ×öµÄ£¬HttpModule ......
Ê×ÏÈ,ÔÚpageloadÀïдÈëÒÔÏ´úÂë:Response.Write("<script>window.opener=null;window.close();</script>");
Æä´Î,ÔÚheadÀïдÏÂÈçÏÂJS´úÂë: <script language="JavaScript">
<!--
function openwin() { window.open ("Default.aspx", "newwindow", "height=600, width=600, toolbar=no, menubar=n ......
VS2005µ÷ÊÔasp.net³ÌÐòʱ³öÏÖ----Internet Explorer ÎÞ·¨ÏÔʾ¸ÃÒ³Ãæ
ÈçͼËùʾ£º
ǰ¶Îʱ¼ä¿ÉÒÔµ÷ÊԵģ¬ËÖª×òÍíͻȻ²»ÐÐÁË£¬ÕÒÁ˺þã¬ÖÕÓÚÕÒµ½½â¾ö·½°¸¡£ÓõÄÊÇVS2005£¬Îļþϵͳ£¬ÔÚIISÀïÃæÉèÖõϰ£¬¿ÉÒÔÔËÐУ¬´úÂëûÎÊÌ⣬Êý¾Ý¿âÁ¬½ÓûÎÊÌâ¡£
·½°¸Ò»£ºÍ¨¹ýÓÒ»÷ASP.NET Development Server£¬Èçͼ£º
´ò¿ª1£¬ÔÚĬÈÏä¯ÀÀÆ ......
protected void Unite(GridView gv)
{
int i;
string LastType1;
int LastCell;
if (gv.Rows.Count > ......
1.C#Á¬½ÓÁ¬½ÓAccess
³ÌÐò´úÂë:
------------------------------------------------------------------------------- using System.Data;
using System.Data.OleDb;
..
string strConnection="Provider=Microsoft.Jet.OleDb.4.0;";
strConnection+=@"Data Source=C:BegASPNETNorthwind.mdb";
Ol ......