ÕªÒª ASP.NETÊÇÐÂÒ»´úWebÓ¦ÓóÌÐò¿ª·¢Æ½Ì¨£¬ËüÊÇÒ»¸öÒѱàÒëµÄ¡¢»ùÓÚ.NETµÄ¿ª·¢»·¾³£¬ËüÌṩÁËÉú³ÉÆóÒµ¼¶Ó¦ÓóÌÐòËù±ØÐèµÄÈ«²¿·þÎñ£¬»ùÓÚ .NET Framework Éú³É£¬Õû¸ö¿ò¼Ü¶¼¿ÉÓÃÓÚÈκΠASP.NET Ó¦ÓóÌÐò¡£¿ÉÒÔʹÓÃÈκÎÓ빫¹²ÓïÑÔÔËÐпâ(CLR)¼æÈݵÄÓïÑÔ(°üÀ¨ Visual Basic.NET¡¢C# ºÍ JScript .NET)À´´´½¨Ó¦ÓóÌÐò¡£¸ÃϵͳʹÓÃASP.NET(C#ÓïÑÔ)ºÍADO.NET¼¼Êõ¿ª·¢, ʵÏÖÁËÍøÕ¾ÐÂÎŵĶ¯Ì¬¹ÜÀí£¬Ê¹µÃ¶ÔÐÅÏ¢µÄ¹ÜÀí¸ü¼Ó¼°Ê±¡¢¸ßЧ£¬Ìá¸ßÁ˹¤×÷ЧÂÊ£¬¾ßÓÐÒ»°ãÐÂÎÅϵͳµÄ¹¦ÄÜ£¬Ö÷Òª°üÀ¨Ç°Ì¨ÐÂÎŲ鿴ÇøºÍºǫ́¹ÜÀíÇø£¬¿ÉΪѧУ¸÷²¿ÃÅ·¢²¼ÐÂÎÅ£¬ÎªÐ£Ô°ÍøÕ¾ÌṩÐÂÎÅ·¢²¼Óë¹ÜÀíµÄ·þÎñ¡£
¹Ø¼ü´Ê ASP.NET ADO.NET ÐÂÎŹÜÀí Browser/Server
.NET to Develop the News Briefing Administrative System of the Campus
Liu Jungang
(Dept. of Computer and Information Science, Southwest Forestry College, Kunming, Yunnan, 650224, China)
Abstract ASP.NET is Web application program developing platform of new generation, it is one that has already compiled , development environment based on .NET, it has offered and produced all essential services of application program of enterprise layer, produce because of .NET Framework, the whole frame can be used in any ASP.NET application program. Can use any to operate the compatible language (including Visual Basic.NET , C# and JScript .NET ) of storehouse (CLR ) to establish application program with common language . This news system uses ASP.NET (C#) and ADO.NET technological development, has realized the dynamic management of website's news, make the control over information more prompt , more high-efficient , has improved working efficiency. News this system have general news function of system, mainly including front desk news person who look over and back-stage management area, can release news for every department of the school , offer news briefing and management one service for campus website.
Keywords ASP.NET ADO.NET NewsManagement Browser/Server
ÒýÑÔ
ASP.NETÊÇ΢Èí¹«Ë¾×îÐÂÍƳöµÄÒ»ÖÖͳһWeb¿ª·¢Æ½Ì¨£¬Óë×îеÄÊý¾Ý·ÃÎʼ¼ÊõADO.NETÒ»Æð¿É¹¹½¨³öÇ¿´ó¡¢°²È«ºÍ¿É¿¿µÄÆóÒµ¼¶WebÓ¦ÓóÌÐò¡£ASP.NETµÄÓï·¨Ôںܴó³Ì¶ÈÉÏÓëASP¼æÈÝ£¬Í¬Ê±Ëü»¹ÌṩһÖÖеıà³ÌÄ£Ðͺͽṹ£¬ÓÃÓÚÉú³É¸ü°²È«¡¢¿ÉÉìËõºÍÎȶ¨µÄÓ¦ÓóÌÐò¡£
²ÉÈ¡ÁËASP.NET¼¼ÊõµÄϵͳÔÚÐÔÄÜÉÏÓÐÁ˺ܴóµÄ¸ÄÉÆ£¬Ö÷Òª±íÏÖÔÚÒÔϼ¸·½Ã棺
¡ñ ÓÉÓÚASPÒ³Ãæÿ´Î´ò¿ª¶¼±ØÐë¾¹ýÏȱàÒëºó½âÊ͵Ĺý³Ì£¬ËùÒÔÒ³ÃæÔÚ·´¸´´ò¿ªÊ±ËÙ¶ÈûÓÐÈκÎÌáÉý£¬¶øASP.NETÒ³ÃæÖ»ÐèÒªÒ»´Î±àÒëºó²»ÐèÒªÖØбàÒ룬ֱµ½¸ÃÒ³Ãæ±»Ð޸ĻòWebÓ¦ÓóÌÐòÖØÐÂÆô¶¯¡£ÕâʹµÃÔÚ¶à´Î·ÃÎÊʱËÙ¶ÈÓÐÁ˼«´óµÄÌáÉý£»
¡ñ ÓÉÓÚASPûÓÐÌṩÈκÎÊä³öÊý¾ÝΪÄÚÈݵÄÔª¼þ£¬ËùÒÔÔÚʹÓÃASP׫дÊý¾Ý¿âÒ³ÃæʱֻÄܽèÖúADOµÄRecordSet¶ÔÏóÖð±Ê¶ÁÈ¡¼Ç¼£¬¶øASP.NETͨ¹ýADO.NETÌṩµÄDataGridµÈÊý¾Ý¿âÔª¼þ¿ÉÒÔÖ±½ÓºÍÊý¾Ý¿âÁªÏµ£»
¡ñ ASP.NETÖ§³ÖÓ¦ÓóÌÐòµÄʵʱ¸üУ¬¹ÜÀíÔ±²»±Ø¹ØµôÍøÂç·þÎñÆ÷»òÕßÉõÖÁ²»ÓÃÍ£Ö¹Ó¦ÓóÌÐòµÄÔËÐоͿÉÒÔ¸üÐÂÓ¦ÓÃÎļþ¡£Ó¦ÓóÌÐòÎļþÓÀÔ¶²»»á±»¼ÓËø£¬Òò´ËÉõÖÁÔÚ³ÌÐòÔËÐÐʱÎļþ¾Í¿ÉÒÔ±»¸²¸Ç£¬µ±Îļþ¸üкó£¬ÏµÍ³»áκ͵Øת»»µ½Ðµİ汾£»
¡ñASP.NET²ÉÈ¡"CodeBehind(´úÂë·ÖÀë)¼¼Êõ"·½Ê½±àд´úÂëʹµÃ´úÂë¸üÒ×ÓÚ±àд£¬½á¹¹¸üÇåÎú£¬½µµÍÁËϵͳ¿ª·¢Óëά»¤µÄ¸´ÔӶȺͷÑÓá£
1Ñо¿±³¾°
1.1 ¹úÄÚÍâÑо¿ÏÖ×´¼°·¢Õ¹Ç÷ÊÆ[5]
´«Í³µÄÍøÕ¾ÐÂÎŹÜÀí·½Ê½ÓÐÁ½ÖÖ[7][10]£ºÒ»ÖÖÊǾ²Ì¬HTMLÒ³Ã棬¸üÐÂÐÅϢʱÐèÒªÖØÐÂÖÆ×÷Ò³ÃæÈ»ºóÉÏ´«Ò³Ãæ²¢ÐÞ¸ÄÏàÓ¦Á´½Ó£¬ÕâÖÖ·½Ê½ÒòΪЧÂÊÌ«µÍÒѲ»¶àÓã»ÁíÒ»ÖÖÊÇ»ùÓÚASPºÍ½Å±¾ÓïÑÔ£¬½«¶¯Ì¬ÍøÒ³ºÍÊý¾Ý¿â½áºÏ£¬Í¨¹ýÓ¦ÓóÌÐòÀ´´¦ÀíÐÂÎÅ£¬ÕâÊÇÄ¿Ç°½ÏΪÁ÷ÐеÄ×ö·¨¡£µ«ÊÇÓÉÓÚASP¼¼Êõ±¾ÉíµÄ¾ÖÏÞÐÔʹµÃϵͳÓÐһЩ²»¿É¿Ë·þµÄȱÏÝ¡£
ASP.NET²»½ö½öÊÇÏÂÒ»°æ±¾µÄASP(Active Server Pages£¬¶¯Ì¬·þÎñÆ÷Ò³Ãæ)£¬¶øÇÒÊǽ¨Á¢¶¯Ì¬WebÓ¦ÓóÌÐò¶øÖØдòÔìµÄȫм¼Êõ£¬ÆäÖ÷ÒªÌØÉ«°üÀ¨£º
¡ñ ÓïÑԵĶÀÁ¢ÐÔ£»
¡ñ ¼òµ¥µÄ¿ª·¢²Ù×÷£¬·ÖÀë³ÌÐò´úÂëºÍÍøÒ³ÄÚÈÝ£»
¡ñ Ìá¸ßÁËÖ´ÐÐЧÂÊ£»
¡ñ ¼ò»¯²¿ÊðÓë×é̬µÄ²Ù×÷£»
¡ñ Ö§³Ö¿Í»§¶ËÀàÐÍ£»
¡ñ Ö§³ÖÏÂÒ»´úµÄWeb·þÎñ£»
¡ñ Ôö½øÊÊÓÃÐÔ£»
¡ñ Ôö½øÑÓÕ¹ÐÔ£»
¡ñ ¸ü¶àµÄÖ§³Ö¹¤¾ß£»
¡ñ ¸ü¼ÑµÄ°²È«»úÖÆ£»
¡ñ »á»°(Session)¿ÉÒÔ¿ç½ø³Ì¡¢¿ç»úÆ÷¡£
ÓÉÓÚASP.NETµÄÖÚ¶àÓŵ㣬¼¼Êõ·¢Õ¹ºÍ¸÷Öֿ͹Ûʵ¼ÊµÄÐèÒª£¬¸ÃϵͳѡÓÃÁËASP.NETÀ´¿ª·¢Éè¼Æ£¬ÊµÏÖÁ˶ÔУ԰ÐÂÎŵĶ¯Ì¬¹ÜÀí²Ù×÷£¬Ê¹µÃ¶ÔÐÂÎÅÐÅÏ¢µÄ·¢²¼Óë¹ÜÀí¸ü¼Ó¼°Ê±¡¢¸ßЧ£¬Ìá¸ßÁ˹¤×÷ЧÂÊ¡£
1.2 Ñо¿Ä¿µÄ¡¢ÒâÒåºÍ·¶Î§
Ëæ×ÅInternetµÄÆÕ¼°£¬Ô½À´Ô½¶àµÄÆóÒµ½¨Á¢ÁË×Ô¼ºµÄWWWÍøÕ¾£¬Æóҵͨ¹ýÍøÕ¾¿ÉÒÔչʾ²úÆ·£¬·¢²¼×îж¯Ì¬ÐÅÏ¢£¬ÓëÓû§½øÐн»Á÷ºÍ¹µÍ¨£¬ÓëºÏ×÷»ï°é½¨Á¢ÁªÏµ£¬ÒÔ¼°¿ªÕ¹µç×ÓÉÌÎñµÈ¡£
ÆäÖÐÐÂÎŹÜÀíϵͳÊǹ¹³ÉÆóÒµÍøÕ¾µÄÒ»¸öÖØÒª×é³É²¿·Ö£¬Ëüµ£¸º×ÅË«²ã×÷Óãº
Ò»·½Ãæ¿ÉÒÔÓÃÀ´¶¯Ì¬·¢²¼ÓйØвúÆ·»òпª·¢ÏîÄ¿£»
ÁíÒ»·½ÃæÓÖ¿ÉÒÔ¼°Ê±Ïò¹Ë¿Í¹«¸æÆóÒµ¾ÓªÒµ¼¨¡¢¼¼ÊõÓëÑз¢½øÕ¹¡¢ÌرðÍƼö»òÓŻݵŤ³ÌÏîÄ¿¡¢²úÆ·ºÍ·þÎñ£¬´Ó¶øÎüÒý¹Ë¿Í£¬À©´ó¹Ë¿ÍȺ¡£
¸ÃϵͳʹÓÃASP.NET(C#ÓïÑÔ)ºÍADO.NET¼¼Êõ¿ª·¢, ʵÏÖÁËÍøÕ¾ÐÂÎŵĶ¯Ì¬¹ÜÀí£¬Ê¹µÃ¶ÔÐÅÏ¢µÄ¹ÜÀí¸ü¼Ó¼°Ê±¡¢¸ßЧ£¬Ìá¸ßÁ˹¤×÷ЧÂÊ¡£¸ÃÐÂÎÅϵͳ¾ßÓÐÒ»°ãÐÂÎÅϵͳµÄ¹¦ÄÜ£¬Ö÷Òª°üÀ¨Ç°Ì¨ÐÂÎŲ鿴ÇøºÍºǫ́¹ÜÀíÇø£¬¿ÉΪѧУ¸÷²¿ÃÅ·¢²¼ÐÂÎÅ£¬ÎªÐ£Ô°ÍøÕ¾ÌṩÐÂÎÅ·¢²¼Óë¹ÜÀíµÄ·þÎñ¡£
¸ÃϵͳÊÇ»ùÓÚB/S(Browser/Server£¬ä¯ÀÀÆ÷/¿Í»§¶Ë)ģʽʵÏÖ£¬»ùÓÚ.NETƽ̨¼Ü¹¹¿ª·¢Éè¼Æ£¬Ö÷ҪʵÏÖ¶ÔУ԰ÐÂÎŵķ¢²¼Óë¹ÜÀí¹¦ÄÜ£¬¶ÔÐÂÎÅÄÚÈÝÐÅÏ¢µÄä¯ÀÀÔĶÁµÈ¡£ Ëæ×ÅInternet/Intranet¼¼ÊõµÄÐËÆ𣬽«Ô±¾ÔÚµ¥»ú»ò±¾µØ¾ÖÓòÍøÉÏÔËÐеÄÊý¾Ý¿âϵͳÒÆÖ²µ½ÒòÌØÍøÖУ¬¼´¿ª·¢»ùÓÚB/SģʽµÄÐÂÒ»´úMIS£¨Management Information System£¬¹ÜÀíÐÅϢϵͳ£©ÏµÍ³£¬Õý³ÉΪ¼¼Êõ·¢Õ¹µÄÇ÷ÊÆ¡£ÎªÁ˱£Ö¤ÏµÍ³ÐÔÄܵĸßЧÐÔ¡¢¿ÉÀ©Õ¹ÐÔ£¬ÒÔ¼°´ïµ½Êý¾Ý¹²ÏíºÍÍøÂ绯¹ÜÀíµÄÄ¿µÄ£¬±¾ÏµÍ³²ÉÓÃB/SÌåϵ½á¹¹½øÐÐÉè¼Æ¿ª·¢¡£