ÎļþÉÏ´«´úÂ루asp.net£©
Boolean fileOK = false;
String path = "D:\\";
//string path = "1.gif";
String fileExtension =
System.IO.Path.GetExtension(Myfile.Value).ToLower();
string str1=System.IO.Path.GetFileName(Myfile.Value);
String[] allowedExtensions =
{ ".gif", ".png", ".jpeg", ".jpg" };
string temp = System.IO.Path.GetTempPath();
string temp1 = Server.MapPath("./");
for (int i = 0; i < allowedExtensions.Length; i++)
{
if (fileExtension == allowedExtensions[i])
{
fileOK = true;
}
}
if (fileOK)
{
try
&nbs
Ïà¹ØÎĵµ£º
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Mail;
using System.Net.Mime;
using System.Net.Configuration;
namespace BCore.PubFunction
{
public class MailHandler
{
&n ......
1¡¢ÔÚÏßÓû§ÁбíµÄʵÏÖ
ÔÚASPʱ´ú£¬ÒªÊµÏÖÒ»¸öÍøÕ¾µÄÔÚÏßÓû§ÁбíÏÔʾ¹¦ÄܵĹßÓÃ×ö·¨ÊÇÐÞ¸Äglobal.asaÎļþÖеģºApplication_Start¡¢Session_StartºÍSession_EndÕâÈý¸öº¯Êý¡£ÔÚASP.NETʱ´ú£¬ÎÒÒÀÈ»ÕâÑù×ö¡£µ«ÊDZØÐë×¢ÒâºÜ¶àÎÊÌâ¡£Ê×ÏÈÀ´¿´¿´×î¼òµ¥µÄ´úÂëʵÏÖ£º
protected void Application_Start(Object sender, EventArg ......
ÎļþÉÏ´«½çÃæ¼È¿ÉÒÔÓÃHtmlµÄinput file¿Ø¼þ£¬ÓÖ¿ÉÒÔÓÃFileUpload¿Ø¼þ£¬Ö»Òª½«HtmlµÄinput file¿Ø¼þ¼ÓÉÏrunat="server"£¬¾Í»á·¢ÏÖÁ½ÕߵŦÄÜÍêÈ«ÊÇһģһÑù£¬ÉÏ´«µÄ´úÂëÊǹ²Óõ쬲»ÐèÒª×öÈκθı䡣ÎÒÏë΢ÈíÔÚ½«Html¿Ø¼þ½«³É±ê×¼¿Ø¼þʱӦ¸ÃÖ»ÊǶà¼ÓÁËrunat="server"°É¡£·ÅÈëÉÏÊöÁ½ÕßµÄÈÎÒ»¿Ø¼þºó£¬Ìí¼ÓÒ»¸ö±ê×¼µÄButton°´Å¥ ......
PHP VS ASP.NET
²©¿Í·ÖÀà: ÊÕ»ñ»ýÀÛ
bruce·¢±íÓÚËÄÔ 14 2009, 04:42 ÏÂÎç
PHPºÍASP.NETÔÚ±¾ÖÊÉÏÊÇÓкܴó²»Í¬µÄ£¬PHP³£±»Ó¦Óõ½¹¦Ä̶ܹ¨µÄÍøÕ¾¹¹½¨ÉÏ£¬ÀýÈçÁôÑÔ°å¡¢ÐÂÎÅ·¢²¼¡¢ÂÛ̳ºÍͶƱµÈ£¬ÕâЩ¹¦ÄÜÊÇ¿ìËÙ½¨Õ¾±Ø±¸µÄ£¬×Ô¶¨Ò帴ÔÓµÄÉÌÒµÁ÷³Ì²»¶à£¬Òò´ËÍøÂ·ÉÏÓÐÐí¶àÏֳɵ ......