private void AnalysisConnectionstring() { string tempStr = “Data Source=192.168.2.123;Initial Catalog=caxastat;Persist Security Info=True;User ID=sa;Password=sa;Pooling=true;
Max Pool Size=40000;Connect Timeout=30”; string[] paras = tempStr.Split(';'); foreach (string para in paras) { switch (para.Split('=')[0]) { case "Data Source": ServerName = para.Split('=')[1].Trim(); break; case "Initial Catalog": DataBase = para.Split('=')[1].Trim(); break; case "User ID": User = para.Split('=')[1].Trim(); break; case "Password": PassWord = para.Split('=')[1].Trim(); break; } } }
解析数据库连接字符串 (将Data Source、Initial Catalog、User ID、Password取出)
免责声明:内容来源于网络,仅用于学习参考。如对内容有疑问,请及时联系本站处理。
上篇设备监控系统触屏手机3G网站设计下篇
宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=