ÇóÖúasp.netͼƬÉÏ´« - .NET¼¼Êõ / ASP.NET
¾ÍÊÇÒ»¸ö°´Å¥£¬µã»÷Ö®ºó´ò¿ª¶Ô»°¿ò£¬È»ºóѡȡͼƬ¡£¾ÍÕâÑùÉÏ´«¡£¡£
ÔõôʵÏÖ¡£ÔÚÍøÉÏËѵ½ÄÇô¶àµÄ´úÂ룬ȫÊǺܶàµÄÄÇÖÖ£¬²»ÖªµÀ£¬¿´²»ÏÂÈ¥¡£
ËùÒÔÔÚÕâÀïÏëÇë´ó¸ç´ó½ã°ï°ïæ¡£
ʹÓÃ×Ô´øµÄfileupload¿Ø¼þ¿ÉÒÔʵÏÖµÄ ÍøÉÏÓв»ÉÙ´úÂë
fileupload.SaveAs(Server.MapPath(...));
FileName: »ñÈ¡ÉÏ´«µÄÎļþÃû
HasFile: ÊÇ·ñÑ¡Ôñ(´æÔÚ)ÉÏ´«µÄÎļþ
ContentLength: »ñµÃÉÏ´ÜÎļþµÄ´óС,µ¥Î»ÊÇ×Ö½Ú(byte)
·½·¨:
Server.MapPath(): »ñÈ¡·þÎñÆ÷ÉϵÄÎïÀí·¾¶
SaveAs(): ±£´æÎļþµ½Ö¸¶¨µÄÎļþ¼Ð
C# code:
if (FileUpLoad1.HasFile)
{
//ÅжÏÎļþÊÇ·ñСÓÚ10Mb
if (FileUpLoad1.PostedFile.ContentLength < 10485760)
{
try
{
//ÉÏ´«Îļþ²¢Ö¸¶¨ÉÏ´«Ä¿Â¼µÄ·¾¶
FileUpLoad1.PostedFile.SaveAs(Server.MapPath("~/Files/")
+ FileUpLoad1.FileName);
//FileUpLoad1.SaveAs(@"D:\"+FileUpLoad1.FileName);
lblMessage.Text = "ÉÏ´«³É¹¦!";
}
catch (Exception ex)
{
lblMessage.Text = "³öÏÖÒì³£,ÎÞ·¨ÉÏ´«!";
}
}
else
Ïà¹ØÎÊ´ð£º
http://www.zgjhjy.com/Test/PrimaryTest/Index.aspx
¾ÍÊÇÀàËÆÒÔÉϵÄÔÚÏß²âÊÔϵͳ£¬ÐèÒªÓÐÒ»¸öºǫ́µÄ£¬ÓïÑÔÊÇaspµÄ£¬Êý¾Ý¿âÊÇaccessµÄ£¬»¹ÐèÒªÄÜÔÚºǫ́¶ÔÐÅÏ¢½øÐÐÌíɾ¸Ä²éµÄ¡£Ð»Ð»¸÷λÁË¡£¡£¡£
³ÌÐòÕæµÄºÜ¶à£¬²»Öª ......
µ÷ÕûÁËÕâÀÄÇÀï³öÎÊÌâ¡£
ÓÐûÓÐʲôºÃµÄ·½·¨£¬Ïñµ÷Õû¶Ô»°¿òÒ»Ñù£¿£¿£¿£¿
ÕÒ¸öרÃÅ×öÒ³ÃæµÄ
ÔÚdreamweaverÀïµ÷¡£¡£¡£Ò²¿ÉÒÔÖ±½Ó¿ØÖÆHTML´úÂë
ȷʵʹ¿à ¸ÐͬÉíÊÜѽ
¹þ¹þ ¼á¾ö·¹ý¡£
ÓÃDW°É£¬VS¸ãÉè¼Æ ......
±¾È˹¤×÷¾ÑéÒ»ÄêÒÔÉÏ
ÊìϤasp.net
ÊìϤjavascript
ÊìϤCss
ÊìϤajax
ÊìϤsqlserver2005
ÓÐÒ»ÄêµÄÏîÄ¿¾Ñé
¾ßÌåÏîÄ¿ºÍÆäËûµÄ¾Í²»ÔÚÕâдÁË
ÓÐÒâÕßÁªÏµ£º
QQ:359233910
ÒýÓÃ
±¾È˹¤×÷¾ÑéÒ»ÄêÒÔÉÏ
ÊìϤasp ......
asp.netÅúÁ¿ÉÏ´«Í¼Æ¬×îºÃÓÐÔ´Â룬ÔÚÏߵȣ¡£¡£¡£¡£¡£¡£¡
Ô´ÂëºÜ³¤µÄ¡£
²Î¿¼
C# code:
HttpFileCollection files = HttpContext.Current.Request.Files;
if (files.Count <= 1)
{
......
±¾ÈËÊDzËÄñÒ»¸ö£¬Æ½Ê±Òª×öÉúÒ⣬µ«ÊÇÕÒÁ˺ܶàÈË×öÍøÕ¾£¬¾ù±»ÆÁË¡£×öµÃ²»Èý²»ËÄ£¬ÏÖÔÚ¾öÐÄ×Ô¼ºÀ´×öÒ»¸ö£¬ÒÑѧϰASP.NETÏà¹ØµÄÍøÒ³ÖÆ×÷֪ʶ£¬ÓÐDW»ù´¡£¬¿ÉÒÔ˵ÊÇÄ¿Ç°Ö»ÓÐÀíÂÛ֪ʶ£¬µ«ÊÇÔÚʵ¼Ê¾ßÌå²Ù×÷µÄʱºò£¬×ÜÊÇÓöµ ......