ÈçºÎʹÓÃASP.NET Profile
Asp.NetÖÐÓÐÒ»Ì×ÓëÓû§Ïà¹ØÁªµÄÊôÐÔÉèÖ㬿ÉÒÔͨ¹ýÔÚWebConfigÀïÅäÖÃÀ´Ö±½ÓʹÓã¬ËûµÄ×÷ÓÃΪ
´æ´¢ºÍʹÓÃΨһÓëÓû§¶ÔÓ¦µÄÐÅÏ¢
Õ¹ÏÖ¸öÈË»¯°æ±¾µÄWebÓ¦ÓóÌÐò
Óû§µÄΨһÉí·Ý±êʶÔÚÔٴηÃÎÊʱʶ±ðÓû§
Asp.Net ProfileÌṩµÄ¸úÓû§Ïà¹ØµÄÀàÐͶ¼ÊÇÇ¿ÀàÐÍ
Ê×ÏÈÉú³ÉÊý¾Ý¿â½Å±¾£¬Ê¹ÓÃVisual Studio 2005 ÃüÁîÌáʾ£¬ÊäÈëÃüÁîÐÐaspnet_regsql -A p -sqlexportonly filename
-A£º±íÃ÷Ôö¼ÓÒ»¸öÊý¾Ý¿â
p£º±íÃ÷Éú³ÉµÄÊÇProfileµÄÊý¾Ý¿â
-sqlexportonly£º±íÃ÷Êǵ¹³ösql½Å±¾£¬ÓÃÆäËû²ÎÊý¿ÉÒÔÖ±½Ó´´½¨Êý¾Ý¿â£¬¾ßÌåµÄ˵Ã÷¿ÉÒԲο´aspnet_regsqlµÄ°ïÖú˵Ã÷
filename£º±£´æµÄÎļþÃûºÍ ·¾¶
ÏÖÔÚÊý¾Ý¿â´´½¨ºÃÁË£¬ÀïÃæÓÐ4Õűíaspnet_ApplicationÓÃÀ´´æ´¢Ó¦ÓóÌÐòµÄÏà¹ØÀàÐÍ£¬aspnet_ProfileÓÃÀ´±£´æÓû§µÄÊôÐÔÐÅÏ¢£¬aspnet_SchemaVersionÓÃÀ´´æ´¢°æ±¾ÐÅÏ¢£¬aspnet_UserÓÃÀ´±£´æÓû§ÐÅÏ¢¡£¿ÉÒÔ´ÓÕ⼸Õűí¿ÉÒÔ¿´µ½£¬¶à¸öÓ¦ÓóÌÐò¿ÉÒÔÓÃͬһ¸öÊý¾Ý¿âÀ´±íʾÓû§ÐÅÏ¢¡£
ÏÂÃæÊÇÈçºÎÀ´ÅäÖÃWebConfigÀ´Ö§³ÖProfile
Ê×ÏÈÅäÖÃÁ¬½Ó×Ö·û´®
<connectionStrings>
<add name="ProfileDatabase" connectionString="Server=192.168.1.2; Initial Catalog=aspnetdb; User ID=sa; Password=sa"/>
</connectionStrings>
È»ºóÔÚsystem.web½ÚµãÏÂÌí¼Óprofile½Úµã
<profile enabled="true" automaticSaveEnabled="true" defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ProfileDatabase"
applicationName="ProfileSample"
description="Sample for ASP.NET profile and Profile Service" />
</providers>
<properties>
<add name="Name" type="System.String"/>
<add name="Email" type="System.String" />
<add name="Age" type="System.Int32" />
<group name="Address">
<add name="City" type="System.String" />
<add name="Street" type="System.String" />
<add name="PostalCode" type="System.String" />
</group>
</properties>
</profile>
²âÊԳɹ¦µÄÅäÖÃ
<profile enabled="true" automaticSaveEnabled="true" defaultProvider="SqlProvider" >
 
Ïà¹ØÎĵµ£º
Request¶ÔÏó¹¦ÄÜÊÇ´Ó¿Í»§¶ËµÃµ½Êý¾Ý£¬³£ÓõÄÈýÖÖÈ¡µÃÊý¾ÝµÄ·½·¨ÊÇ£ºRequest.Form¡¢Request.QueryString£¬Request¡£ÆäµÚÈýÖÖÊÇÇ°Á½ÖÖµÄÒ»¸öËõд£¬¿ÉÒÔÈ¡´úÇ°Á½ÖÖÇé¿ö¡£¶øÇ°Á½ÖÖÖ÷Òª¶ÔÓ¦µÄFormÌύʱµÄÁ½ÖÖ²»Í¬µÄÌá½»·½·¨£º·Ö±ðÊÇPost·½·¨ºÍGet·½·¨¡£
Request ¶ÔÏóµÄÊôÐԺͷ½·¨± ......
×î½ü×ö±£´æÔ¶³ÌͼƬʱºò£¬¾ÍÔÚ±£´æµÄʱºò×ÜÊdzöÕâ¸ö´íÎó£¬ÍøÉÏgoogleÁËһȦ£¬¶¼ÊÇÔÙ˵ȨÏÞÎÊÌ⣬ÎÊÌâÎÒÊÇÓÃUÅÌ£¬ÄÄÀïÓÐʲôȨÏÞÎÊÌâ¡£
×îºóÎÞÒâÖз¢ÏÖÁËÎÊÌâËùÔÚ
±£´æµÄʱºò²»ÄÜÓÃÏà¶Ô·¾¶£¬Ò»¶¨ÒªÓÃserver.mappath()´¦Àíһϱ£´æµÄ·¾¶¡£¡£¡£°¦£¡ ......
ÕâЩÄÚÈݱȽϼòµ¥£¬µ«ÊDZȽÏÈÝÒ×Íü¼Ç¡£ÌØдÏÂÀ´°ïÖú¼ÇÒ䣺£¨ÕâÀïÓõÄÊÇTreeViewºÍXmlDataSource°ó¶¨µÄÀý×Ó£©
µÚÒ»ÖÖ£º¶ÔÊôÐÔµÄÖµÖ±½Ó½øÐа󶨡£
Ê×ÏÈ £ºÀÒ»¸öTreeViewµ½Ò³ÃæÉÏ£¬IDÃüÃûΪ"TrvLeft"¡£È»ºóÔÚºǫ́½øÐа󶨣¬
´úÂëÈçÏ£º
XmlDataSource XmlDb = new Xml ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......