asp.netÅжÏÊäÈëÎÄ×ÖÊÇ·ñÊÇÊý×Ö (ת)
·½°¸Ò»:
/**//// <summary>
/// Ãû³Æ£ºIsNumberic
/// ¹¦ÄÜ£ºÅжÏÊäÈëµÄÊÇ·ñÊÇÊý×Ö
/// ²ÎÊý£ºstring oText£ºÔ´Îı¾
/// ·µ»ØÖµ£º¡¡bool true:ÊÇ¡¡false:·ñ
/// </summary>
public bool IsNumberic(string oText)
{
try
{
int var1=Convert.ToInt32 (oText);
return true;
}
catch
{
return false;
}
}
try catch·½·¨
Àý£º
try
{
Convert.ToInt32("123"):
Console.Write("ÊÇÊý×Ö");
}
catch(Exception ex)
{
Console.Write("·ÇÊý×Ö");
}
×¢£ºÈç¹ûÓкܶà×Ö·û´®ÒªÇóÅжϣ¬´Ë·½·¨ÐèÒª´óÁ¿µÄtry catch ÒÔ¼°finallyÀ´´¦ÀíºóÐøµÄ³ÌÐò.²»½¨ÒéʹÓô˷½·¨¡£
¸Ä½øÒ»ÏÂ:
ÒòΪ¿ÉÒÔתint ¿ÉÒÔתDecimal
public bool IsNumberic(string oText)
{
try
{
Decimal Number = Convert.ToDecimal (oText);
return true;
}
catch
{
return false;
}
}
·½°¸¶þ:
//Èç¹ûÊÇ´¿Êý×Ö»¹¿ÉÒÔ²ÉÓÃASCIIÂë½øÐÐÅжÏ
/// <summary>
/// ÅжÏÊÇ·ñÊÇÊý×Ö
/// </summary>
/// <param name="str">×Ö·û´®</param>
/// <returns>bool</returns>
public bool IsNumeric(string str)
{
if (str == null || str.Length == 0) &nbs
Ïà¹ØÎĵµ£º
ÉÏ´ÎÎÒÃÇ˵µ½ÁË route ·ÓɵŦÄÜ,Õû¸ömvcÔËÐйý³Ì:
Route(·ÓÉ) --> Controller(¿ØÖÆÆ÷)-->action(·½·¨)
Õâ´ÎÎÒÃÇҪ˵µÄ¾ÍÊÇ controller ¿ØÖÆÆ÷ ºÍ action£º
¿ØÖÆÆ÷µÄ×÷ÓþÍÊÇ£ºµ±Ò»¸ö Request À´µÄʱºò£¬Ê×ÏÈRoute ½âÎö ÕÒµ½ÁË ¶ÔÓ¦ ¿ØÖÆÆ÷£¬¿ØÖÆÆ÷ÔÙ¸ù¾Ý action ¾ö¶¨¸øÎÒÃÇ·µ»ØÊ²Ã´ÑùµÄÄÚÈÝ¡£È磺
´úÂë ......
·½·¨1
HttpFileCollection files = HttpContext.Current.Request.Files;
//ÎÒÉèÖõĴóС²»³¬¹ýA4Ö½µÄËõÂÔͼ
int newWidth=620;
int newHeight=880;
System.Drawing.Image img = null;
for(int iFile = 0; iFile < files.C ......
±¾ÏµÁÐÎÄÕÂͨ¹ýÒ»¸öÐéÄâµÄ°¸Àý——¡¶MVC¹«¸æ·¢²¼ÏµÍ³¡·µÄ¿ª·¢¹ý³Ì£¬È«ÃæÕ¹Ê¾ÁËASP.NET MVCµÄ»ù±¾Ê¹Ó÷½·¨£¬Í¬Ê±ÔÚÌÖÂÛÁËÕâ¸ö¿ò¼ÜµÄ»ù±¾ÔÀí¡£
Õâ¸öÎÄÕÂϵÁеÄÄ¿µÄ¾ÍÊÇʹÅóÓÑÃǸüÇáËɵÄÈëÃÅASP.NET MVC¡£
Õâ¸öϵÁлá°üº¬µÄÄÚÈÝÓУºASP.NET ......
ASP.Net ѧϰ֮·µ»ØÉÏÒ»Ò³µÄʵÏÖ·½·¨
[ÈÕÆÚ£º01-20] [×ÖÌ壺´ó ÖРС]
·µ»ØÉÏÒ»Ò³µÄÕâ¸ö¶«¶«ÔÚÎÒÃÇ×öÏîÄ¿µÄʱºòÒ»°ãÊÇÓÃÓÚÌîдÍê±íµ¥ºóÈ·ÈϵÄʱºò£¬ÓжÔÔÀ´ÊäÈëµÄÊý¾Ý½øÐÐÐÞ¸ÄʱÓõ쬻òÕßÊÇÒòÎªÍøÕ¾ÎªÁË·½±ãä¯ÀÀÕß¶øÓÐÐÄÌí¼ÓµÄÒ»¸ö¶«¶«£¬Ò»°ãÕâÖÖ¹¦ÄܵÄʵÏÖÔÚASP.netÖж¼ÊÇÓÃÒ»¸öbuttonµÄ¿Ø¼þÀ´ÊµÏֵģ¬ÊµÏֵķ ......
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string str = "123456789";
//string str1 = Eval("str").ToString ......