示例#1
0
 /// <summary>
 ///  获取表单提交的float参数值
 /// </summary>
 /// <param name="strName">参数名称</param>
 /// <param name="defValue">设置参数的默认值,供返回使用</param>
 /// <returns>返回转换后的float参数值</returns>
 public static float GetFormFloat(string strName, float defValue)
 {
     return(TypeParse.StrToFloat(HttpContext.Current.Request.Form[strName], defValue));
 }
示例#2
0
 /// <summary>
 /// 获取 Get 请求传递的int参数值
 /// </summary>
 /// <param name="request">请求对象</param>
 /// <param name="strName">参数名称</param>
 /// <param name="defValue">设置参数的默认值,供返回使用</param>
 /// <returns>返回转换后的int参数值</returns>
 public static int GetQueryInt(HttpRequest request, string strName, int defValue)
 {
     return(TypeParse.StrToInt(request.QueryString[strName], defValue));
 }
示例#3
0
 public static int StrToInt(string expression, int defValue)
 {
     return(TypeParse.StrToInt(expression, defValue));
 }
示例#4
0
 public static float StrToFloat(string strValue, float defValue)
 {
     return(TypeParse.StrToFloat(strValue, defValue));
 }
示例#5
0
 public static bool StrToBool(string expression, bool defValue)
 {
     return(TypeParse.StrToBool(expression, defValue));
 }
示例#6
0
 /// <summary>
 /// 判断给定的字符串数组(strNumber)中的数据是不是都为数值型
 /// </summary>
 /// <param name="strNumber"></param>
 /// <returns></returns>
 public static bool IsNumericArray(string[] strNumber)
 {
     return(TypeParse.IsNumericArray(strNumber));
 }