asp.netÈÕÖ¾
string path = "...\\Debug\\log.txt";
if (!File.Exists(path))
{
StreamWriter sw1;
sw1 = File.CreateText(path);
sw1.Close();
}
string str = System.DateTime.Now.Year.ToString() + "Äê" + System.DateTime.Now.Month.ToString() + "ÔÂ" + System.DateTime.Now.Day.ToString() + "ÈÕ " + System.DateTime.Now.Hour.ToString() + ":" + System.DateTime.Now.Minute.ToString() + ":" + System.DateTime.Now.Second.ToString() + " " + "Êý¾ÝWeb·þÎñÎÞ·¨·ÃÎÊ»òÕßÍøÂ粻ͨ. ";
StreamWriter sw = File.AppendText(path);
sw.WriteLine(str);
sw.Close();
return;
Ïà¹ØÎĵµ£º
1¡¢DateTime Êý×ÖÐÍ
System.DateTime currentTime=new System.DateTime();
¡¡¡¡1.1 È¡µ±Ç°ÄêÔÂÈÕʱ·ÖÃë
currentTime=System.DateTime.Now;
¡¡¡¡1.2 È¡µ±Ç°Äê
int Äê=currentTime.Year;
¡¡¡¡1.3 È¡µ±Ç°Ô &n ......
1.µ¯³ö¶Ô»°¿ò.
a. µ¯³ö¶Ô»°¿ò£º
C# codeClientScript.RegisterStartupScript(this.GetType(), "",
"<script>window.alert('¸Ã»áԱûÓÐÌá½»ÉêÇë,ÇëÖØÐÂÌá½»£¡')</script>");
b.תÏòÖ¸¶¨Ò³Ãæ
C# code Response.Write("
<script>window.location='http://www. ......
asp.net»ñÈ¡¿Í»§¶ËµÄMACµØÖ·¡²Ö»ÊÊÓÃÓÚ¾ÖÓòÍø¡³
[ת]http://www.cnblogs.com/scgw/archive/2008/08/01/1213951.html
½üÈÕÔÚ×öÒ»¸öͶƱϵͳÖÐÓÐÕâÑùÒ»¸öÐèÇó£ºÎªÁË·ÀÖ¹¶ñÒâÀƱ»òˢƱ£¬ÐèҪͨ¹ýÔ¶³Ì¿Í»§¶ËµÄIPµØÖ·
À´»ñÈ¡¿Í»§¶ËÍø¿¨µÄMACµØÖ·¡£ÍíÉÏÕÒÁ˺ܶà×ÊÁÏ£¬ÖÕÓÚÓеãÊÕ»ñ¡£
ÈçºÎÈ¡µÃÍø¿ ......
µÚÒ»£º
private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); } µÚ¶þ£º
private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.location.href=document.URL; < /script&g ......