作为ubuntu等桌面系统,默认登录的帐号是没有root权限的,为了提升权限来执行任务,我们一般用到sudo+命令来执行,但是不难发现我们一般都要输入密码.那么有没有什么方法可以让我们执行sudo的时候不输入密码呢?当然有咯.那就是对sudoers文件进行修改. 进入终端,执行 sudo vi sudoers 在#User privilege specification下面会罗列一些规则,我们现在需要做的是对我们的用户进行一些操作.假如我们的用户名为test,那么在文件的最后一行添加: test
SqlCommand对象的字符串SQL命令可以做多个,以查询为例,用到SqlDataReader的一些方法,如ExecuteReader(),Read()(一条命令内的移动至下一记录),NextResult()(移动到下一个命令并执行). using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Data.SqlClient; using System.Da
1.TreeView选择事件执行两次 Very often, we need to execute some code in SelectedItemChanged depending on the selected TreeViewItem. ButSelectedItemChanged is called twice. This is due to stealing focus from the main window, which is screwing something up. Wha