摘要: ---------------------- Windows Phone 7手机开发、.Net培训、期待与您交流! ----------------------Console.WriteLine("请输入用户名:");string username = Console.ReadLine();Console.WriteLine("请输入密码:");string password = Console.ReadLine();using(SqlConnection con=new SqlConnection(@"Data Source=.;Attach 阅读全文
posted @ 2012-01-03 14:24 黑马--彭超 阅读(319) 评论(0) 推荐(0) 编辑
摘要: ---------------------- Windows Phone 7手机开发、.Net培训、期待与您交流! ----------------------if (ofdImport.ShowDialog != DialogResult.OK)//判断用户是否点击了确定按钮{return;}using (FileStream fs = File.OpenRead(ofdImport.FileName))//打开用户要读取的文件{using (StreamReader sr = new StreamReader(fs))//读取选中的文件信息{using (SqlConnection con 阅读全文
posted @ 2012-01-03 14:24 黑马--彭超 阅读(148) 评论(0) 推荐(0) 编辑
摘要: ---------------------- Windows Phone 7手机开发、.Net培训、期待与您交流! ----------------------using (SqlConnection con = new SqlConnection(@"Data Source=.;AttachDBFilename=|DataDirectory|\db1.mdf;Integrated Security=True;User Instence=True")){con.Open();using (SqlCommand cmd = con.CreateCommand()){cmd.C 阅读全文
posted @ 2012-01-03 14:23 黑马--彭超 阅读(179) 评论(0) 推荐(0) 编辑
摘要: ---------------------- Windows Phone 7手机开发、.Net培训、期待与您交流! ----------------------1.<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><style type="text/css">div { margin:0 auto}//元素两边的 阅读全文
posted @ 2012-01-03 14:23 黑马--彭超 阅读(184) 评论(0) 推荐(0) 编辑
摘要: ---------------------- Windows Phone 7手机开发、.Net培训、期待与您交流! ----------------------string conStr=ConfigurationManager.ConnectionStrings["conStr"].ConnectionString;//链接数据库的连接字符串using (SqlConnection con = new SqlConnection(conStr))//创建连接{con.Open();//打开连接using (SqlCommand cmd = con.CreateComman 阅读全文
posted @ 2012-01-03 14:22 黑马--彭超 阅读(175) 评论(0) 推荐(0) 编辑
摘要: ---------------------- Windows Phone 7手机开发、.Net培训、期待与您交流! ----------------------Path的常用方法:按照通配符搜索目录下的文件string[] Directory.GetFiles(string path,string searchPattern,SearchOption searchOption)Path.GetFileNameWithoutExtension(filename):得到文件的文件名(无扩展名)Path.Combine(string path1,string path2):将两个路径合并Path.G 阅读全文
posted @ 2012-01-03 14:21 黑马--彭超 阅读(172) 评论(0) 推荐(0) 编辑