Asp.Net²Ù×÷txt£¬¶Áдȡ¡£²¢¶ÔtxtÎļþ½øÐÐÌõ¼þ²éѯ
1£©´´½¨txtÎļþ¡¾web.config¡¿
--------------------------------------------------------------------
<appSettings>
<add key="EditChars" value="D:\Site\ZJPS\TextFile\EditChars.txt"/>
</appSettings>
2) Ò³ÃæµÄCSÎļþÖУº
--------------------------------------------------------------------
¡¾1¡¿ »ñÈ¡txtÎļþλÖ㺠protected string FileName = System.Configuration.ConfigurationManager.AppSettings["EditChars"].ToString();
¡¾2¡¿ Îļþ²Ù×÷£º´´½¨¡¢Ð´¡¢¶Á Îļþ¡£
#region Îļþ²Ù×÷
/// <summary>
/// ´´½¨txtÎļþ
/// </summary>
public void CreateToFile()
{
StreamWriter SW;
SW = File.CreateText(FileName);
SW.Close();
}
/// <summary>
/// дÎļþ
/// </summary>
public void WriteToFile()
{
string InsertStr = "";
if (!File.Exists(FileName))
{
CreateToFile();
InsertStr = "Content#Da
Ïà¹ØÎĵµ£º
¡¡¡¡¸÷´óÍøÂç±à³ÌÓïÑÔµÄ10Äê·ÜÕ½£¬¸÷ÓÐËù³¤¡¢¸÷ÁìǧÇï¡£½ñÈÕ¶ÔÓÚÎÒÃǵÄÍøÕ¾±à³ÌÓïÑÔ:ASP¡¢JSP¡¢PHP¡¢ASP.NET½øÐÐʵ¼ÊÓ¦ÓÃͳ¼Æ:
¡¡¡¡ASP:50%
¡¡¡¡JSP:10%
¡¡¡¡PHP:20%
¡¡¡¡ASP.NET:20%
¡¡¡¡¸ù¾ÝÒÔÉÏͳ¼ÆÀ´×öÒ»ÏÂÌÖÂÛ¡£ASP¼¼ÊõÈç½ñÌì¿ÉÒÔ˵ÒѳÉΪ¹ýÈ¥£¬µ«ÈÔÕ¼Êг¡µÄ50%£¬ÒòΪµ±Ê±ASP¼¼ÊõµÄÐËÆ𣬶Դ󲿷ֱà³Ì ......
ÔÚASP.Net MVCÀàÐ͵ÄÏîÄ¿ÖÐÓÒ»÷Controller Îļþ¼Ð£¬Ñ¡ÖÐAdd=>Controller¡ºó£¬»áÔÚн¨µÄController ÖвåÈëһЩĬÈÏ´úÂë¡£ ÔÚController µÄ¸÷¸öAction·½·¨ÖÐÓÒ»÷ Add View¡£¬Ò²»áÔÚн¨µÄViewÖвåÈëһЩ´úÂë¡£ÔÚн¨Viewʱ²åÈëµÄ´úÂë»á¸ù¾ÝÉÏÏÂÎĺÍÄãµÄÑ¡Ôñ¶ø²»Í¬£¬ËƺõÓкܴóµÄ´úÂëÉú³É¹¦ÄÜ¡£ ÉÏÊöÁ½ÕßÉú³É´ ......
ÓÐʱºòÄãÏëÔÚµ÷ÓÃaction·½·¨Ö®Ç°»òÕßaction·½·¨Ö®ºó´¦ÀíһЩÂß¼£¬ÎªÁËÖ§³ÖÕâ¸ö£¬ASP.NET MVCÔÊÐíÄã´´½¨action¹ýÂËÆ÷¡£Action¹ýÂËÆ÷ÊÇ×Ô¶¨ÒåµÄAttributes£¬ÓÃÀ´±ê¼ÇÌí¼ÓAction·½·¨Ö®Ç°»òÕßAction·½·¨Ö®ºóµÄÐÐΪµ½¿ØÖÆÆ÷ÀàÖеÄAction·½·¨ÖС£
һЩ¿ÉÄÜÓõ½Action¹ýÂËÆ÷µÄµØ·½ÓУº
ÈÕÖ¾,Òì³£´¦Àí
Éí·ÝÑéÖ¤ºÍÊÚȨ £ ÏÞÖ ......
<asp:FileUpload /> ÎļþÉÏ´«¿Ø¼þ
ʵÏÖÒ»¸ö¼òµ¥µÄͼƬÎļþÉÏ´«
//ÉÏ´«Îļþ¿Ø¼þʹÓãºÊµÏÖÉÏ´«Í¼Æ¬¹¦ÄÜ£¬ÉÏ´«Í¼Æ¬Ö»ÄÜÊÇjpg£¬gif£¬bmpÈýÖÖÀàÐÍ£¬Í¼Æ¬´óС²»³¬¹ý60kb
ºǫ́´úÂ룺
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using ......
ÔÚASP.NET MVC beta·¢²¼Ö®Ç°£¬M$¾ÍÐû²¼Ö§³Ö¿ªÔ´µÄJS¿ò¼ÜjQuery£¬È»ºóASP.NET MVC beta·¢²¼ºó£¬Ä㽨Á¢Ò»¸öASP.NET MVC betaµÄÏîÄ¿ºó£¬Äã¿ÉÒÔÔÚÏîÄ¿µÄscriptsĿ¼ÏÂÕÒµ½ASP.NET AJAXºÍjQueryµÄJS¡£·´ÕýÎÒÊDZȽÏϲ»¶jQueryµÄ£¬ËùÒÔ¶ÔÓÚM$´Ë¾Ù»¹ÊÇͦÐÀοµÄ¡£
·Ï»°²»¶à˵£¬ÎÒÃÇʹÓÃAJAXÀ´ÊµÏÖ·¢±íÆÀÂ۵ŦÄÜ°É¡£ÏÈÀ´¿´¿´ÔõÑùÊ¹Ó ......