ImageVerifierCode 换一换
格式:DOCX , 页数:24 ,大小:19.61KB ,
资源ID:4922530      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/4922530.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(总结12C#常用的类.docx)为本站会员(b****4)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

总结12C#常用的类.docx

1、总结12C#常用的类C#常用的类/* * Title: 系统函数 * Description: 系统函数 * Copyright: Copyright (c) 2009* Version 1.0 */using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using

2、System.Web.UI.HtmlControls;using System.Text;using System.Text.RegularExpressions;using WBIS.Base.Fun;using System.IO;namespace WBIS.Base.Fun / / funSystem 系统处理类 / public class funSystem / / 取得大写中文字 / / 数字如1、2、3 / / public static string GetBigTWNum(string strCode) string strReData; switch (strCode)

3、case 1: strReData = 壹; break; case 2: strReData = 贰; break; case 3: strReData = 参; break; case 4: strReData = 肆; break; case 5: strReData = 伍; break; case 6: strReData = 陆; break; case 7: strReData = 柒; break; case 8: strReData = 捌; break; case 9: strReData = 玖; break; case 0: strReData = 零; break;

4、default: strReData = ; break; return strReData; / / 将阿拉伯数字转为国文数字 / / 阿拉伯数字(例:15) / 转换后的中文数字(例:十五) / Author:Peter 2006/8/17 public static string NumToChn(string strCode) if (strCode = null | strCode = ) return ; string strReData; if (strCode.Length = 1) switch (strCode) case 1: strReData = 一; break;

5、case 2: strReData = 二; break; case 3: strReData = 三; break; case 4: strReData = 四; break; case 5: strReData = 五; break; case 6: strReData = 六; break; case 7: strReData = 七; break; case 8: strReData = 八; break; case 9: strReData = 九; break; case 0: strReData = 零; break; default: strReData = ; break;

6、else if (strCode.Length = 2) if (strCode = 10) strReData = 十; else if (strCode = 20 | strCode = 30 | strCode = 40 | strCode = 50 | strCode = 60 | strCode = 90 | strCode = 70 | strCode = 80) strReData = NumToChn(strCode.Substring(0, 1) + 十; else if (Convert.ToInt16(strCode) 10) strReData = 十 + NumToC

7、hn(strCode.Substring(1, 1); else if (Convert.ToInt16(strCode) 20) strReData = NumToChn(strCode.Substring(0, 1) + 十 + NumToChn(strCode.Substring(1, 1); else strReData = ; else if (strCode.Length = 3) if (strCode = 100) strReData = 一百; else if (Convert.ToInt16(strCode) 100 & Convert.ToInt16(strCode) 2

8、00 & Convert.ToInt16(strCode) 300 & Convert.ToInt16(strCode) 400 & Convert.ToInt16(strCode) 500 & Convert.ToInt16(strCode) 600 & Convert.ToInt16(strCode) 700 & Convert.ToInt16(strCode) 800 & Convert.ToInt16(strCode) 900 & Convert.ToInt16(strCode) 110 & Convert.ToInt16(strCode) 110 & Convert.ToInt16(

9、strCode) 1000) strReData = NumToChn(strCode.Substring(0, 1) + 百 + NumToChn(strCode.Substring(1, 2); else strReData = ; else strReData = ; return strReData; / / 前缀补0 / / 要补零的字符串 / 设置补零后的字长 / 补零后的字符串 public static string AddPrefixZero(string strValue, int iLen) int i; i = strValue.Length; while (i iLe

10、n) strValue = 0 + strValue; i = strValue.Length; return strValue; / / 后缀补0 / / 要补零的字符串 / 设置补零后的字长 / 补零后的字符串 public static string AddSuffixZero(string strValue, int iLen) int i; i = strValue.Length; while (i iLen) strValue = strValue + 0; i = strValue.Length; return strValue; / / 前缀去0 / / 要去零的字符串 / 去

11、零后的字符串 / public static string RemovePrefixZero(string strValue) string outValue; for (int i = 0; i strValue.Length; i+) if (strValue.Substring(i, 1) != 0) outValue = strValue.Substring(i, (strValue.Length - i); return outValue; return ; / / 判断strNumber是否为数字,是数字返回True,不是数字返回False / / 要判断是否数字的字符串 / 数字

12、返回True,不是数字返回False public static bool IsNumeric(String strNumber) Regex NumberPattern = new Regex(0-9.-); return !NumberPattern.IsMatch(strNumber); / / 连接功能处理 / / 功能名称 / 功能编号 / Response对象 public static void linkFun(string funName, string funNo, ClientScriptManager clientScriptTmp) /判断是否有传入Http画面资料 i

13、f (clientScriptTmp = null) return; if (funNo.Length 3) return; /组成更改提示之javascript的语句 string alertMeg; alertMeg = parent.statusbar.openFun(; alertMeg += funName; alertMeg += , + funNo; alertMeg += ); /画面上显示提示 clientScriptTmp.RegisterStartupScript(clientScriptTmp.GetType(), alertMeg, alertMeg); / / 过滤

14、和其它非法输入 / / 需判断之参数 / clientScript对象 / / Ki 添加 2009/4/1 public static Boolean checkRule(string press, ClientScriptManager clientScriptTmp) string c; int j = 0; for (int i = 0; i press.Length; i+) c = press.Substring(i, 1).ToString(); if (c = ) | (c = ) | (c = ) | (c = -) | (c = .) | (c = /) funMessag

15、e.messageBox(您输入的有非法字符!, clientScriptTmp); j = 1; break; if (j = 1) return false; else return true; / / 转化为小数 / / / public static double strToDouble(string strNum) try return double.Parse(strNum.Trim().ToString(); catch (System.Exception ex) return 0; return 0; / / 格式化数字成三字一撇的形式 / / 传入的数值 / 保留的小数点 p

16、ublic static string FormatNum(string strValue, int iValue) string strRight, strLeft; string iLenDecimal; string a; a = strValue.ToString().Substring(0, 1); iLenDecimal = strValue; if (iLenDecimal.ToString().IndexOf(., 0) 0) strRight = iLenDecimal.ToString().Substring(iLenDecimal.ToString().IndexOf(.

17、, 0), iLenDecimal.ToString().Length - iLenDecimal.ToString().IndexOf(., 0); if (a = -) strLeft = iLenDecimal.ToString().Substring(1, iLenDecimal.ToString().IndexOf(., 0); else strLeft = iLenDecimal.ToString().Substring(0, iLenDecimal.ToString().IndexOf(., 0); else strRight = ; strLeft = iLenDecimal.

18、ToString(); int j = 1; int i = strLeft.ToString().Length; while (i 3) int iDecimal = funSystem.ToInt(iLenDecimal); iLenDecimal = Convert.ToString(Convert.ToInt32(iDecimal / 1000); /string striLenDecimal = Convert.ToString(iLenDecimal); i = Convert.ToString(iLenDecimal).Length; if (j = 1) strLeft = s

19、trLeft.ToString().Insert(strLeft.Length - (3 * j), ,); else strLeft = strLeft.ToString().Insert(strLeft.Length - 3 * j - (j - 1), ,); j+; if (strRight.Length = 0) for (int d = iValue; d 0; d-) strRight += 0; if (iValue != 0) return strLeft.ToString() + . + strRight.ToString(); else return strLeft.To

20、String(); if (iValue != 0) return strLeft.ToString() + . + funSystem.AddSuffixZero(strRight.Substring(1), iValue); else return strLeft.ToString(); / / 格式化数字成三字一撇的形式 / / / /public static string FormatNum(string str) / / string strA = new string2; / strA = str.Split(.); / string strB = new string2; /

21、strB = str.Split(-); / if (strA.Length = 2) / / str = strA0; / / else if (strB.Length = 2) / / str = strB1; / / Regex rg = new Regex(d3, RegexOptions.RightToLeft); / MatchCollection mc = rg.Matches(str); / if (str.Trim().Length % 3 = 0) / / for (int i = 0; i mc.Count - 1; i+) / / str = str.Insert(mci.Index, ,); / / / else / / for (int i = 0; i = 2) / / str = str + . + strA1; / / else if (strB.Length = 2) / / str = - + str; / / return str; / / / 格式化数字成三字一撇的形式 / / 传入数字(如:1000或是1000.12)

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1