摘要:
几个经常用到的字符串的截取string str="123abc456";int i=3;1 取字符串的前i个字符str=str.Substring(0,i); // orstr=str.Remove(i,str.Length-i);2 去掉字符串的前i个字符:str=str.Remove(0,i); // or str=str.Substring(i);3 从右边开始取i个字符:str=str.Substring(str.Length-i); // or str=str.Remove(0,str.Length-i);4 从右边开始去掉i个字符:str=str.Substri 阅读全文
posted @ 2012-01-11 14:40
辣椒粉
阅读(210)
评论(0)
推荐(0)
摘要:
C#连接 SQL 数据库 连接数据库的步骤: 1、建立 SqlConnection 对象; 2、指定 SqlConnection 对象的 ConnectionString 属性; 3、打开数据库连接; 4、指定 SQL 语句;5、建立 SqlDataAdapter 对象和 DataSet 对象(myDataAdapter = new SqlDataAdapter(strCmd,conn); ) ; 6、添冲 DataSet; 7、给 DataGrid 指定数据源 SqlConnection conn = new SqlConnection(); conn.ConnectionString = 阅读全文
posted @ 2012-01-11 14:13
辣椒粉
阅读(484)
评论(0)
推荐(1)
摘要:
using k3Login;static void Main(){//现在程序入口ClsLoginClass login1 = new ClsLoginClass();if (login1.CheckLogin()){Application.Run(new MainForm());MessageBox.Show(login1.PropsString);}} 阅读全文
posted @ 2012-01-11 13:51
辣椒粉
阅读(229)
评论(0)
推荐(0)
摘要:
http://www.cnblogs.com/candywyq/archive/2007/07/24/830021.html1、从字符串中提取子串StringBuilder 类没有支持子串的方法,因此必须用String类来提取。string mystring="My name is ynn.";//Displays "name is ynn."Console.WriteLine(mystring.Substring( 3 ));//Displays "ynn"Console.WriteLine(mystring.Substring( 阅读全文
posted @ 2012-01-11 13:12
辣椒粉
阅读(488)
评论(1)
推荐(0)

浙公网安备 33010602011771号