会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
best.lei
渐行渐远
博客园
首页
联系
管理
上一页
1
···
6
7
8
9
10
11
12
下一页
2015年8月27日
数据库操作
摘要: 连接数据库操作: string s = "Data Source=服务器名称;Initial Catalog=数据库名称;Integrated Security=True"; //连接数据库所需要的字符串 SqlConnection con = new SqlConnection(); c...
阅读全文
posted @ 2015-08-27 00:10 best.lei
阅读(193)
评论(0)
推荐(0)
2015年8月26日
TreeView控件使用
摘要: treeView1.SelectedNode = treeView1.Nodes[0]; //选中当前treeview控件的根节点为当前节点添加子节点: TreeNode tmp; tmp = new TreeNode("需要添加的内容"); treeView1.Se...
阅读全文
posted @ 2015-08-26 23:58 best.lei
阅读(296)
评论(0)
推荐(0)
将richTextBox中的内容写入txt文件发现不换行(解决方法),在richTextBox指定位置插入文字
摘要: string pathname = dt.ToString().Replace(":", ""); string str = richTextBoxResult.Text; str = str.Replace("\n", "\r\n"); //关键 File.AppendAllText(@"D...
阅读全文
posted @ 2015-08-26 23:50 best.lei
阅读(1013)
评论(0)
推荐(0)
RichTextBox实现鼠标右键(剪切,复制,粘贴)功能
摘要: private static void InitRichTextBoxContextMenu(RichTextBox textBox) { //创建剪切子菜单 var cutMenuItem = new System.Windows.Forms.MenuItem("剪切"); cutMenuItem
阅读全文
posted @ 2015-08-26 23:48 best.lei
阅读(2119)
评论(0)
推荐(0)
C# 将内容写入txt文档
摘要: FileStream fs = new FileStream(@"D:\text.txt", FileMode.Append); StreamWriter sw = new StreamWriter(fs, Encoding.Default); sw.Write(strAnalasy)...
阅读全文
posted @ 2015-08-26 23:44 best.lei
阅读(6310)
评论(0)
推荐(0)
C#对SQL Server数据库的备份与还原
摘要: 备份数据库: string connectionString = "server=服务器名称;database=数据库名;uid=登入名;pwd=登入密码"; //登入名和密码在SQL Server中查找 private void btnBackDataBase_Click(...
阅读全文
posted @ 2015-08-26 06:39 best.lei
阅读(2951)
评论(0)
推荐(0)
2015年8月25日
App Widget简单应用
摘要: 首先后台进程创建一个PendingIntent对象,其中PendingIntent中包含一个真正的Intent,创建完成后将此PendingIntent对象交给桌面控件所在的进程,当用户点击桌面控件或者其他情况时,触发Intent,从而可实现启动一个Activity、发送一个Broadcast、...
阅读全文
posted @ 2015-08-25 04:37 best.lei
阅读(260)
评论(0)
推荐(0)
2015年8月20日
App Widget
摘要: AppWidgetProviderInfo对象: 为App Widget提供元数据(描述数据的数据,如XML、关系型数据的表结构),包括布 局,更新频率等数据。这个对象被定义在XML文件当中; AppWidgetProvider: 定义了App Widget的基本生命周...
阅读全文
posted @ 2015-08-20 21:35 best.lei
阅读(161)
评论(0)
推荐(0)
2015年8月13日
利用SimpleExpandableListAdapter为ExpandableListActivity提供数据
摘要: 首先MainActivity继承自ExpandableListActivity,其中的声明如下: setContentView(R.layout.expandmain); //定义一个:List,该List对象为一级条目提供数据 List> parents = new Arra...
阅读全文
posted @ 2015-08-13 22:31 best.lei
阅读(329)
评论(0)
推荐(0)
2015年8月12日
DatePickerDialog、AutoCompleteTextView
摘要: DatePickerDialog选择日期,调用showDialog(int id)方法,会执行onCreateDialog方法: @Override protected Dialog onCreateDialog(int id) { switch(id){ c...
阅读全文
posted @ 2015-08-12 21:15 best.lei
阅读(219)
评论(0)
推荐(0)
上一页
1
···
6
7
8
9
10
11
12
下一页