asp.netÖÐapp_codeºÍbinÎļþ¼Ð½éÉÜ
Èç¹ûÄúµÄ Web Ó¦ÓóÌÐò°üÀ¨ÒªÔÚ¶à¸öÒ³Ö®¼ä¹²ÏíµÄ´úÂ룬Äú¿ÉÒÔ½«´úÂë±£´æÔÚ Web Ó¦ÓóÌÐò¸ùĿ¼ÏµÄÁ½¸öÌØÊâÎļþ¼Ð£¨Bin Îļþ¼ÐºÍ App_Code Îļþ¼Ð£©ÖеÄij¸öÎļþ¼ÐÖС£
Bin Îļþ¼Ð
¿ÉÒÔÔÚ Bin Îļþ¼ÐÖд洢±àÒëµÄ³ÌÐò¼¯£¬²¢ÇÒ Web Ó¦ÓóÌÐòÈÎÒâ´¦µÄÆäËû´úÂ루ÈçÒ³´úÂ룩»á×Ô¶¯ÒýÓøÃÎļþ¼Ð¡£µäÐ͵ÄʾÀýÊÇÄúΪ×Ô¶¨ÒåÀà±àÒëºÃµÄ´úÂë¡£Äú¿ÉÒÔ½«±àÒëºóµÄ³ÌÐò¼¯¸´ÖƵ½ Web Ó¦ÓóÌÐòµÄ Bin Îļþ¼ÐÖУ¬ÕâÑùËùÓÐÒ³¶¼¿ÉÒÔʹÓÃÕâ¸öÀà¡£
Bin Îļþ¼ÐÖеijÌÐò¼¯ÎÞÐè×¢²á¡£Ö»Òª .dll Îļþ´æÔÚÓÚ Bin Îļþ¼ÐÖУ¬ASP.NET ¾Í¿ÉÒÔʶ±ðËü¡£Èç¹ûÄú¸ü¸ÄÁË .dll Îļþ£¬²¢½«ËüµÄа汾дÈëµ½ÁË Bin Îļþ¼ÐÖУ¬Ôò ASP.NET »á¼ì²âµ½¸üУ¬²¢¶ÔËæºóµÄÐÂÒ³ÇëÇóʹÓÃа汾µÄ .dll Îļþ¡£
Bin Îļþ¼ÐµÄ°²È«ÐÔ
½«±àÒëºóµÄ³ÌÐò¼¯·ÅÈë Bin Îļþ¼ÐÖлá´øÀ´°²È«·çÏÕ¡£Èç¹ûÊÇÄú×Ô¼º±àдºÍ±àÒëµÄ´úÂ룬ÄÇôÄúÁ˽â´úÂëµÄ¹¦ÄÜ¡£µ«ÊÇ£¬Äú±ØÐëÏñ¶Ô´ýÈκοÉÖ´ÐдúÂëÒ»ÑùÀ´¶Ô´ý Bin Îļþ¼ÐÖÐÒѱàÒëµÄ´úÂë¡£ÔÚÍê³É´úÂë²âÊÔ²¢È·ÐÅÒÑÁ˽â´úÂ빦ÄÜ֮ǰ£¬Òª¶ÔÒѱàÒëµÄ´úÂë±£³Ö½÷É÷µÄ̬¶È¡£
Çë×¢ÒâÒÔÏ°²È«·½ÃæµÄ֪ʶ£¬ÕâЩ֪ʶÓëÊÇ·ñ½«ÒѱàÒëµÄ´úÂë·ÅÈë Bin Îļþ¼ÐÓйأº
Bin Îļþ¼ÐÖгÌÐò¼¯µÄ×÷Ó÷¶Î§Îªµ±Ç°Ó¦ÓóÌÐò¡£Òò´Ë£¬ËüÃÇÎÞ·¨·ÃÎʵ±Ç° Web Ó¦ÓóÌÐòÖ®ÍâµÄ×ÊÔ´»òµ÷Óõ±Ç° Web Ó¦ÓóÌÐòÖ®ÍâµÄ´úÂë¡£
ÔËÐÐʱ£¬³ÌÐò¼¯µÄ·ÃÎʼ¶±ðÓɱ¾µØ¼ÆËã»úÉÏÖ¸¶¨µÄÐÅÈ춱ðÈ·¶¨¡£Óйظü¶àÐÅÏ¢£¬Çë²Î¼û ASP.NET ÐÅÈ춱ðºÍ²ßÂÔÎļþ¡£
Èç¹ûÄúʹÓÃÁËÖîÈç Visual Studio ÕâÑùµÄÉè¼ÆÆ÷£¬ÄÇô Bin Îļþ¼ÐÖеĴúÂëÔËÐÐËùÔÚµÄÉÏÏÂÎÄÓëÔËÐÐʱ²»Í¬¡£ÀýÈ磬´úÂë¿ÉÄÜÒÔÍêÈ«ÐÅÈÎ״̬ÔËÐС£
App_Code Îļþ¼Ð
¿ÉÒÔÔÚ App_Code Îļþ¼ÐÖд洢Դ´úÂ룬ÔÚÔËÐÐʱ½«»á×Ô¶¯¶ÔÕâЩ´úÂë½øÐбàÒë¡£Web Ó¦ÓóÌÐòÖеÄÆäËûÈκδúÂ붼¿ÉÒÔ·ÃÎʲúÉúµÄ³ÌÐò¼¯¡£Òò´Ë£¬App_Code Îļþ¼ÐµÄ¹¤×÷·½Ê½Óë Bin Îļþ¼ÐºÜÀàËÆ£¬²»Í¬Ö®´¦ÊÇÄú¿ÉÒÔÔÚÆäÖд洢Դ´úÂë¶ø·ÇÒѱàÒëµÄ´úÂë¡£App_Code Îļþ¼Ð¼°ÆäÔÚ ASP.NET Web Ó¦ÓóÌÐòÖеÄÌØÊâµØλʹÄú¿ÉÒÔ´´½¨×Ô¶¨ÒåÀàºÍÆäËû½öÔ´´úÂëÎļþ£¬²¢ÔÚ Web Ó¦ÓóÌÐòÖÐʹÓÃËüÃǶø²»±Øµ¥¶À¶ÔËüÃǽøÐбàÒë¡£
App_Code Îļþ¼Ð¿ÉÒÔ°üº¬ÒÔ´«Í³ÀàÎļþ£¨¼´´øÓÐ .vb¡¢.cs µÈÀ©Õ¹ÃûµÄÎļþ£©µÄÐÎʽ±àдµÄÔ´´úÂëÎ
Ïà¹ØÎĵµ£º
Request¶ÔÏó¹¦ÄÜÊÇ´Ó¿Í»§¶ËµÃµ½Êý¾Ý£¬³£ÓõÄÈýÖÖÈ¡µÃÊý¾ÝµÄ·½·¨ÊÇ£ºRequest.Form¡¢Request.QueryString£¬Request¡£ÆäµÚÈýÖÖÊÇÇ°Á½ÖÖµÄÒ»¸öËõд£¬¿ÉÒÔÈ¡´úÇ°Á½ÖÖÇé¿ö¡£¶øÇ°Á½ÖÖÖ÷Òª¶ÔÓ¦µÄFormÌύʱµÄÁ½ÖÖ²»Í¬µÄÌá½»·½·¨£º·Ö±ðÊÇPost·½·¨ºÍGet·½·¨¡£
Request ¶ÔÏóµÄÊôÐԺͷ½·¨± ......
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå" ......
Ò»¡¢Page Àà
Page ÀàÓëÀ©Õ¹ÃûΪ .aspx µÄÎļþÏà¹ØÁª£»ÕâЩÎļþÔÚÔËÐÐʱ±»±àÒëΪ Page ¶ÔÏ󣬲¢±»»º´æÔÚ·þÎñÆ÷ÄÚ´æÖС£Èç¹ûÊÇʹÓôúÂëÒþ²Ø¼¼Êõ´´½¨ Web ´°ÌåÒ³£¬Çë´Ó¸ÃÀàÅÉÉú¡£
Àý£º£¨public partial class _Default : System.Web.UI.Page£©
Page ¶ ......
дͼƬc:\1.jpgµ½±ícinfoÖÐ
private static void AddCinfo()
{
string strSql = "insert into cinfo (srvtitle,csttitle,introduction,logo) values
(@srvtitle,@csttitle,@introduction,@logo)";
S ......