asp.net»ñÈ¡¿Í»§¶ËµÄMACµØÖ·
asp.net»ñÈ¡¿Í»§¶ËµÄMACµØÖ·¡²Ö»ÊÊÓÃÓÚ¾ÖÓòÍø¡³
[ת]http://www.cnblogs.com/scgw/archive/2008/08/01/1213951.html
½üÈÕÔÚ×öÒ»¸öͶƱϵͳÖÐÓÐÕâÑùÒ»¸öÐèÇó£ºÎªÁË·ÀÖ¹¶ñÒâÀƱ»òˢƱ£¬ÐèҪͨ¹ýÔ¶³Ì¿Í»§¶ËµÄIPµØÖ·
À´»ñÈ¡¿Í»§¶ËÍø¿¨µÄMACµØÖ·¡£ÍíÉÏÕÒÁ˺ܶà×ÊÁÏ£¬ÖÕÓÚÓеãÊÕ»ñ¡£
ÈçºÎÈ¡µÃÍø¿¨macµØÖ·£¬¾Í²»µÃ²»½²µ½dosÃüÁNBTSTAT£¬ÏÂÃæ¼òµ¥½éÉÜÏ£º
1. ¾ßÌ幦ÄÜ
¡¡¡¡¸ÃÃüÁîÓÃÓÚÏÔʾ±¾µØ¼ÆËã»úºÍÔ¶³Ì¼ÆËã»úµÄ»ùÓÚ TCP/IP(NetBT) ÐÒéµÄ NetBIOS ͳ¼Æ×ÊÁÏ¡¢ NetBIOS Ãû³Æ±íºÍ NetBIOS Ãû³Æ»º´æ¡£ NBTSTAT ¿ÉÒÔˢРNetBIOS Ãû³Æ»º´æºÍ×¢²áµÄ Windows Internet Ãû³Æ·þÎñ (WINS) Ãû³Æ¡£Ê¹Óò»´ø²ÎÊýµÄ NBTSTAT ÏÔʾ°ïÖú¡£
2. Óï·¨Ïê½â
nbtstat [-a remotename] [-A IPaddress] [-c] [-n] [-r] [-R] [-RR] [-s] [-S] [Interval]
3. ²ÎÊý˵Ã÷
-a remotename ÏÔʾԶ³Ì¼ÆËã»úµÄ NetBIOS Ãû³Æ±í£¬ ÆäÖУ¬ remote name ÊÇÔ¶³Ì¼ÆËã»úµÄ NetBIOS ¼ÆËã»úÃû³Æ¡£ NetBIOS Ãû³Æ±íÊÇÔËÐÐÔڸüÆËã»úÉϵÄÓ¦ÓóÌÐòʹÓÃµÄ NetBIOS Ãû³ÆÁÐ±í¡£
-A IPaddress ÏÔʾԶ³Ì¼ÆËã»úµÄ NetBIOS Ãû³Æ±í£¬ ÆäÃû³ÆÓÉÔ¶³Ì¼ÆËã»úµÄ IP µØÖ·Ö¸¶¨ ( ÒÔСÊýµã·Ö¸ô ) ¡£
-c ÏÔʾ NetBIOS Ãû³Æ»º´æÄÚÈÝ¡¢ NetBIOS Ãû³Æ±í¼°Æä½âÎöµÄ¸÷¸öµØÖ·¡£
-n ÏÔʾ±¾µØ¼ÆËã»úµÄ NetBIOS Ãû³Æ±í¡£ Registered ÖеÄ״̬±íÃ÷¸ÃÃû³ÆÊÇͨ¹ý¹ã²¥»ò WINS ·þÎñÆ÷×¢²áµÄ¡£
-r ÏÔʾ NetBIOS Ãû³Æ½âÎöͳ¼Æ×ÊÁÏ¡£ ÔÚÅäÖÃΪʹÓà WINS µÄ Windows ¼ÆËã»úÉÏ£¬¸Ã²ÎÊý½«·µ»ØÒÑͨ¹ý¹ã²¥ºÍ WINS ½âÎöºÍ×¢²áµÄÃû³ÆºÅÂë¡£
-R Çå³ý NetBIOS Ãû³Æ»º´æµÄÄÚÈݲ¢´Ó Lmhosts ÎļþÖÐÖØÐ¼ÓÔØ´øÓÐ #PRE ±ê¼ÇµÄÏîÄ¿¡£
-RR ÖØÐÂÊͷŲ¢Ë¢ÐÂͨ¹ý WINS ×¢²áµÄ±¾µØ¼ÆËã»úµÄ NetBIOS Ãû³Æ¡£
-s ÏÔʾ NetBIOS ¿Í»§ºÍ·þÎñÆ÷»á»°£¬²¢ÊÔͼ½«Ä¿±ê IP µØÖ·×ª»¯ÎªÃû³Æ¡£
-S ÏÔʾ NetBIOS ¿Í»§ºÍ·þÎñÆ÷»á»°£¬Ö»Í¨¹ý IP µØÖ·ÁгöÔ¶³Ì¼ÆËã»ú¡£
¡¡¡¡Interval ÖØÐÂÏÔʾѡÔñµÄͳ¼Æ×ÊÁÏ£¬¿ÉÒÔÖжÏÿ¸öÏÔʾ֮¼äµÄ Interval ÖÐÖ¸¶¨µÄÃëÊý¡£ °´Ctrl+C Í£Ö¹ÖØÐÂÏÔʾͳ¼ÆÐÅÏ¢¡£Èç¹ûÊ¡ÂԸòÎÊý£¬ NBTSTAT ½«Ö»ÏÔʾһ´Îµ±Ç°µÄÅäÖÃÐÅÏ¢¡£
ÎÒÃÇÊÔÏÂËüµÄ¹¦ÄÜ£ºÔÚDOS´°¿ÚÏ£¬ÊäÈ룺
nbtstat -a 192.168.168.242
ÕâÀïµÄ192.168.168.242ÊÇÎҵı¾»úIP,²âÊÔÖз¢ÏÖ´ô»áµÄ³ÌÐò²¢²»ÄÜÈ¡µÃ·Ç±¾µØµÄmacµØÖ·£¬Ò²¾ÍÊÇ˵ֻÄÜÈ¡µÃ·þÎñÆ÷µÄÍø¿¨macµØÖ·£¬¶ø²»ÄÜÈ¡µÃ¿Í»§¶ËµÄÍø¿¨macµØÖ·£
Ïà¹ØÎĵµ£º
Eval( " ")ºÍBind( " ")¡¡ÕâÁ½ÖÖÒ»¸öµ¥Ïò°ó¶¨£¬Ò»¸öË«Ïò°ó¶¨
bindÊÇË«Ïò°ó¶¨,µ«ÐèÊý¾ÝÔ´¿É¸ü¸Ä²ÅÄÜÓÃ
ASP.NET 2.0¸ÄÉÆÁËÄ£°åÖеÄÊý¾Ý°ó¶¨²Ù×÷£¬°Ñv1.xÖеÄÊý¾Ý°ó¶¨Óï·¨DataBinder.Eval(Container.DataItem, fieldname)¼ò»¯ÎªEval(fieldname)¡£Eval·½·¨ÓëDataBinder.EvalÒ»Ñù¿ÉÒÔ½ÓÊÜÒ»¸ö¿ÉÑ¡µÄ¸ñʽ»¯×Ö·û´®²ÎÊý¡£Ëõ¶ÌµÄEv ......
Ó°ÏìASP.NetÓ¦ÓÃÐÔÄܵÄÅäÖÃ
1¡¢É¾³ý²»±ØÒªµÄHttpModule£¬Ã¿Ôö¼ÓÒ»¸öHttpModule£¬Ã¿¸öÇëÇó´¦Àí¾Í¶àÒ»µã¿ªÏú¡£
È磺
<httpModules>
& ......
1¡¢DateTime Êý×ÖÐÍ
System.DateTime currentTime=new System.DateTime();
¡¡¡¡1.1 È¡µ±Ç°ÄêÔÂÈÕʱ·ÖÃë
currentTime=System.DateTime.Now;
¡¡¡¡1.2 È¡µ±Ç°Äê
int Äê=currentTime.Year;
¡¡¡¡1.3 È¡µ±Ç°Ô &n ......
·½·¨Ò»:
н¨Ò»¸öÒ³ÃæÈ»ºóÔÚÒ³ÃæÍÏÒ»¸öGridView¿Ø¼þÔÚÊôÐÔ¿òÖÐÉèÖÃGridView¿Ø¼þµÄAllowPaingÊôÐÔΪTrue È»ºóÔÙÉèÖÃGridViewµÄPageSizeÊôÐÔ,Ô´ÎļþÈçÏÂ:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames ="classId" CellPadding="5" OnRowDeleting="GridView1_RowDeleting" All ......
Çмǣ¬ÇÐ¼Ç DateTime.Now.Date.ToString("yyyyÄêMMÔÂddÈÕ"); //MM Òª´óд£¬·ñÔò»áÊÇ00,²»ÊÇÕæÊµµÄÔÂ·Ý private void getDate()
{
date.Text = DateTime.Now.Date.ToString("yyyyÄêMMÔÂddÈÕ"); //Õâ¸öËæÒâµÄ£ºyyyy-MM-dd Ò²¿ÉÒÔ
string Temp="";
switch (DateTime.Now.DayOfWeek)
{
case DayO ......