asp.net²Ù×÷ÅäÖÃÎļþ
ÓÉÓÚÏîÄ¿ÖжദÐèÒª¶ÔÅäÖÃÎļþ½øÐвÙ×÷£¬ÈçÅäÖÃÐÅÏ¢µÄ¶ÁÈ¡¡¢¸ü¸ÄºÍдÈ룬ÐèÒªÒ»¸öͨÓõÄÀàÀ´¶ÔÆä½øÐвÙ×÷ºÍ´¦Àí¡£Õâ´ÎµÄÈÎÎñ¾ÍÊÇÅäÖýڵÄһЩÓ÷¨¡£
Õâ´ÎÉý¼¶ºóµÄ¿ª·¢¹¤¾ßÊÇ»ùÓÚVS2005µÄ£¬·ÖÎöÁËVS2005 ÐÂÔöµÄһЩ¹¦ÄÜ£¬Ëü×Ô´øÁËÒ»Ì×ÅäÖÃÎļþÖнáµãµÈµÄÅäÖá£Ä¿Ç°µÄÏîÄ¿ÓõÄÅäÖÃÎļþ¶¼ÊÇϵͳ×Ô´øµÄ£¬Òò´Ë£¬Õâ´ÎµÄÈÎÎñÖ÷ÒªÊǶÔVS2005ÅäÖÃÀàµÄһЩ½éÉܼ°À©³ä£¨Óû§×Ô¶¨ÒåÅäÖýڵãµÄ²Ù×÷£©¡£ÈÎÎñ·ÖΪÁ½¸ö´ó·½Ïò£¬Ò»¸öÊÇÕë¶ÔWebÏîÄ¿£¨¶ÔÓ¦µÄÅäÖÃÎļþΪweb.config£©£¬ÁíÒ»¸öÊÇÕë¶ÔWinFormÏîÄ¿¡£ÏÂÃæµÄÕ½ÚÖ÷Òª¸ÅÒªµØ½éÉÜÒ»ÏÂVS2005ÖÐÅäÖÃÏîµÄÓ÷¨
1. Web 씀1.1 ϵͳ×Ô´ø
ÔÚVS2005ÖУ¬ÎÒÃÇ¿ÉÒÔͨ¹ýϵͳ×Ô´øµÄ¹ÜÀíÀàÀ´¶ÁÈ¡ºÍÐÞ¸ÄÏàÓ¦KeyËù¶ÔÓ¦µÄValueÖµ£¬¾ßÌåµÄ·½·¨ÈçÏ£¨×¢Ò⣺ÓÉÓÚkeyÊÇÖ®¶ÁÊôÐÔ£¬Òò´ËÖ»ÄÜÐÞ¸ÄÓëkeyÏà¶ÔÓ¦µÄValueÖµ£©£º
´«ÈëÏàÓ¦µÄKeyÖµ£¨ÈçTest£©£¬Í¨¹ýµ÷ÓÃConfigurationManager.AppSettings["Test"] .Value¼´¿É»ñµÃ¶ÔÓ¦µÄValueÖµ
1£© ´ò¿ªÅäÖÃÎļþ£¨Web.config£©
¡¡¡¡Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
2£© »ñÈ¡ÏàÓ¦µÄappSettingsÅäÖýÚ
¡¡ AppSettingsSection appSection = (AppSettingsSection)config.GetSection("appSettings");
3£© Ôö¼ÓÏàÓ¦µÄappSettingsÅäÖýÚ
¡¡ Ôö¼Ó Key – Value µÄ¼üÖµ¶Ô£¨Èç ”Test” – “Hello”£© appSection.Settings.Add("Test", "Hello");
4£© ±£´æÅäÖýÚ
config.Save(ConfigurationSaveMode.Modified)
1£© ´ò¿ªÅäÖÃÎļþ£¨Web.config£©
Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
2£© ´«ÈëKeyֵͨ¹ýµ÷ÓÃÏÂÃæ·½·¨À´»ñÈ¡¶ÔÓ¦µÄÖµ
Èç´«ÈëKeyΪTest²ÎÊýÀ´»ñÈ¡¶ÔÓ¦Öµ£ºwebConfig.AppSettings.Settings["Test"].Value
3£© ±£´æÅäÖýÚ
config.Save(ConfigurationSaveMode.Modified)
±£´æµÄ¹¹Ô캯ÊýÓÐÈýÖÖ£º
1¡¢²»´ø²ÎÊý
&
Ïà¹ØÎĵµ£º
ÔÚASP.NETÍøÕ¾ÖÐÍøÕ¾¹ÜÀíºǫ́ÐèÒª¾³£ÑéÖ¤Óû§Éí·Ý,ҪʵÏÖÕâÖÖ¹¦ÄܾͿÉÒÔÀûÓÃÄǸö¼Ì³Ð»úÖÆºÍASP.NETµÄʼþ»úÖÆ.Ê×Ïȶ¨ÒåÒ»¸öÐèÒª½øÐÐÉí·ÝÑéÖ¤µÄBasePageÀà,¼Ì³Ð×ÔPageÀà,ÔÚBasePageÀàµÄ¹¹Ô캯ÊýÖж¨ÒåËüµÄ¼ÓÔØÊ¼þµÄ´¦Àí´úÂë,ÕâÑùËùÓм̳Ð×ÔBasePageÀàµÄÒ³Ãæ¶¼ÄÜ×Ô¶¯Ö´ÐÐÉí·ÝÑéÖ¤.
/// <summary>
/// ÑéÖ¤ ......
1. ´Óhttp://sqlite.phxsoftware.com ÏÂÔØSystem.Data.SQLite.dll
2. ´Óhttp://www.sqlite.org/download.html ÏÂÔØ sqlite3.dll
3. Copy ÒÔÉÏ2¸öDllµ½Asp.netÍøÕ¾µÄbinĿ¼Ï£¬ÀàËÆ E:\2009work\MyWeb\Bin
4. ÓÃsqlitespy ¹¤¾ßн¨Êý¾Ý¿â£¬E:\2009work\MyWeb\App_Data\db.db3 £ ......
¡¡¡¡jQuery Ajax µ÷ÓÃAspx.Net WebService µÄ¼¸¸ö³£ÓÿÉÒÔÖ±½Ó¸´ÖÆ´úÂëÔËÐС£
¡¡¡¡ws.aspx ´úÂë
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runa ......
Ö§¸¶±¦µÄ½Ó¿Úµ÷Óúܲ»·½±ã£¬¸Õ×öºÃÒ»¸ö·â×°£¬ÊµÏÖÁËÐéÄâ½»Ò׺ÍʵÎï½»Òס£
½â¾ö·½°¸ÖÐÓÐÈý¸öÏîÄ¿ÒÔ¼°NDocÉú³ÉµÄÎĵµ£¬¼òµ¥µÄÐòÁÐͼ£ºCommonAliPay£¬·â×°µÄÖ§¸¶±¦½Ó¿Ú¡£
TestAli,asp.netµÄ²âÊÔÏîÄ¿
TestCommonAliPay£¬NunitµÄ²âÊÔÏîÄ¿¡£
µ÷Ó÷½·¨£º
1¡¢ÒýÈëCommonAliPay.dll
2¡¢ÊµÏÖÖ§¸¶±¦·þÎñ½Ó¿ÚµÄ·½·¨µ÷Ó÷½Ê½£º
......
using System;
using System.Text;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
& ......