ASP.netÖÐTimerºÍWebServiceµÄʹÓÃ
ʾÀýÒ»
ÔÚGlobal.asax.csÎļþÖУº
protected void Application_Start(Object sender, EventArgs e)
{
System.Timers.Timer timer1 = new System.Timers.Timer();
timer1.Interval = 50000; // 50000 ºÁÃë = 50Ãë
timer1.Elapsed += new System.Timers.ElapsedEventHandler(timer1_Elapsed);
timer1.AutoReset = true;
timer1.Enabled = true;
timer1.Start();
}
void timer1_Elapsed(object source, System.Timers.ElapsedEventArgs e)
{
// ÔÚÕâÀï¼ÓÉ϶ÁÈ¡Êý¾Ý¿âµÄ´úÂë¾Í¿ÉÒÔʵÏÖºǫ́·þÎñ¶¨Ê±·ÃÎÊÊý¾Ý¿âµÄ¹¦ÄÜ£¬¸Ã¹¦ÄܶÔÓÚʵÏÖÎļþ½â
//Ëø¡¢ÂÛ̳¶¨Ê±Í³¼ÆµÈºÜÓÐÓá£
}
ʾÀý¶þ
ͨ¹ýÔÚÍøÕ¾µÄGlobal.asaxµÄApplication_Start·½·¨ÖÐ
¼ÓÈ붨ʱÆ÷ ¶¨Ê±µ÷ÓÃWebService
¸ÃWebServiceµÄÒ»¸ö·½·¨ ¸ºÔðÔÚºǫ́
ÏòÊý¾Ý¿âµÄij¸ö±í¼ÓÈëÊý¾Ý
²½Ö裺
1.ͨ¹ýVS н¨Ò»¸öÍøÕ¾
2.¼ÓÈëGlobal
Ïà¹ØÎĵµ£º
µÚÒ»ÖÖ·½·¨£º
ͨ¹ýURLÁ´½ÓµØÖ·´«µÝ
send.aspx:
protected void Button1_Click(object sender, EventArgs e)
{
Request.Redirect("Default2.aspx?username=honge");
}
receive.aspx:
string user ......
/// <summary>
/// µÃµ½Õ¾µãÓû§IP
/// </summary>
/// <returns></returns>
public
static
string
getUserIP()
{
retu ......
http://www.chinaz.com/Program/.NET/101U1142006.html
¡¡¡¡1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QuerySt ......
ASP.NET ÅäÖýڼܹ¹°üº¬¿ØÖÆ ASP.NET Web Ó¦ÓóÌÐòÐÐΪµÄÔªËØ¡£Èç¹ûΪÊôÐÔÖ¸¶¨ÁËĬÈÏÖµ£¬Ôò¸ÃĬÈÏÖµÊÇÔÚ Machine.config ÎļþÖÐÉèÖõģ¬¸ÃÎļþµÄ·¾¶ÊÇ systemroot\Microsoft.NET\Framework\versionNumber\CONFIG\Machine.config¡£
<configuration>
<location>
......
substring
public String substring(int beginIndex)·µ»ØÒ»¸öеÄ×Ö·û´®£¬ËüÊÇ´Ë×Ö·û´®µÄÒ»¸ö×Ó×Ö·û´®¡£¸Ã×Ó×Ö·û´®Ê¼ÓÚÖ¸¶¨Ë÷Òý´¦µÄ×Ö·û£¬Ò»Ö±µ½´Ë×Ö·û´®Ä©Î²¡£
ÀýÈ磺
"unhappy".substring(2) returns "happy"
"Harbison".substring(3) returns "bison"
"emptiness".substring(9) returns "" (an empty string)
² ......