
C#
kepeizong
这个作者很懒,什么都没留下…
展开
-
截取字符串长度
/**//// ///2006-09-03 柯培宗 ///p_StrValue 字符 ///p_StrLen 要截取的字符长度 /// public string LeftStr(string p_StrValue,int p_StrLen) ...{ int m_Num = 0;原创 2006-09-03 22:26:00 · 1471 阅读 · 0 评论 -
c#.net常用函数列表
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int 日=curre原创 2006-09-03 22:09:00 · 1041 阅读 · 0 评论 -
截取字符串长度(新)
/// ///2006-09-03 22:56 柯培宗 QQ:813660 ///功能:截取字符串某一长度并返回 ///要截取的字符串 ///要截取的字符串长度 ///截取长度小于总长度时是否要加省略号 /// 截取后的字符串 ///原创 2006-09-03 22:55:00 · 1471 阅读 · 0 评论 -
不足五位的转化为五位。前面补0
string m_ClsID=string.Format("{0:D5}",m_sDiyCode);例:m_sDiyCode原值为5使m_sDiyCode成为:00005功能:不足五位的转化为五位。前面补0原创 2006-05-31 09:18:00 · 2716 阅读 · 1 评论 -
C#类库编译及使用
问题的提出: 现有类库文件 login.cs using System; namespace conn { public class Login { //在此类中定义一个静态的字段(属性),返回一个字符串 public static string Connection { get { return @"Serve转载 2006-10-19 14:27:00 · 2669 阅读 · 0 评论 -
时间处理
当前日期时间的获取: DateTime datetime1=DateTime.Now; 日期时间的运算: string str1=(datetime1.AddYears(1)).ToString();//加年份 string str1=(datetime1.AddMonths(1)).ToString();//加月份 string str1=(datetime1.AddDays原创 2006-06-22 13:56:00 · 753 阅读 · 0 评论