08 2013 档案

摘要:摘自:http://blog.163.com/dpj_001/blog/static/2742941520110251500753/某日做一个项目,需要在注册表中加入键,同时写值,操作系统环境为 Windows 7于是写了如下代码:try{ RegistryKey r = Registry.LocalMachine.OpenSubKey("software",true);}catch(Exception e){}竟然抛出System.Security.SecurityExceptionMessage="不允许所请求的注册表访问权。" 的异常,嘿,怪了,以 阅读全文
posted @ 2013-08-31 00:30 水果饮料 阅读(232) 评论(0) 推荐(0)
摘要:摘自:http://bbs.csdn.net/topics/380178685首先检测是否需要“以管理员身份运行”,如果需要程序重启并自动“以管理员身份运行”,用到如下两个方法: public static bool IsNeedRunAsAdmin() { //return true; //操作系统版本号6及以上,代表Vista/Win7以后的操作系统。 if (Environment.OSVersion.Version.Major >= 6) { ... 阅读全文
posted @ 2013-08-31 00:25 水果饮料 阅读(334) 评论(0) 推荐(0)
摘要:摘自:http://greatverve.cnblogs.com/archive/2011/12/15/winform-path.htmlWinform获取应用程序的当前路径的方法集合,具体如下,值得收藏//获取当前进程的完整路径,包含文件名(进程名)。string str = this.GetType().Assembly.Location;result: X:\xxx\xxx\xxx.exe (.exe文件所在的目录+.exe文件名)//获取新的Process 组件并将其与当前活动的进程关联的主模块的完整路径,包含文件名(进程名)。string str = System.Diagnosti 阅读全文
posted @ 2013-08-31 00:23 水果饮料 阅读(335) 评论(0) 推荐(0)
摘要:url:http://www.cnblogs.com/emanlee/archive/2009/08/31/1557380.html设置某程序随系统启动自动运行,取消自动运行。 使用到using Microsoft.Win32;名称空间。public void SetAutoRun(string fileName, bool isAutoRun) { RegistryKey reg = null; try { if (!System.IO.File.Exists(fileName)) throw new Except... 阅读全文
posted @ 2013-08-31 00:21 水果饮料 阅读(337) 评论(0) 推荐(0)
摘要:转自:系统运维 » CentOS 6.0修改ssh远程连接端口实现目的:把ssh默认远程连接端口修改为2222方法如下:1、编辑防火墙配置:vi /etc/sysconfig/iptables防火墙增加新端口2222-A INPUT -m state --state NEW -m tcp -p tcp --dport 2222 -j ACCEPT======================================================================# Firewall configuration written by system-config-f 阅读全文
posted @ 2013-08-21 16:23 水果饮料 阅读(530) 评论(0) 推荐(0)
摘要:如有转载,请注明出处:http://www.cnblogs.com/flydoos/archive/2011/08/29/2158903.htmlC# 控件缩写大全+命名规范+示例写程序的时候突然忘了C#的控件命名的大小写的规范,去网上找了些资料,拷过来看看。Standard Control(标准控件)类 型前 缀示 例AdrotatoradrtadrtTopAdBulletedListblstblstCityButtonbtnbtnSubmitCalendarcalcalMettingDatesCheckBoxchkchkBlueCheckBoxListchklchklFavColorsDr 阅读全文
posted @ 2013-08-09 16:30 水果饮料 阅读(677) 评论(0) 推荐(0)