asp.netÃæÊÔÌâ(5)
61.²úÉúÒ»¸öintÊý×飬³¤¶ÈΪ100£¬²¢ÏòÆäÖÐËæ»ú²åÈë1-100£¬²¢ÇÒ²»ÄÜÖظ´¡£
int[] intarr=new int[100];
arraylist mylist=new arraylist();
random rnd=new random();
while(mylist.count<100)
{
int num=rnd.next(1,101);
if(!mylist.contains(num))
mylist.add(num);
}
for(int i=0;i<100;i++)
intarr[i]=(int)mylist[i];
62.Çë˵Ã÷ÔÚ.netÖг£Óõļ¸ÖÖÒ³Ãæ¼ä´«µÝ²ÎÊýµÄ·½·¨£¬²¢Ëµ³öËûÃǵÄÓÅȱµã¡£
´ð£ºsession(viewstate) ¼òµ¥£¬µ«Ò׶ªÊ§
application È«¾Ö
cookie ¼òµ¥£¬µ«¿ÉÄܲ»Ö§³Ö£¬¿ÉÄܱ»Î±Ôì
input ttype="hidden" ¼òµ¥£¬¿ÉÄܱ»Î±Ôì
url²ÎÊý ¼òµ¥£¬ÏÔʾÓÚµØÖ·À¸£¬³¤¶ÈÓÐÏÞ
Êý¾Ý¿â Îȶ¨£¬°²È«£¬µ«ÐÔÄÜÏà¶ÔÈõ
63.ÇëÖ¸³ögacµÄº¬Ò壿
´ð£ºÈ«¾Ö³ÌÐò¼¯»º´æ¡£
64.Ïò·þÎñÆ÷·¢ËÍÇëÇóÓм¸ÖÖ·½Ê½£¿
´ð£ºget,post¡£getÒ»°ãΪÁ´½Ó·½Ê½£¬postÒ»°ãΪ°´Å¥·½Ê½¡£
65.datareaderÓëdatasetÓÐʲôÇø±ð£¿
´ð£ºÒ»¸öÊÇÖ»ÄÜÏòÇ°µÄÖ»¶ÁÓα꣬һ¸öÊÇÄÚ´æÖÐµÄ±í¡£
66.Èí¼þ¿ª·¢¹ý³ÌÒ»°ãÓм¸¸ö½×¶Î£¿Ã¿¸ö½×¶ÎµÄ×÷Óã¿
´ð£ºÐèÇó·ÖÎö£¬¼Ü¹¹Éè¼Æ£¬´úÂë±àд£¬qa£¬²¿Êð
67.ÔÚc#ÖÐusingºÍnewÕâÁ½¸ö¹Ø¼ü×ÖÓÐʲôÒâÒ壬Çëд³öÄãËùÖªµÀµÄÒâÒ壿using Ö¸Áî ºÍÓï¾ä new ´´½¨ÊµÀý new Òþ²Ø»ùÀàÖз½·¨¡£
´ð£ºusing ÒýÈëÃû³Æ¿Õ¼ä»òÕßʹÓ÷ÇÍйÜ×ÊÔ´
new н¨ÊµÀý»ò
Ïà¹ØÎĵµ£º
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.Attribute ......
¿ÉÒÔʹÓà ISAPI ɸѡÆ÷ÔÚ IIS Web ·þÎñÆ÷¼¶±ðʵÏÖ URL ÖØд£¬Ò²¿ÉÒÔʹÓà HTTP Ä£¿é»ò HTTP ´¦Àí³ÌÐòÔÚ
ASP.NET ¼¶±ðʵÏÖ URL ÖØд¡£±¾ÎÄÖصã½éÉÜÈçºÎʹÓà ASP.NET ʵÏÖ URL ÖØд£¬Òò´ËÎÒÃǽ«²»¶ÔʹÓà ISAPI ɸѡÆ÷ʵÏÖ
URL ÖØдµÄϸ½Ú½øÐÐÉîÈë̽ÌÖ¡£µ«ÊÇ£¬ÓдóÁ¿µÄµÚÈý·½ ISAPI ɸѡÆ÷¿ÉÓÃÓÚ URL ÖØд£¬ÀýÈ磺 ......
1.//µ¯³ö¶Ô»°¿ò.µã»÷תÏòÖ¸¶¨Ò³Ãæ
Response.Write(" <script>window.alrt('¸Ã»áԱûÓÐÌá½»ÉêÇë,ÇëÖØÐÂÌá½»£¡') </script>"); Response.Write(" <script>window.loation='http://www.cnblogs.com/kevin1031" target="_blank">http://www.cnblogs.com/kevin1031' </script>");
2.//µ¯³ö¶Ô»°¿ ......
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
asp.net ʵÏÖ¶¨Ê±Ö´ÐÐ Ò»¸ö·½·¨
public class Time_Task
{
public event System.Timers.ElapsedEventHandler ExecuteTask;
private static readonly Time_Task _task = null;
private System.Timers.Timer _timer = null;
privat ......