Asp.NetÖÐÑéÖ¤Õý¹æÔò±í´ïʽ
using System.Text.RegularExpressions;
Regex reg = new Regex(@"^\d+$"); //ÑéÖ¤×Ö·û´®
Response.Write( reg.IsMatch(""));
Response.Write(reg.IsMatch("sf"));
Response.Write(reg.IsMatch("111a1"));
Response.Write(reg.IsMatch("3333333333"));
Ïà¹ØÎĵµ£º
ÔÚC#ÖÐ
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
using System.Collections.Generic;
using System.Collections;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.Ba ......
1. Web.configÖÐÌí¼Ó:
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
2. 頁ÃæÖÐÌí¼Ó:
<head>
<meta http-equiv="Content-Type" content="charset=utf-8&qu ......
1. ×¢²ájsº¯Êý
String scriptString = "<script language=JavaScript>function doClick(){";
scriptString += "for(var index=0;index<myArray.length;index++)";
scriptString += "alert(myArray[index]);}<";
scriptString += "/" + "script>";
ClientScript.RegisterStartupScript(typeof(WebForm2) ......
If Óï¾äÔÚASP.NETÖеÄÓ¦ÓÃ
ÔÚASP.NETÖÐÓÐÐí¶àµØ·½ÒªÓõ½“ifÓï¾ä”£¬ÆäʵifÓï¾äÊÇC# ·ÖÖ§½á¹¹ ÖеÄÒ»ÖÖ¡£
·ÖÖ§½á¹¹ÊÇÓÐÌõ¼þµÄÖ´ÐдúÂ룬¿ØÖÆÏÂÒ»²½ÒªÖ´ÐÐÄÄЩ´úÂëµÄ¹ý³Ì¡£
·ÖÖ§½á¹¹£º
1£®ifÓï¾ä
2£®SwitchÓï¾ä
½ñÌìËù½²µÄÄÚÈÝΪif Óï¾ä£º
Ê×ÏÈC#ÖÐif½á¹¹µÄÓï·¨ÈçÏ£º
If (±í´ïʽ)
{
´úÂë¿ ......