摘要: 1.首先,必须导入空间"Microsoft.Win32"2.利用Registry类,确定注册表的分支(ClassesRoot,CurrentUser,Users,LocalMachine,CurrentConfig)using Microsoft.Win32;RegistryKey key = Registry.LocalMachine;3.创建/打开/删除注册表项RegistryKey key = Registry.LocalMachine;//创建//注意:注册表路径一定是"\\"而不是"\"RegistryKey softwar 阅读全文
posted @ 2013-04-03 09:32 StupidsCat 阅读(397) 评论(0) 推荐(0) 编辑
摘要: CREATE procedure sp_who_lock as begin declare @spid int declare @blk int declare @count int declare @index int declare @lock tinyint set @lock=0 create table #temp_who_lock ( id int identity(1,1), spid int, blk int ) if @@error<>0 return @@error insert into #temp_who_lock(spid,blk) select 0 ,b 阅读全文
posted @ 2013-04-03 09:30 StupidsCat 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 可以用备份作业:/*******************完整备份作业*******************/--完整备份,每周一次USE MasterGOdeclare @str varchar(100)set @str='D:\DBtext\jgj\DBABak\FullBak'+replace(replace(replace(convert(varchar,getdate(),20),'-',''),' ',''),':','')+'.bak'BACKUP DAT 阅读全文
posted @ 2013-03-27 13:24 StupidsCat 阅读(470) 评论(0) 推荐(0) 编辑
摘要: 总结了一些SQL Server常用的备份还原T-SQL语句,代码基本是支持2005/2008的,不过部分功能需要企业版数据库http://www.cnblogs.com/bhtfg538/archive/2009/09/14/1566127.html使用镜像备份/*Author:Terry.Sai.M.J 浪客 Location:BeiJingDateTime:GETDATE()Description:使用镜像备份*/IF DB_ID('db') IS NOT NULL DROP DATABASE db;GOCREATE DATABASE db;GOCREATE TABLE d 阅读全文
posted @ 2013-03-25 13:45 StupidsCat 阅读(544) 评论(0) 推荐(1) 编辑
摘要: use mastergoif exists(select * from sysdatabases where name='bbsDB') drop database bbsDBgoExec xp_cmdshell 'mkdir d:/project' --调用dos命令创建文件夹 create database bbsDB on( name='bbsDB_data', filename='d:/project/bbsDB_data.mdf', size=10mb, filegrowth=20%)log on(name='b 阅读全文
posted @ 2013-03-25 12:58 StupidsCat 阅读(1030) 评论(0) 推荐(0) 编辑
摘要: if object_id('p_getlinkinfo','P')is not null drop proc p_getlinkinfogocreate proc p_getlinkinfo @dbname sysname=null, --要查詢的數據庫名,默認表示所有 @includeip bit=0 --是否顯示IP信息 as begindeclare @dbid int set @dbid=db_id(@dbname)if object_id('tempdb..#tb')is not null drop table #tbif object 阅读全文
posted @ 2013-03-25 12:57 StupidsCat 阅读(788) 评论(0) 推荐(0) 编辑
摘要: 局域网中“隐身”妙招方法一:打开本地连接属性(“控制面板→网络连接”),在“常规”选项卡中选中“Microsoft网络的文件和打印机共享”,单击“卸载”按钮,在弹出的对话框中单击“确定”即可禁止"Microsoft网络的文件和打印机共享”,从而将这台计算机的资源“隐藏”起来。方法二:打开注册表编辑器(“开始→运行→Regedit”), 找到或新建“HKEY_LOCAl_MACHINE\system\CunentControlSet\Services\LanmanServer\Parameters”分支,在右窗格中将“Hidden”(REG_DWORD型)的值改为1(0为不隐藏),完成 阅读全文
posted @ 2013-02-27 16:45 StupidsCat 阅读(6961) 评论(0) 推荐(0) 编辑
摘要: Edu邮箱在不少场合用处很大,比如dropbox扩容、微软产品针对学生的优惠、免费版Google Apps等等。但是一般edu邮箱并不对外开放注册,而且edu.cn的邮箱有时候并不享受优惠。这里介绍的是美国的教育邮箱,采用的是Gmail服务,除了Google+不能注册之外,其余的功能和Gmail完全一样,而且邮箱空间是25G,Google Drive为5G……1. 注册地址 : https://eims.maricopa.edu/MAW/MAW.html2. 选则 “I am a new student and have never attended any Maricopa Communit 阅读全文
posted @ 2013-02-27 12:32 StupidsCat 阅读(20645) 评论(1) 推荐(1) 编辑
摘要: C# 实现:private void OpenFolderAndSelectFile(String fileFullName){ System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("Explorer.exe"); psi.Arguments = "/e,/select," + fileFullName; System.Diagnostics.Process.Start(psi);}参考:Windows 资源管理器参数的用法。Explorer 阅读全文
posted @ 2013-01-23 16:40 StupidsCat 阅读(15979) 评论(0) 推荐(0) 编辑
摘要: 匹配中文汉字[\u4E00-\u9FFF]获取一个路径中的文件名:C# CODE: [^\/\\\:\*\?\"<>\|]*\.[a-zA-Z0-9]{1,4}?$运行效果如下:其中像 第2行第3行这种名字的文件夹,会发生匹配错误,我也没有更好的办法,如果你有更好的表达式,别忘了回复我一下哦。谢啦。获取HTML代码中的内容:(?!<(.*)>)(?<=.*[^<.*>]>).[^<>]*(?<!<\/.*>)(?=<\/?.*)运行效果如下:获取HTML代码中的超链接:可以验证输入的是否是超链接。(? 阅读全文
posted @ 2013-01-22 09:17 StupidsCat 阅读(299) 评论(0) 推荐(0) 编辑