<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>::NPTEAM:: Network Programer Team</title>
		<link>http://www.npteam.net/</link>
		<description></description>
		<language>ko</language>
		<pubDate>Sun, 16 Nov 2008 01:00:02 +0900</pubDate>
		<generator>Tattertools 1.0.6</generator>
		<item>
			<title>[MS-SQL] BAK 파일을 새로운 DATABASE로 복원하기(attach_db_from_backup)</title>
			<link>http://www.npteam.net/684</link>
			<description>&lt;div align=&quot;right&quot;&gt;출처 : &lt;a href=&quot;http://www.npteam.net/684&quot;&gt;http://www.npteam.net/684&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;p&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;MDF 파일만 있을 경우에는 sp_attach_single_file_db 프로시저를 이용해서 아주 간편하고 쉽게 DB를 복원할 수 있다.&lt;br /&gt;
&lt;br /&gt;
그러나 Backup(BAK) 파일의 경우에는 복원하는데 약간 불편함을 감수해야 한다.&lt;br /&gt;
&lt;br /&gt;
아래의 프로시저를 이용하면 이러한 불편함을 약간이나마 해소할 수 있다.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both; margin-bottom: 10px&quot;&gt;&lt;a href=&quot;http://www.npteam.net/attachment/4779842147.sql&quot;&gt;&lt;img src=&quot;http://www.npteam.net/image/unknown.gif&quot; alt=&quot;&quot; align=&quot;bottom&quot;/&gt; _Attach_DB_From_Backup.sql&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;&lt;div class=&quot;sql&quot; style=&quot;border-right: #d0d0d0 1px solid; padding-right: 5px; border-top: #d0d0d0 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; border-left: #d0d0d0 1px solid; color: #000066; line-height: 120%; padding-top: 5px; border-bottom: #d0d0d0 1px solid; font-family: 굴림체; background-color: #f0f0f0&quot;&gt;&lt;span style=&quot;color: #993333&quot;&gt;IF&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;EXISTS&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #993333&quot;&gt;SELECT&lt;/span&gt; * &lt;span style=&quot;color: #993333&quot;&gt;FROM&lt;/span&gt; dbo.sysobjects &lt;span style=&quot;color: #993333&quot;&gt;WHERE&lt;/span&gt; id = object_id&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;N&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;[dbo].[_Attach_DB_From_Backup]&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;AND&lt;/span&gt; OBJECTPROPERTY&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;id, N&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;IsProcedure&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; procedure &lt;span style=&quot;color: #66cc66&quot;&gt;[&lt;/span&gt;dbo&lt;span style=&quot;color: #66cc66&quot;&gt;]&lt;/span&gt;.&lt;span style=&quot;color: #66cc66&quot;&gt;[&lt;/span&gt;_Attach_DB_From_Backup&lt;span style=&quot;color: #66cc66&quot;&gt;]&lt;/span&gt;&lt;br /&gt;
GO&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; QUOTED_IDENTIFIER &lt;span style=&quot;color: #993333&quot;&gt;ON&lt;/span&gt; &lt;br /&gt;
GO&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; ANSI_NULLS &lt;span style=&quot;color: #993333&quot;&gt;ON&lt;/span&gt; &lt;br /&gt;
GO&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;CREATE&lt;/span&gt; PROCEDURE &lt;span style=&quot;color: #66cc66&quot;&gt;[&lt;/span&gt;dbo&lt;span style=&quot;color: #66cc66&quot;&gt;]&lt;/span&gt;._Attach_DB_From_Backup&lt;br /&gt;
&amp;nbsp; @strRestoreDBName varchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;128&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; @strBackupFilePath&amp;nbsp; varchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;255&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;AS&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- master DB 체크&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;IF&lt;/span&gt; DB_NAME&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; &amp;lt;&amp;gt; &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;master&#039;&lt;/span&gt;&lt;br /&gt;
BEGIN&lt;br /&gt;
&amp;nbsp; RAISERROR&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;current database name was not &quot;master&quot;. You should be change &quot;master&quot; database&#039;&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;16&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;RETURN&lt;/span&gt;&lt;br /&gt;
END&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- 생성할 DB가 존재하는지 체크&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;IF&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;EXISTS&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #993333&quot;&gt;SELECT&lt;/span&gt; * &lt;span style=&quot;color: #993333&quot;&gt;FROM&lt;/span&gt;&amp;nbsp; master..sysdatabases &lt;span style=&quot;color: #993333&quot;&gt;WHERE&lt;/span&gt; name = @strRestoreDBName &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
BEGIN&lt;br /&gt;
&amp;nbsp; RAISERROR&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;It was already existed database name. Try to execute procedure another DB name&#039;&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;16&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;RETURN&lt;/span&gt;&lt;br /&gt;
END&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- 실행 시간 측정&lt;/span&gt;&lt;br /&gt;
declare @StartTime datetime&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; @StartTime = GetDate&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- 동적 실행 쿼리로 쓰일 변수&lt;/span&gt;&lt;br /&gt;
declare @strQuery nvarchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;2048&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- DB 생성&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; @strQuery = &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;CREATE DATABASE &#039;&lt;/span&gt; + @strRestoreDBName&lt;br /&gt;
EXEC sp_executesql @strQuery&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- 임시 테이블 생성 - (Backup 파일에서 정보 추출)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#FileListInfo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; LogicalName nvarchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;128&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; PhysicalName&amp;nbsp; nvarchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;260&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; Type&amp;nbsp; &amp;nbsp; char&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; FileGroupName nvarchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;128&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #66cc66&quot;&gt;[&lt;/span&gt;Size&lt;span style=&quot;color: #66cc66&quot;&gt;]&lt;/span&gt;&amp;nbsp; &amp;nbsp; numeric&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;20&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #66cc66&quot;&gt;[&lt;/span&gt;MaxSize&lt;span style=&quot;color: #66cc66&quot;&gt;]&lt;/span&gt; numeric&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;20&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- 임시 테이블 생성 - (생성된 DB에서 정보(MDF, LDF 파일 경로) 추출)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#CreatedDBInfo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; name&amp;nbsp; &amp;nbsp; nvarchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;128&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; filename&amp;nbsp; nvarchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;260&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- Backup 파일로 부터 정보 추출 -&amp;gt; #FileListInfo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; @strQuery = N&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;RESTORE FILELISTONLY FROM DISK = &#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt; + @strBackupFilePath + &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;INTO&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#FileListInfo EXEC sp_executesql @strQuery&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- 생성된 DB에서 정보 추출 -&amp;gt; #CreatedDBInfo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; @strQuery = &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;select name, filename from &#039;&lt;/span&gt; + @strRestoreDBName + &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;.[dbo].sysfiles&#039;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;INTO&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#CreatedDBInfo EXEC sp_executesql @strQuery&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- Backup 파일로 부터 LogicalName(Data, Log)를 가져온다.&lt;/span&gt;&lt;br /&gt;
declare @LogicalName_Data nvarchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;128&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
declare @LogicalName_Log&amp;nbsp; nvarchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;128&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SELECT&lt;/span&gt; @LogicalName_Data = LogicalName &lt;span style=&quot;color: #993333&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#FileListInfo where Type = &#039;D&#039;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; @@error &amp;lt;&amp;gt; &lt;span style=&quot;color: #cc66cc&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;OR&lt;/span&gt; @@rowcount = &lt;span style=&quot;color: #cc66cc&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;OR&lt;/span&gt; @LogicalName_Data &lt;span style=&quot;color: #993333&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
begin&lt;br /&gt;
&amp;nbsp; RAISERROR&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;LogicalName for Data is not exist&#039;&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;16&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#FileListInfo&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#CreatedDBInfo&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; @strQuery = &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;DROP DATABASE &#039;&lt;/span&gt; + @strRestoreDBName&lt;br /&gt;
&amp;nbsp; EXEC sp_executesql @strQuery&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;RETURN&lt;/span&gt;&lt;br /&gt;
end&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SELECT&lt;/span&gt; @LogicalName_Log&amp;nbsp; = LogicalName &lt;span style=&quot;color: #993333&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#FileListInfo where Type = &#039;L&#039;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; @@error &amp;lt;&amp;gt; &lt;span style=&quot;color: #cc66cc&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;OR&lt;/span&gt; @@rowcount = &lt;span style=&quot;color: #cc66cc&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;OR&lt;/span&gt; @LogicalName_Log &lt;span style=&quot;color: #993333&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
begin&lt;br /&gt;
&amp;nbsp; RAISERROR&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;LogicalName for Log is not exist&#039;&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;16&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#FileListInfo&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#CreatedDBInfo&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; @strQuery = &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;DROP DATABASE &#039;&lt;/span&gt; + @strRestoreDBName&lt;br /&gt;
&amp;nbsp; EXEC sp_executesql @strQuery&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;RETURN&lt;/span&gt;&lt;br /&gt;
end&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- 생성된 DB에서 MDF, LDF 파일 경로를 가져온다.&lt;/span&gt;&lt;br /&gt;
declare @strFileName_Data nvarchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;260&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
declare @strFileName_Log&amp;nbsp; nvarchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;260&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SELECT&lt;/span&gt; @strFileName_Data = filename &lt;span style=&quot;color: #993333&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#CreatedDBInfo where filename like &#039;%MDF%&#039;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; @@error &amp;lt;&amp;gt; &lt;span style=&quot;color: #cc66cc&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;OR&lt;/span&gt; @@rowcount = &lt;span style=&quot;color: #cc66cc&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;OR&lt;/span&gt; @strFileName_Data &lt;span style=&quot;color: #993333&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
begin&lt;br /&gt;
&amp;nbsp; RAISERROR&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;#CreatedDBInfo has not MDF file path&#039;&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;16&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#FileListInfo&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#CreatedDBInfo&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; @strQuery = &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;DROP DATABASE &#039;&lt;/span&gt; + @strRestoreDBName&lt;br /&gt;
&amp;nbsp; EXEC sp_executesql @strQuery&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;RETURN&lt;/span&gt;&lt;br /&gt;
end&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SELECT&lt;/span&gt; @strFileName_Log&amp;nbsp; = filename &lt;span style=&quot;color: #993333&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#CreatedDBInfo where filename like &#039;%LDF%&#039;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; @@error &amp;lt;&amp;gt; &lt;span style=&quot;color: #cc66cc&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;OR&lt;/span&gt; @@rowcount = &lt;span style=&quot;color: #cc66cc&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;OR&lt;/span&gt; @strFileName_Log &lt;span style=&quot;color: #993333&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;NULL&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
begin&lt;br /&gt;
&amp;nbsp; RAISERROR&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;#CreatedDBInfo has not LDF file path&#039;&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;16&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#FileListInfo&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#CreatedDBInfo&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; @strQuery = &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;DROP DATABASE &#039;&lt;/span&gt; + @strRestoreDBName&lt;br /&gt;
&amp;nbsp; EXEC sp_executesql @strQuery&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #993333&quot;&gt;RETURN&lt;/span&gt;&lt;br /&gt;
end&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- Backup 파일로 부터 DB를 복원 한다.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; @strQuery = &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;RESTORE DATABASE &#039;&lt;/span&gt; + RTRIM&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;@strRestoreDBName&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; + &lt;span style=&quot;color: #ff0000&quot;&gt;&#039; FROM DISK = &#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt; + RTRIM&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;@strBackupFilePath&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; + &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039; WiTH REPLACE, MOVE &#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt; + RTRIM&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;@LogicalName_Data&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; + &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039; TO &#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt; + RTRIM&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;@strFileName_Data&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; + &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;, &#039;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; + &lt;span style=&quot;color: #ff0000&quot;&gt;&#039; MOVE &#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt; + RTRIM&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;@LogicalName_Log&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; + &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039; TO &#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt; + RTRIM&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;@strFileName_Log&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; + &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
EXEC sp_executesql @strQuery&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #808080&quot;&gt;-- 임시 테이블 Drop&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#FileListInfo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333&quot;&gt;TABLE&lt;/span&gt; &lt;span style=&quot;color: #808080&quot;&gt;#CreatedDBInfo&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;&#039;Elapsed time : &#039;&lt;/span&gt; + convert&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt; varchar&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc&quot;&gt;128&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;, GetDate&lt;span style=&quot;color: #66cc66&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt; - @StartTime, &lt;span style=&quot;color: #cc66cc&quot;&gt;114&lt;/span&gt; &lt;span style=&quot;color: #66cc66&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; NOCOUNT OFF&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
GO&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; QUOTED_IDENTIFIER OFF &lt;br /&gt;
GO&lt;br /&gt;
&lt;span style=&quot;color: #993333&quot;&gt;SET&lt;/span&gt; ANSI_NULLS &lt;span style=&quot;color: #993333&quot;&gt;ON&lt;/span&gt; &lt;br /&gt;
GO &lt;/div&gt;&lt;p&gt; &lt;br /&gt;
참조 사이트&lt;br /&gt;
&lt;a href=&quot;http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1247&amp;amp;lngWId=5&quot;&gt;http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1247&amp;amp;lngWId=5&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36961&quot;&gt;http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36961&lt;/a&gt;&lt;/p&gt;</description>
			<category>MS-SQL</category>
			<author> (TTF)</author>
			<guid>http://www.npteam.net/684</guid>
			<comments>http://www.npteam.net/684#entry684comment</comments>
			<pubDate>Sat, 11 Oct 2008 00:24:15 +0900</pubDate>
		</item>
		<item>
			<title>[DB] ADO Connection String</title>
			<link>http://www.npteam.net/680</link>
			<description>Text&lt;br /&gt;
&lt;a href=&quot;http://www.codemaker.co.uk/it/tips/ado_conn.htm#OLEDBProviderForTextFiles&quot;&gt;http://www.codemaker.co.uk/it/tips/ado_conn.htm#OLEDBProviderForTextFiles&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Excel&lt;br /&gt;
&lt;a href=&quot;http://www.codemaker.co.uk/it/tips/ado_conn.htm#ODBCDriverForExcel&quot;&gt;http://www.codemaker.co.uk/it/tips/ado_conn.htm#ODBCDriverForExcel&lt;/a&gt;</description>
			<category>DATABASE</category>
			<author> (TTF)</author>
			<guid>http://www.npteam.net/680</guid>
			<comments>http://www.npteam.net/680#entry680comment</comments>
			<pubDate>Tue, 30 Sep 2008 07:24:58 +0900</pubDate>
		</item>
		<item>
			<title>[폰트] 프로그래머 폰트 모음</title>
			<link>http://www.npteam.net/679</link>
			<description>프로그래머 폰트 모음&lt;br /&gt;
&lt;font color=&quot;#0066cc&quot;&gt;VeraMono.ttf + 맑은 고딕&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://gyuha.tistory.com/207&quot;&gt;http://gyuha.tistory.com/207&lt;/a&gt;</description>
			<category>프로그래밍</category>
			<author> (TTF)</author>
			<guid>http://www.npteam.net/679</guid>
			<comments>http://www.npteam.net/679#entry679comment</comments>
			<pubDate>Mon, 29 Sep 2008 11:55:56 +0900</pubDate>
		</item>
		<item>
			<title>[VS2005] 현재 편집 중인 문서 솔루션 익스플로러에서 찾기</title>
			<link>http://www.npteam.net/677</link>
			<description>&lt;div align=&quot;right&quot;&gt;출처 : &lt;a href=&quot;http://serious-code.net/moin.cgi/VisualStudioMacro&quot;&gt;http://serious-code.net/moin.cgi/VisualStudioMacro&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both; margin-bottom: 10px&quot;&gt;&lt;a href=&quot;http://www.npteam.net/attachment/3682200461.vb&quot;&gt;&lt;img src=&quot;http://www.npteam.net/image/unknown.gif&quot; alt=&quot;&quot; align=&quot;bottom&quot;/&gt; SolutionExplorer.vb&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;&lt;div class=&quot;text&quot; style=&quot;border-right: #d0d0d0 1px solid; padding-right: 5px; border-top: #d0d0d0 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; border-left: #d0d0d0 1px solid; color: #000066; line-height: 120%; padding-top: 5px; border-bottom: #d0d0d0 1px solid; font-family: 굴림체; background-color: #f0f0f0&quot;&gt;Imports System&lt;br /&gt;
Imports EnvDTE&lt;br /&gt;
Imports EnvDTE80&lt;br /&gt;
Imports System.Diagnostics&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Public Module SolutionExplorer&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; Sub FindInSolution()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim p = DTE.Properties(&quot;Environment&quot;, &quot;ProjectsAndSolution&quot;).Item(&quot;TrackFileSelectionInExplorer&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p.value = 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p.value = 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; Sub CollapseNode(ByRef item As UIHierarchyItem)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim subitem As UIHierarchyItem&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each subitem In item.UIHierarchyItems&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If (subitem.UIHierarchyItems.Expanded = True) Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CollapseNode(subitem)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; subitem.UIHierarchyItems.Expanded = False&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; Sub CollapseAll()&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#039; Get the the Solution Explorer tree&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim UIHSolutionExplorer As UIHierarchy&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UIHSolutionExplorer = DTE.Windows.Item(EnvDTE.Constants.vsext_wk_SProjectWindow).Object()&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#039; Check if there is any open solution&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If (UIHSolutionExplorer.UIHierarchyItems.Count = 0) Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#039; MsgBox(&quot;Nothing to collapse. You must have an open solution.&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#039; Get the top node (the name of the solution)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim UIHSolutionRootNode As UIHierarchyItem&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UIHSolutionRootNode = UIHSolutionExplorer.UIHierarchyItems.Item(1)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CollapseNode(UIHSolutionRootNode)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#039; Select the solution node, or else when you click on the solution window&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#039; scrollbar, it will synchronize the open document with the tree and pop&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#039; out the corresponding node which is probably not what you want.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UIHSolutionRootNode.Select(vsUISelectionType.vsUISelectionTypeSelect)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
End Module&lt;/div&gt;&amp;nbsp;</description>
			<category>Tip&amp;Tech</category>
			<author> (TTF)</author>
			<guid>http://www.npteam.net/677</guid>
			<comments>http://www.npteam.net/677#entry677comment</comments>
			<pubDate>Thu, 18 Sep 2008 20:04:09 +0900</pubDate>
		</item>
		<item>
			<title>[WMI] DEP에 프로그램 추가하기</title>
			<link>http://www.npteam.net/674</link>
			<description>&lt;div align=&quot;right&quot;&gt;출처 : &lt;a href=&quot;http://www.npteam.net/674&quot;&gt;http://www.npteam.net/674&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;font color=&quot;#cc9900&quot;&gt;&lt;strong&gt;DEP&lt;/strong&gt;&lt;/font&gt;(Data Execution Prevention : &lt;font color=&quot;#cc9900&quot;&gt;&lt;strong&gt;데이터 실행 방지&lt;/strong&gt;&lt;/font&gt;) 탭에&lt;br /&gt;
일일히 프로그램 경로를 추가해야 하는 경우가 있다.&lt;br /&gt;
&lt;br /&gt;
ATL의 &lt;font color=&quot;#0000ff&quot;&gt;&lt;strong&gt;Thunk&lt;/strong&gt;&lt;/font&gt;로 메시지 Pump를 구현했거나,&lt;br /&gt;
Stack에 Asm으로 코드를 삽입하고 JMP로 EIP를 이동하여 Code Section이 아닌&lt;br /&gt;
&lt;font color=&quot;#d41a01&quot;&gt;&lt;strong&gt;Data Section에서 Code 실행&lt;/strong&gt;&lt;/font&gt;이 이루어질 경우 DEP에 프로그램을 추가하면 해결된다.&lt;br /&gt;
&lt;br /&gt;
그러나 DEP에 프로그램을 추가하는 MS에서 제공하는 옵션이 없기 때문에,&lt;br /&gt;
위와 같은 프로그램을 등록하기 위해선 손이 많이 간다.&lt;br /&gt;
&lt;br /&gt;
아래의 WMI 스크립트를 이용해서 &lt;font color=&quot;#009966&quot;&gt;&lt;strong&gt;Drag And Drop으로 DEP를 추가&lt;/strong&gt;&lt;/font&gt;해 보자!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both; margin-bottom: 10px&quot;&gt;&lt;a href=&quot;http://www.npteam.net/attachment/2142565225.vbs&quot;&gt;&lt;img src=&quot;http://www.npteam.net/image/unknown.gif&quot; alt=&quot;&quot; align=&quot;bottom&quot;/&gt; AddToDep.vbs&lt;/a&gt;&lt;/div&gt; &lt;div class=&quot;text&quot; style=&quot;border-right: #d0d0d0 1px solid; padding-right: 5px; border-top: #d0d0d0 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; border-left: #d0d0d0 1px solid; color: #000066; line-height: 120%; padding-top: 5px; border-bottom: #d0d0d0 1px solid; font-family: 굴림체; background-color: #f0f0f0&quot;&gt;Option Explicit&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039; 기본 Object 가져오기&lt;br /&gt;
Dim Shell : Set Shell = WScript.CreateObject(&quot;WScript.Shell&quot;)&lt;br /&gt;
Dim FSO : Set FSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)&lt;br /&gt;
Dim WshEnv : Set WshEnv = Shell.Environment(&quot;Process&quot;)&lt;br /&gt;
Dim ProgramDir : ProgramDir = WshEnv(&quot;ProgramFiles&quot;)&lt;br /&gt;
Dim SystemRoot : SystemRoot = WshEnv(&quot;Systemroot&quot;)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039;CMD 윈도우 98에서도 적용 가능하게 COMSPEC으로 가져온다.&lt;br /&gt;
Dim COMSPEC : COMSPEC = Shell.ExpandEnvironmentStrings(&quot;%comspec%&quot;)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Dim Exe01 : Exe01 = SystemRoot &amp;amp; &quot;\system32\sysdm.cpl&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039;각 Step별 윈도우 Title 확인&lt;br /&gt;
Const WindowTitleName_01 = &quot;시스템 등록 정보&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039;Main 함수 실행 후 종료&lt;br /&gt;
MainFunction&lt;br /&gt;
Wscript.quit&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Sub MainFunction&lt;br /&gt;
&amp;nbsp; &#039; Argument 검사&lt;br /&gt;
&amp;nbsp; If Wscript.Arguments.Count = 0 Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Shell.Popup &quot;DEP에 추가할 Argument를 입력하지 않았습니다.&quot;, 3, &quot;No Arguments&quot;, 48&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Wscript.quit&lt;br /&gt;
&amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &#039; Step 1. sysdm.cpl 시스템 등록 정보 열기&lt;br /&gt;
&amp;nbsp; Install Exe01, &quot;&quot;&lt;br /&gt;
&amp;nbsp; SendKeys &quot;{ESC}&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; Wscript.sleep 1000&lt;br /&gt;
&amp;nbsp; Install Exe01, &quot;&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &#039; Step 1. &quot;시스템 등록 정보&quot;&lt;br /&gt;
&amp;nbsp; WaitForActiveWindow WindowTitleName_01, 3&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039; SendKeys &quot;{TAB}{TAB}&quot;&lt;br /&gt;
&amp;nbsp; SendKeys &quot;{RIGHT}{RIGHT}{RIGHT}&quot;&lt;br /&gt;
&amp;nbsp; SendKeys &quot;%s&quot;&lt;br /&gt;
&amp;nbsp; SendKeys &quot;{TAB}{TAB}{TAB}{TAB}&quot;&lt;br /&gt;
&amp;nbsp; SendKeys &quot;{RIGHT}{RIGHT}&quot;&lt;br /&gt;
&amp;nbsp; SendKeys &quot;%(ud)&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Wscript.Sleep 500&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SendKeys &quot;%(n)&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &#039;설정파일 경로 구하기&lt;br /&gt;
&amp;nbsp; Dim strAddToDepFile : strAddToDepFile = Wscript.Arguments.Item(0)&lt;br /&gt;
&amp;nbsp; Dim strFileFullPath&lt;br /&gt;
&amp;nbsp; GetFileFullPath strAddToDepFile, strFileFullPath&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; SendKeys strFileFullPath&lt;br /&gt;
&amp;nbsp; Wscript.Sleep 500&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; SendKeys &quot;%o&quot;&lt;br /&gt;
&amp;nbsp; SendKeys &quot;{ENTER}&quot;&lt;br /&gt;
&amp;nbsp; Wscript.Sleep 500&lt;br /&gt;
&amp;nbsp; SendKeys &quot;{ESC}&quot;&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Sub GetFileFullPath(strFileName, strFileFullPath)&lt;br /&gt;
&amp;nbsp; Dim objFile&lt;br /&gt;
&amp;nbsp; Set objFile = FSO.GetFile( strFileName )&lt;br /&gt;
&amp;nbsp; strFileFullPath = FSO.GetAbsolutePathName(objFile)&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Sub Install (InstallFile, Arguments)&lt;br /&gt;
&amp;nbsp; If (FSO.FileExists(InstallFile)) Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Shell.Run COMSPEC &amp;amp; &quot; /c &quot; &amp;amp; InstallFile &amp;amp; Arguments &amp;amp;&quot; &amp;amp; Exit&quot;, 0&lt;br /&gt;
&amp;nbsp; Else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Shell.Popup InstallFile &amp;amp; &quot; 을(를) 찾을 수 없습니다.&quot;, 3, &quot;File dose not exist&quot;, 48&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Wscript.Quit&lt;br /&gt;
&amp;nbsp; End if&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Sub WaitForActiveWindow(WindowName, Second)&lt;br /&gt;
&amp;nbsp; if Second &amp;lt; 0 Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Shell.Popup &quot;음수 시간을 설정할 수 없습니다.&quot;, 3, &quot;Error!&quot;, 48&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Wscript.Quit&lt;br /&gt;
&amp;nbsp; End if&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; Dim TimeOutCount : TimeOutCount = Second * 10&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; Wscript.Sleep 1 &amp;nbsp; &#039;Winxp SP3에서 AppActivate() 버그 임시 해결용 by TTF&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; While ( Shell.AppActivate( WindowName ) = False )&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; if TimeOutCount &amp;lt; 0 Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Shell.Popup WindowName &amp;amp; &quot; 윈도우를 찾을 수 없습니다. 실행을 종료합니다.&quot;, 5, &quot;Can&#039;t Find Window&quot;, 48&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Wscript.Quit&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End if&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; Wscript.Sleep 100&lt;br /&gt;
&amp;nbsp; &amp;nbsp; TimeOutCount = TimeOutCount - 1&lt;br /&gt;
&amp;nbsp; WEnd&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &#039;Winxp SP3에서 AppActivate() 버그 임시 해결용 by TTF&lt;br /&gt;
&amp;nbsp; Wscript.Sleep 1&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039;Shell.SendKeys 위를 Sleep(200)로 감싼다. XP SP3 버그 임시 해결 by TTF&lt;br /&gt;
Sub SendKeys( Keys )&lt;br /&gt;
&amp;nbsp; Wscript.Sleep 200&lt;br /&gt;
&amp;nbsp; Shell.SendKeys Keys&lt;br /&gt;
End Sub&lt;/div&gt;&amp;nbsp;</description>
			<category>WMI 스크립트</category>
			<author> (TTF)</author>
			<guid>http://www.npteam.net/674</guid>
			<comments>http://www.npteam.net/674#entry674comment</comments>
			<pubDate>Tue, 09 Sep 2008 02:29:06 +0900</pubDate>
		</item>
		<item>
			<title>정규식을 써보자!</title>
			<link>http://www.npteam.net/658</link>
			<description>&lt;div align=&quot;right&quot;&gt;출처 : &lt;a href=&quot;http://www.npteam.net/658&quot;&gt;http://www.npteam.net/658&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
정규식을 설명하기 위해서 한가지 예를 들기로 한다.(&lt;a href=&quot;http://www.npteam.net/&quot;&gt;http://www.npteam.net&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;text&quot; style=&quot;border-right: #d0d0d0 1px solid; padding-right: 5px; border-top: #d0d0d0 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; border-left: #d0d0d0 1px solid; color: #000066; line-height: 120%; padding-top: 5px; border-bottom: #d0d0d0 1px solid; font-family: 굴림체; background-color: #f0f0f0&quot;&gt;^ht{2}p:(/{2})w{3}(.)(n.{0,10})(?:com|net|(co.kr))&lt;/div&gt;&lt;ol&gt;&lt;li&gt;문장의 처음은 h로 시작한다. &lt;li&gt;&quot;t&quot;글자가 연속 2번 출력된다. &lt;li&gt;&quot;p:&quot; 가 출력된다. &lt;li&gt;&quot;/&quot;가 연속 2번 출력된다. &lt;li&gt;&quot;w&quot;가 연속 3번 출력된다. &lt;li&gt;아무글자 1글자를 그대로 출력한다. &lt;li&gt;n으로 시작해서 최소 0에서 최대 10글자까지 아무글자나 출력한다. &lt;li&gt;맨 뒤에 종결 문자는 &quot;com&quot;, &quot;net&quot;, &quot;co.kr&quot; 3가지중 하나라도 만족하면 출력한다.&lt;/li&gt;&lt;/ol&gt;&lt;blockquote&gt;윈도우에서 모든것을 표현하는 *문자는 &quot;&lt;font color=&quot;#d41a01&quot;&gt;&lt;strong&gt;.*&lt;/strong&gt;&lt;/font&gt;&quot;로 사용가능하다.&lt;/blockquote&gt;&lt;p&gt;따라서 위의 정규식으로 출력되는 결과를 찾으면 다음과 같이 출력된다.&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var servicePath=&quot;http://www.npteam.net&quot;; var blogURL=&quot;http://www.npteam.net/&quot;;﻿function TTGallery(containerId)
{
	this.containerId = containerId;
	this.container = document.getElementById(this.containerId);
	this.container.style.filter = &quot;progid:DXImageTransform.Microsoft.Fade(duration=0.3, overlap=1.0)&quot;;
	this.container.style.textAlign = &quot;center&quot;;
	this.container.style.width = &quot;100%&quot;;
	this.container.instance = this;

	this.numImages = 0;
	this.imageLoaded = 0;
	this.offset = 0;

	this.src = new Array();
	this.caption = new Array();
	this.width = new Array();
	this.height = new Array();
	this.imageCache = new Array();
};

TTGallery.prototype.appendImage = function(src, caption, width, height)
{
	this.numImages++;

	var imageCache = new Image();
	imageCache.src = src;
	imageCache.onload = function() { var tmp = this.src; };

	this.imageCache[this.imageCache.length] = src;

	this.src[this.src.length] = src;
	this.width[this.width.length] = width;
	this.height[this.height.length] = height;
	this.caption[this.caption.length] = caption;
};

TTGallery.prototype.getCaptiontext = function()
{
	var captionText = this.caption[this.offset];
	captionText = captionText.replace(new RegExp(&quot;&amp;amp;?&quot;, &quot;gi&quot;), &quot;&amp;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;lt;?&quot;, &quot;gi&quot;), &quot;&lt;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;gt;?&quot;, &quot;gi&quot;), &quot;&gt;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;quot;?&quot;, &quot;gi&quot;), &quot;\&quot;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;#39;?&quot;, &quot;gi&quot;), &quot;&#039;&quot;);

	return captionText;
};

TTGallery.prototype.getControl = function()
{
	captionText = this.getCaptiontext();
	var control = document.createElement(&quot;div&quot;);
	control.style.marginBottom = &quot;10px&quot;;
	control.className = &quot;galleryControl&quot;;
	control.style.color = &quot;#777&quot;;
	control.style.font = &quot;bold 0.9em Verdana, Sans-serif&quot;;
	control.innerHTML = &#039;(&#039; + (this.offset + 1) + &#039;/&#039; + this.numImages + &#039;) &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.prev(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_prev.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;PREVIOUS&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;&#039; + this.src[this.offset] + &#039;&quot; rel=&quot;lightbox&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_enlarge.gif&quot; width=&quot;70&quot; height=&quot;19&quot; alt=&quot;ZOOM&quot; title=&quot;&#039; + captionText + &#039;&quot;  style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.next(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_next.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;NEXT&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt;&#039;;
//		control.innerHTML = &#039;(&#039; + (this.offset + 1) + &#039;/&#039; + this.numImages + &#039;) &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.prev(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_prev.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;PREVIOUS&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.showImagePopup1(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_enlarge.gif&quot; width=&quot;70&quot; height=&quot;19&quot; alt=&quot;ZOOM&quot; title=&quot;&#039; + captionText + &#039;&quot;  style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.next(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_next.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;NEXT&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt;&#039;;
//		control.innerHTML = &#039;(&#039; + (this.offset + 1) + &#039;/&#039; + this.numImages + &#039;) &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.prev(); return false&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_prev.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;PREVIOUS&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;&#039; + this.src[this.offset] + &#039;&quot; rel=&quot;lightbox&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_enlarge.gif&quot; width=&quot;70&quot; height=&quot;19&quot; alt=&quot;ZOOM&quot; title=&quot;&#039; + captionText + &#039;&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.next(); return false&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_next.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;NEXT&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt;&#039;;
//	control.innerHTML = &#039;(&#039; + (this.offset + 1) + &#039;/&#039; + this.numImages + &#039;) &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.prev(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_prev.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;PREVIOUS&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.showImagePopup1(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_enlarge.gif&quot; width=&quot;70&quot; height=&quot;19&quot; alt=&quot;ZOOM&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.next(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_next.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;NEXT&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt;&#039;;

	return control;
};

TTGallery.prototype.getImage = function()
{
	var image = document.createElement(&quot;img&quot;);
	image.instance = this;
	image.src = this.src[this.offset];
	image.width = this.width[this.offset];
	image.height = this.height[this.offset];
	image.onclick = this.showImagePopup2;
	image.style.cursor = &quot;pointer&quot;;

	return image;
};

TTGallery.prototype.getCaption = function()
{
	var captionText = this.caption[this.offset];
	captionText = captionText.replace(new RegExp(&quot;&amp;amp;?&quot;, &quot;gi&quot;), &quot;&amp;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;lt;?&quot;, &quot;gi&quot;), &quot;&lt;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;gt;?&quot;, &quot;gi&quot;), &quot;&gt;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;quot;?&quot;, &quot;gi&quot;), &quot;\&quot;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;#39;?&quot;, &quot;gi&quot;), &quot;&#039;&quot;);
	
	var caption = document.createElement(&quot;div&quot;);
	caption.style.textAlign = &quot;center&quot;;
	caption.style.marginTop = &quot;8px&quot;;
	caption.style.color = &quot;#627e89&quot;;
	caption.className = &quot;galleryCaption&quot;;
	caption.appendChild(document.createTextNode(captionText));

	return caption;
};

TTGallery.prototype.getImage = function()
{
	var captionText = this.getCaptiontext();

	var image = document.createElement(&quot;img&quot;);
	image.instance = this;
	image.src = this.src[this.offset];
	image.width = this.width[this.offset];
	image.height = this.height[this.offset];
//	image.onclick = this.showImagePopup2;
	image.style.cursor = &quot;pointer&quot;;
	image.title = &quot;&quot;+captionText+&quot;&quot;;

	var lightboxGallery=document.createElement(&#039;A&#039;);
	lightboxGallery.instance = this;
	lightboxGallery.href = this.src[this.offset];
	lightboxGallery.rel = &quot;lightbox&quot;;
//	lightboxGallery.onclick = lightboxLoad;
//	lightboxGallery.onclick = alert(itest.outerHTML);
	lightboxGallery.appendChild(image);

	return lightboxGallery;
//	return image;
};


TTGallery.prototype.lightboxLoad = function()
{
	document.getElementById(&quot;lightbox&quot;).outerHTML = &quot;&quot;;
	document.getElementById(&quot;overlay&quot;).outerHTML = &quot;&quot;;
//	document.getElementById(&quot;lightboxImage&quot;).outerHTML = &quot;&quot;;

// 아래 부분의 경로를 절대주소(http://로 시작)로 고쳐주세요.
var lightbox_ = new LightBox({
	loadingimg:&#039;http://www.npteam.net/plugins/lightbox/images/loading.gif&#039;,
	expandimg:&#039;http://www.npteam.net/plugins/lightbox/images/expand.gif&#039;,
	shrinkimg:&#039;http://www.npteam.net/plugins/lightbox/images/shrink.gif&#039;,
	effectimg:&#039;http://www.npteam.net/plugins/lightbox/images/zzoop.gif&#039;,
	effectpos:{x:-40,y:-20},
	effectclass:&#039;effectable&#039;,
	closeimg:&#039;http://www.npteam.net/plugins/lightbox/images/close.gif&#039;
});
};
// 여기까지

TTGallery.prototype.show = function(offset)
{
	if(this.numImages == 0) {
		var div = document.createElement(&quot;div&quot;);
		div.style.textAlign = &quot;center&quot;;
		div.style.color = &quot;#888&quot;;
		div.style.margin = &quot;10px auto&quot;;
		div.style.font = &quot;bold 2em/1 Verdana, Sans-serif&quot;;
		div.innerHTML = &quot;NO IMAGES&quot;;
		this.container.appendChild(div);	
		return;
	}

	if(typeof offset == &quot;undefined&quot;)
		this.offset = 0;
	else
	{
		if(offset &lt; 0)
			this.offset = this.numImages -1;
		else if(offset &gt;= this.numImages)
			this.offset = 0;
		else
			this.offset = offset;
	}

	if(this.container.filters)
		this.container.filters[0].Apply();

	this.container.innerHTML = &quot;&quot;;
	this.container.appendChild(this.getControl());
	this.container.appendChild(this.getImage());
	this.container.appendChild(this.getCaption());

	if(this.container.filters)
		this.container.filters[0].Play();
};

TTGallery.prototype.prev = function()
{
	this.show(this.offset-1);
	this.lightboxLoad();
};

TTGallery.prototype.next = function()
{
	this.show(this.offset+1);
	this.lightboxLoad();
};

TTGallery.prototype.showImagePopup1 = function()
{
	this.showImagePopup();
};

TTGallery.prototype.showImagePopup2 = function()
{
	this.instance.showImagePopup();
};

TTGallery.prototype.showImagePopup = function(offset)
{
	try {
		open_img(this.src[this.offset]);
	} catch(e) {
		window.open(this.src[this.offset]);
	}	
};&lt;/script&gt;&lt;div id=&quot;Gallery6581&quot;&gt;&lt;/div&gt;&lt;script type=&quot;text/javascript&quot;&gt;var Gallery6581 = new TTGallery(&quot;Gallery6581&quot;);Gallery6581.appendImage(&quot;http://www.npteam.net/attach/1/8823967230.png&quot;, &quot;&quot;, 440, 72);Gallery6581.show();&lt;/script&gt;&lt;/p&gt;&lt;br /&gt;
이 수식을 이용해서 VBScript에서 이용하려면 다음의 샘플 코드를 사용하시면 됩니다.&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#177fcd&quot;&gt;&lt;strong&gt;■ 정규식에 의해서 일치하는 문장이 있는지 없는지 판단하는 스크립트&lt;br /&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;div class=&quot;text&quot; style=&quot;border-right: #d0d0d0 1px solid; padding-right: 5px; border-top: #d0d0d0 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; border-left: #d0d0d0 1px solid; color: #000066; line-height: 120%; padding-top: 5px; border-bottom: #d0d0d0 1px solid; font-family: 굴림체; background-color: #f0f0f0&quot;&gt;Dim objRegExp&lt;br /&gt;
Set objRegExp = New RegExp&lt;br /&gt;
objRegExp.MultiLine = True&lt;br /&gt;
objRegExp.Pattern = &quot;^ht{2}p:(/{2})w{3}(.)(n.{0,10})(?:com|net|(co.kr))&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
SubjectString = &quot;http://www.npteam.net&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
If objRegExp.Test(SubjectString) Then&lt;br /&gt;
&amp;nbsp; &#039; Successful match&lt;br /&gt;
&amp;nbsp; MsgBox &quot;Success&quot;&lt;br /&gt;
Else&lt;br /&gt;
&amp;nbsp; &#039; Match attempt failed&lt;br /&gt;
&amp;nbsp; MsgBox &quot;Failed&quot;&lt;br /&gt;
End If&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#177fcd&quot;&gt;&lt;strong&gt;■ 정규식에 의해서 일치하는 문장을 리턴받고 싶을 경우&lt;/strong&gt;&lt;/font&gt; &lt;br /&gt;
&lt;div class=&quot;text&quot; style=&quot;border-right: #d0d0d0 1px solid; padding-right: 5px; border-top: #d0d0d0 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; border-left: #d0d0d0 1px solid; color: #000066; line-height: 120%; padding-top: 5px; border-bottom: #d0d0d0 1px solid; font-family: 굴림체; background-color: #f0f0f0&quot;&gt;Dim ObjRegExp, MatchWords, ResultString&lt;br /&gt;
Set ObjRegExp = New RegExp&lt;br /&gt;
ObjRegExp.MultiLine = True&lt;br /&gt;
ObjRegExp.Pattern = &quot;^ht{2}p:(/{2})w{3}(.)(n.{0,10})(?:com|net|(co.kr))&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
SubjectString = &quot;http://www.npteam.net&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Set MatchWords = ObjRegExp.Execute(SubjectString)&lt;br /&gt;
If MatchWords.Count &amp;gt;= 1 Then&lt;br /&gt;
&amp;nbsp; ResultString = MatchWords(0).Value&lt;br /&gt;
Else&lt;br /&gt;
&amp;nbsp; ResultString = &quot;Nothing&quot;&lt;br /&gt;
End If&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
MsgBox ResultString&lt;/div&gt; &lt;br /&gt;
&lt;br /&gt;
이해를 돕기 위해 샘플 정규식을 한가지 소개하고자 한다.&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#177fcd&quot;&gt;&lt;strong&gt;■ 숫자 000 ~ 255&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;
&lt;div class=&quot;text&quot; style=&quot;border-right: #d0d0d0 1px solid; padding-right: 5px; border-top: #d0d0d0 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; border-left: #d0d0d0 1px solid; color: #000066; line-height: 120%; padding-top: 5px; border-bottom: #d0d0d0 1px solid; font-family: 굴림체; background-color: #f0f0f0&quot;&gt;^([01][0-9][0-9]|2[0-4][0-9]|25[0-5])$ &lt;/div&gt;&lt;ol&gt;&lt;li&gt;첫번째 자리의 숫자 (0, 1), 두번째 자리 숫자(0~9), 세번째 자리 숫자(0~9) &lt;li&gt;첫번째 자리의 숫자(2), 두번째 자리 숫자(0~4), 세번째 자리 숫자(0~9) &lt;li&gt;첫번째 자리의 숫자(2), 두번째 자리의 숫자(5), 세번째 자리의 숫자(0~5)&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;결국 각각 다음과 같은 범위를 제한하고 있다.&lt;/p&gt;&lt;blockquote&gt;000 ~ 199, 200 ~ 249, 250 ~ 255&lt;/blockquote&gt;&lt;p&gt;왜 이렇게 3단계로 분류해야 할까? &lt;br /&gt;
정규식은 숫자를 정수로 판단하는 것이 아니라 각각 하나의 문자로 판단하기 때문이다.&lt;br /&gt;
따라서 문자가 올 수 있는 범위를 세부적으로 제한함으로써 위와 같은 결과를 얻을 수 있다.&lt;br /&gt;
&lt;br /&gt;
이외에도 정규식을 활용하면 수 많은 표현을 아주 간결하게 찾아낼 수 있다.&lt;/p&gt; &amp;nbsp;</description>
			<category>소스 코드</category>
			<author> (TTF)</author>
			<guid>http://www.npteam.net/658</guid>
			<comments>http://www.npteam.net/658#entry658comment</comments>
			<pubDate>Tue, 05 Aug 2008 02:07:20 +0900</pubDate>
		</item>
		<item>
			<title>GoogleTest 기본 샘플 프로젝트</title>
			<link>http://www.npteam.net/656</link>
			<description>&lt;div align=&quot;right&quot;&gt;출처 : &lt;a href=&quot;http://www.npteam.net/656&quot;&gt;http://www.npteam.net/656&lt;/a&gt;&lt;/div&gt;&lt;p&gt;구글에서 Test Framework인 &lt;font color=&quot;#0000ff&quot;&gt;Google Test&lt;/font&gt;를 공개하였다.&lt;br /&gt;
&lt;br /&gt;
UnitTest++를 압도하는 획기적인 기능이 포함되어 있는 &lt;font color=&quot;#0000ff&quot;&gt;google test&lt;/font&gt;.&lt;br /&gt;
&lt;br /&gt;
그러나 프로젝트 세팅이 어려워서 테스트 코드를 작성하기 어려우셨던 분들을 위해서,&lt;br /&gt;
&lt;br /&gt;
간단한 &lt;font color=&quot;#008000&quot;&gt;샘플 프로젝트&lt;/font&gt;를 작성하여 올립니다. (&lt;font color=&quot;#d41a01&quot;&gt;&lt;strong&gt;비주얼스튜디오 2005&lt;/strong&gt;&lt;/font&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both; margin-bottom: 10px&quot;&gt;&lt;a href=&quot;http://www.npteam.net/attachment/7876758989.zip&quot;&gt;&lt;img src=&quot;http://www.npteam.net/image/zip.gif&quot; alt=&quot;&quot; align=&quot;&quot;/&gt; GUnitTest.zip&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&quot;도구 -&amp;gt; 옵션 -&amp;gt; 프로젝트 및 솔루션 -&amp;gt; VC++ 디렉터리 -&amp;gt; 다음 파일의 디렉터리 표시 -&amp;gt; 포함파일&quot; 에 아래 설정을 추가해 주세요.&lt;/p&gt;&lt;blockquote&gt;$(SolutionDir)gtest-1.0.1\include&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;
UnitTest++을 사용하셨던 분들은 아래의 명령인수를 추가하시면 입이 딱 벌어질 만한 놀라운 일이 벌어집니다.&lt;/p&gt;&lt;blockquote&gt;--gtest_break_on_failure&lt;/blockquote&gt;&lt;p&gt;&lt;div id=&quot;Gallery6562&quot;&gt;&lt;/div&gt;&lt;script type=&quot;text/javascript&quot;&gt;var Gallery6562 = new TTGallery(&quot;Gallery6562&quot;);Gallery6562.appendImage(&quot;http://www.npteam.net/attach/1/6265871763.png&quot;, &quot;&quot;, 586, 378);Gallery6562.show();&lt;/script&gt;&lt;/p&gt;</description>
			<category>TDD</category>
			<author> (TTF)</author>
			<guid>http://www.npteam.net/656</guid>
			<comments>http://www.npteam.net/656#entry656comment</comments>
			<pubDate>Fri, 11 Jul 2008 23:26:30 +0900</pubDate>
		</item>
		<item>
			<title>[WMI] 시스템 변수 레지스트리 추가하기(환경변수설정)</title>
			<link>http://www.npteam.net/655</link>
			<description>&lt;div align=&quot;right&quot;&gt;출처 : &lt;a href=&quot;http://www.npteam.net/655&quot;&gt;http://www.npteam.net/655&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.npteam.net/643&quot;&gt;[WMI] 비주얼 스튜디오 2005 단축키 설정 불러오기 by TTF&lt;/a&gt; 로 &lt;br /&gt;
비주얼 스튜디오 환경설정 Setting 파일을 이용해서 &lt;br /&gt;
&quot;&lt;font color=&quot;#177fcd&quot;&gt;&lt;strong&gt;단축키 설정&lt;/strong&gt;&lt;/font&gt;&quot;과 &quot;&lt;font color=&quot;#177fcd&quot;&gt;&lt;strong&gt;프로젝트 디렉터리 설정&lt;/strong&gt;&lt;/font&gt;&quot;을 쉽게 불러오는데 성공하였다.&lt;br /&gt;
&lt;br /&gt;
하지만 비주얼 스튜디오 설치 과정에서 괴로운 작업이 한가지 더 있다.&lt;br /&gt;
바로 환경변수에 폴더 경로를 &lt;font color=&quot;#ff0000&quot;&gt;&lt;strong&gt;추가&lt;/strong&gt;&lt;/font&gt;하는 작업.&lt;br /&gt;
&lt;br /&gt;
그렇게 힘들진 않지만 윈도우 단축키와 마우스 컨트롤이 단련되어 있지 않은&lt;br /&gt;
&quot;&lt;font color=&quot;#cc9900&quot;&gt;&lt;strong&gt;특수한&lt;/strong&gt;&lt;/font&gt;&quot; 프로그래머들은 이런 것 하나를 추가하는데에도 고통을 느낀다.(으악~~)&lt;br /&gt;
&lt;br /&gt;
자자 아래와 같이 한방에 등록해 주는 WMI 스크립트!&lt;br /&gt;
이제 비주얼 스튜디오 환경변수 설정할 때 약간(?) 도움을 받을 수 있다. ㅎㅎㅎ&lt;br /&gt;
&lt;br /&gt;
&quot;&lt;font color=&quot;#008000&quot;&gt;&lt;strong&gt;Env_Setting.vbs&lt;/strong&gt;&lt;/font&gt;&quot; 파일만 클릭해 주면,&lt;br /&gt;
현재 &quot;&lt;strong&gt;&lt;font color=&quot;#008000&quot;&gt;Env_Setting.vbs&lt;/font&gt;&lt;/strong&gt;&quot;가 있는 위치의 폴더 경로를 얻어와서,&lt;br /&gt;
그동안 등록하기 불편했던 환경 설정 변수들을 모두 등록 해준다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var servicePath=&quot;http://www.npteam.net&quot;; var blogURL=&quot;http://www.npteam.net/&quot;;﻿function TTGallery(containerId)
{
	this.containerId = containerId;
	this.container = document.getElementById(this.containerId);
	this.container.style.filter = &quot;progid:DXImageTransform.Microsoft.Fade(duration=0.3, overlap=1.0)&quot;;
	this.container.style.textAlign = &quot;center&quot;;
	this.container.style.width = &quot;100%&quot;;
	this.container.instance = this;

	this.numImages = 0;
	this.imageLoaded = 0;
	this.offset = 0;

	this.src = new Array();
	this.caption = new Array();
	this.width = new Array();
	this.height = new Array();
	this.imageCache = new Array();
};

TTGallery.prototype.appendImage = function(src, caption, width, height)
{
	this.numImages++;

	var imageCache = new Image();
	imageCache.src = src;
	imageCache.onload = function() { var tmp = this.src; };

	this.imageCache[this.imageCache.length] = src;

	this.src[this.src.length] = src;
	this.width[this.width.length] = width;
	this.height[this.height.length] = height;
	this.caption[this.caption.length] = caption;
};

TTGallery.prototype.getCaptiontext = function()
{
	var captionText = this.caption[this.offset];
	captionText = captionText.replace(new RegExp(&quot;&amp;amp;?&quot;, &quot;gi&quot;), &quot;&amp;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;lt;?&quot;, &quot;gi&quot;), &quot;&lt;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;gt;?&quot;, &quot;gi&quot;), &quot;&gt;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;quot;?&quot;, &quot;gi&quot;), &quot;\&quot;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;#39;?&quot;, &quot;gi&quot;), &quot;&#039;&quot;);

	return captionText;
};

TTGallery.prototype.getControl = function()
{
	captionText = this.getCaptiontext();
	var control = document.createElement(&quot;div&quot;);
	control.style.marginBottom = &quot;10px&quot;;
	control.className = &quot;galleryControl&quot;;
	control.style.color = &quot;#777&quot;;
	control.style.font = &quot;bold 0.9em Verdana, Sans-serif&quot;;
	control.innerHTML = &#039;(&#039; + (this.offset + 1) + &#039;/&#039; + this.numImages + &#039;) &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.prev(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_prev.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;PREVIOUS&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;&#039; + this.src[this.offset] + &#039;&quot; rel=&quot;lightbox&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_enlarge.gif&quot; width=&quot;70&quot; height=&quot;19&quot; alt=&quot;ZOOM&quot; title=&quot;&#039; + captionText + &#039;&quot;  style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.next(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_next.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;NEXT&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt;&#039;;
//		control.innerHTML = &#039;(&#039; + (this.offset + 1) + &#039;/&#039; + this.numImages + &#039;) &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.prev(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_prev.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;PREVIOUS&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.showImagePopup1(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_enlarge.gif&quot; width=&quot;70&quot; height=&quot;19&quot; alt=&quot;ZOOM&quot; title=&quot;&#039; + captionText + &#039;&quot;  style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.next(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_next.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;NEXT&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt;&#039;;
//		control.innerHTML = &#039;(&#039; + (this.offset + 1) + &#039;/&#039; + this.numImages + &#039;) &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.prev(); return false&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_prev.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;PREVIOUS&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;&#039; + this.src[this.offset] + &#039;&quot; rel=&quot;lightbox&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_enlarge.gif&quot; width=&quot;70&quot; height=&quot;19&quot; alt=&quot;ZOOM&quot; title=&quot;&#039; + captionText + &#039;&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.next(); return false&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_next.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;NEXT&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt;&#039;;
//	control.innerHTML = &#039;(&#039; + (this.offset + 1) + &#039;/&#039; + this.numImages + &#039;) &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.prev(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_prev.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;PREVIOUS&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.showImagePopup1(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_enlarge.gif&quot; width=&quot;70&quot; height=&quot;19&quot; alt=&quot;ZOOM&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt; &lt;a href=&quot;#&quot; onclick=&quot;document.getElementById(\&#039;&#039; + this.containerId + &#039;\&#039;).instance.next(); return false&quot; style=&quot;border: 0px&quot;&gt;&lt;img src=&quot;&#039; + servicePath + &#039;/image/gallery_next.gif&quot; width=&quot;20&quot; height=&quot;16&quot; alt=&quot;NEXT&quot; style=&quot;vertical-align: middle&quot;/&gt;&lt;/a&gt;&#039;;

	return control;
};

TTGallery.prototype.getImage = function()
{
	var image = document.createElement(&quot;img&quot;);
	image.instance = this;
	image.src = this.src[this.offset];
	image.width = this.width[this.offset];
	image.height = this.height[this.offset];
	image.onclick = this.showImagePopup2;
	image.style.cursor = &quot;pointer&quot;;

	return image;
};

TTGallery.prototype.getCaption = function()
{
	var captionText = this.caption[this.offset];
	captionText = captionText.replace(new RegExp(&quot;&amp;amp;?&quot;, &quot;gi&quot;), &quot;&amp;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;lt;?&quot;, &quot;gi&quot;), &quot;&lt;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;gt;?&quot;, &quot;gi&quot;), &quot;&gt;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;quot;?&quot;, &quot;gi&quot;), &quot;\&quot;&quot;);
	captionText = captionText.replace(new RegExp(&quot;&amp;#39;?&quot;, &quot;gi&quot;), &quot;&#039;&quot;);
	
	var caption = document.createElement(&quot;div&quot;);
	caption.style.textAlign = &quot;center&quot;;
	caption.style.marginTop = &quot;8px&quot;;
	caption.style.color = &quot;#627e89&quot;;
	caption.className = &quot;galleryCaption&quot;;
	caption.appendChild(document.createTextNode(captionText));

	return caption;
};

TTGallery.prototype.getImage = function()
{
	var captionText = this.getCaptiontext();

	var image = document.createElement(&quot;img&quot;);
	image.instance = this;
	image.src = this.src[this.offset];
	image.width = this.width[this.offset];
	image.height = this.height[this.offset];
//	image.onclick = this.showImagePopup2;
	image.style.cursor = &quot;pointer&quot;;
	image.title = &quot;&quot;+captionText+&quot;&quot;;

	var lightboxGallery=document.createElement(&#039;A&#039;);
	lightboxGallery.instance = this;
	lightboxGallery.href = this.src[this.offset];
	lightboxGallery.rel = &quot;lightbox&quot;;
//	lightboxGallery.onclick = lightboxLoad;
//	lightboxGallery.onclick = alert(itest.outerHTML);
	lightboxGallery.appendChild(image);

	return lightboxGallery;
//	return image;
};


TTGallery.prototype.lightboxLoad = function()
{
	document.getElementById(&quot;lightbox&quot;).outerHTML = &quot;&quot;;
	document.getElementById(&quot;overlay&quot;).outerHTML = &quot;&quot;;
//	document.getElementById(&quot;lightboxImage&quot;).outerHTML = &quot;&quot;;

// 아래 부분의 경로를 절대주소(http://로 시작)로 고쳐주세요.
var lightbox_ = new LightBox({
	loadingimg:&#039;http://www.npteam.net/plugins/lightbox/images/loading.gif&#039;,
	expandimg:&#039;http://www.npteam.net/plugins/lightbox/images/expand.gif&#039;,
	shrinkimg:&#039;http://www.npteam.net/plugins/lightbox/images/shrink.gif&#039;,
	effectimg:&#039;http://www.npteam.net/plugins/lightbox/images/zzoop.gif&#039;,
	effectpos:{x:-40,y:-20},
	effectclass:&#039;effectable&#039;,
	closeimg:&#039;http://www.npteam.net/plugins/lightbox/images/close.gif&#039;
});
};
// 여기까지

TTGallery.prototype.show = function(offset)
{
	if(this.numImages == 0) {
		var div = document.createElement(&quot;div&quot;);
		div.style.textAlign = &quot;center&quot;;
		div.style.color = &quot;#888&quot;;
		div.style.margin = &quot;10px auto&quot;;
		div.style.font = &quot;bold 2em/1 Verdana, Sans-serif&quot;;
		div.innerHTML = &quot;NO IMAGES&quot;;
		this.container.appendChild(div);	
		return;
	}

	if(typeof offset == &quot;undefined&quot;)
		this.offset = 0;
	else
	{
		if(offset &lt; 0)
			this.offset = this.numImages -1;
		else if(offset &gt;= this.numImages)
			this.offset = 0;
		else
			this.offset = offset;
	}

	if(this.container.filters)
		this.container.filters[0].Apply();

	this.container.innerHTML = &quot;&quot;;
	this.container.appendChild(this.getControl());
	this.container.appendChild(this.getImage());
	this.container.appendChild(this.getCaption());

	if(this.container.filters)
		this.container.filters[0].Play();
};

TTGallery.prototype.prev = function()
{
	this.show(this.offset-1);
	this.lightboxLoad();
};

TTGallery.prototype.next = function()
{
	this.show(this.offset+1);
	this.lightboxLoad();
};

TTGallery.prototype.showImagePopup1 = function()
{
	this.showImagePopup();
};

TTGallery.prototype.showImagePopup2 = function()
{
	this.instance.showImagePopup();
};

TTGallery.prototype.showImagePopup = function(offset)
{
	try {
		open_img(this.src[this.offset]);
	} catch(e) {
		window.open(this.src[this.offset]);
	}	
};&lt;/script&gt;&lt;div id=&quot;Gallery6551&quot;&gt;&lt;/div&gt;&lt;script type=&quot;text/javascript&quot;&gt;var Gallery6551 = new TTGallery(&quot;Gallery6551&quot;);Gallery6551.appendImage(&quot;http://www.npteam.net/attach/1/8330780260.png&quot;, &quot;&quot;, 447, 393);Gallery6551.show();&lt;/script&gt;&lt;br /&gt;
&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both; margin-bottom: 10px&quot;&gt;&lt;a href=&quot;http://www.npteam.net/attachment/7878103182.vbs&quot;&gt;&lt;img src=&quot;http://www.npteam.net/image/unknown.gif&quot; alt=&quot;&quot; align=&quot;bottom&quot;/&gt; Env_Setting.vbs&lt;/a&gt;&lt;/div&gt; &lt;div class=&quot;text&quot; style=&quot;border-right: #d0d0d0 1px solid; padding-right: 5px; border-top: #d0d0d0 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; border-left: #d0d0d0 1px solid; color: #000066; line-height: 120%; padding-top: 5px; border-bottom: #d0d0d0 1px solid; font-family: 굴림체; background-color: #f0f0f0&quot;&gt;Option Explicit&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Dim strComputer : strComputer = &quot;.&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039; 기본 Object 가져오기&lt;br /&gt;
Dim Shell : Set Shell = WScript.CreateObject(&quot;WScript.Shell&quot;)&lt;br /&gt;
Dim FSO : Set FSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)&lt;br /&gt;
Dim WshEnv : Set WshEnv = Shell.Environment(&quot;Process&quot;)&lt;br /&gt;
Dim ProgramDir : ProgramDir = WshEnv(&quot;ProgramFiles&quot;)&lt;br /&gt;
Dim Reg : Set Reg = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\&quot; &amp;amp; strComputer &amp;amp; &quot;\root\default:StdRegProv&quot;)&lt;br /&gt;
Dim WMIService : Set WMIService = GetObject(&quot;winmgmts:\\&quot; &amp;amp; strComputer &amp;amp; &quot;\root\cimv2&quot;)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039;CMD 윈도우 98에서도 적용 가능하게 COMSPEC으로 가져온다.&lt;br /&gt;
Dim COMSPEC : COMSPEC = Shell.ExpandEnvironmentStrings(&quot;%comspec%&quot;)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039;현재 세팅 파일 경로 구하기&lt;br /&gt;
Dim strSetupFile : strSetupFile = &quot;Env_Setting.vbs&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039;Main 함수 실행 후 종료&lt;br /&gt;
MainFunction&lt;br /&gt;
Wscript.quit&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039;Main 함수&lt;br /&gt;
Sub MainFunction&lt;br /&gt;
&#039; 세팅 파일 절대 경로 구하기&lt;br /&gt;
&amp;nbsp; Dim strParentFolderPath&lt;br /&gt;
&amp;nbsp; GetParentFolderPath strSetupFile, strParentFolderPath&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039; 환경 변수 레지스트리 설정&lt;br /&gt;
&amp;nbsp; Const HKEY_CURRENT_USER = &amp;amp;H80000001&lt;br /&gt;
&amp;nbsp; Const HKEY_LOCAL_MACHINE = &amp;amp;H80000002&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; Dim strKeyPath, strValueName, strValue&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &#039;일단 등록하고 아래에서 바로 사용할 수 있도록 Refresh 하자&lt;br /&gt;
&amp;nbsp; strKeyPath = &quot;SYSTEM\CurrentControlSet\Control\Session Manager\Environment&quot;&lt;br /&gt;
&amp;nbsp; strValueName = &quot;TTF_Base&quot;&lt;br /&gt;
&amp;nbsp; strValue = strParentFolderPath&lt;br /&gt;
&amp;nbsp; Reg.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; strKeyPath = &quot;SYSTEM\CurrentControlSet\Control\Session Manager\Environment&quot;&lt;br /&gt;
&amp;nbsp; strValueName = &quot;TTF_Base_Header&quot;&lt;br /&gt;
&amp;nbsp; strValue = &quot;%TTF_Base%\include\Header&quot;&lt;br /&gt;
&amp;nbsp; Reg.SetExpandedStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; strKeyPath = &quot;SYSTEM\CurrentControlSet\Control\Session Manager\Environment&quot;&lt;br /&gt;
&amp;nbsp; strValueName = &quot;TTF_Base_Lib&quot;&lt;br /&gt;
&amp;nbsp; strValue = &quot;%TTF_Base%\Include\Library&quot;&lt;br /&gt;
&amp;nbsp; Reg.SetExpandedStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; strKeyPath = &quot;SYSTEM\CurrentControlSet\Control\Session Manager\Environment&quot;&lt;br /&gt;
&amp;nbsp; strValueName = &quot;TTF_Base_UnitTest&quot;&lt;br /&gt;
&amp;nbsp; strValue = &quot;%TTF_Base%\UnitTest++\src&quot;&lt;br /&gt;
&amp;nbsp; Reg.SetExpandedStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&#039;환경 변수 새로고침(바로 사용 가능하도록 Refresh)&lt;br /&gt;
&amp;nbsp; Dim colItems : Set colItems = WMIService.ExecQuery (&quot;Select * from Win32_Environment WHERE SystemVariable = True&quot;)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; Dim objItem&lt;br /&gt;
&amp;nbsp; For Each objItem in colItems&lt;br /&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objItem.Put_&lt;br /&gt;
&amp;nbsp; Next&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Sub GetParentFolderPath(strFileName, strFileFullPath)&lt;br /&gt;
&amp;nbsp; Dim objFile&lt;br /&gt;
&amp;nbsp; Set objFile = FSO.GetFile( strFileName )&lt;br /&gt;
&amp;nbsp; strFileFullPath = FSO.GetParentFolderName(objFile)&lt;br /&gt;
End Sub&lt;/div&gt;&amp;nbsp;</description>
			<category>WMI 스크립트</category>
			<author> (TTF)</author>
			<guid>http://www.npteam.net/655</guid>
			<comments>http://www.npteam.net/655#entry655comment</comments>
			<pubDate>Thu, 10 Jul 2008 01:40:00 +0900</pubDate>
		</item>
		<item>
			<title>.Net 프로그램 리버스 엔지니어링 하기</title>
			<link>http://www.npteam.net/652</link>
			<description>&lt;div align=&quot;right&quot;&gt;출처 : &lt;a href=&quot;http://www.npteam.net/652&quot;&gt;http://www.npteam.net/652&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
가끔 .net으로 프로그래밍된 것을 볼때가 있다.&lt;br /&gt;
&lt;br /&gt;
OllyDbg로 디버깅 하려고 Dll을 열어봤는데 OTL(털썩) 이건 뭔지...&lt;br /&gt;
&lt;br /&gt;
그래서 도전하기로 했다. IL Dasm 고고싱~&lt;br /&gt;
&lt;br /&gt;
역시 MSDN에는 튜토리얼이 나와 있었다. &lt;br /&gt;
&lt;br /&gt;
Ildasm.exe Tutorial&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa309387(VS.71).aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/aa309387(VS.71).aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
MSIL Disassembler (Ildasm.exe)&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/f7dy01k1(VS.80).aspx(영문판&quot;&gt;http://msdn.microsoft.com/en-us/library/f7dy01k1(VS.80).aspx(영문판&lt;/a&gt;)&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/ko-kr/library/f7dy01k1(VS.80).aspx(한글판&quot;&gt;http://msdn.microsoft.com/ko-kr/library/f7dy01k1(VS.80).aspx(한글판&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
방법: 어셈블리 내용 보기&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/ko-kr/library/ceats605(VS.80).aspx&quot;&gt;http://msdn.microsoft.com/ko-kr/library/ceats605(VS.80).aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Reverse Engineering To Learn .NET Better&lt;br /&gt;
&lt;a href=&quot;http://www.blong.com/Conferences/DCon2003/ReverseEngineering/ReverseEngineering.htm&quot;&gt;http://www.blong.com/Conferences/DCon2003/ReverseEngineering/ReverseEngineering.htm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
자 그럼 ildasm.exe를 받아야 하는데... 설마 .net SDK를 다 받으란 말인가?&lt;br /&gt;
&lt;br /&gt;
결국 MS에서 다운 받았다.(354MB)&lt;br /&gt;
&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&amp;amp;displaylang=en&quot;&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&amp;amp;displaylang=en&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
다운의 압박이 끝나고 설치를 완료하니 ILDASM.exe를 찾을 수 있었다. ㅎㅎ&lt;br /&gt;
118kb짜리 다운로드 받기 위해서 무려 354MB를 다운 받을 수 밖에 없었다.(T_T MS의 압박)&lt;br /&gt;
&lt;br /&gt;
ildasm.exe는 찾았는데... ilasm.exe가 없네.. 쩝..&lt;br /&gt;
&quot;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ilasm.exe&quot; 여기에 있었구나!!&lt;br /&gt;
&lt;br /&gt;
자 이제 다 찾았으니 리버스 엔지니어링 좀 해볼까?&lt;br /&gt;
&lt;br /&gt;
xxx.dll 파일을 xxx.il로 다음과 같이 출력한다.&lt;br /&gt;
&lt;div class=&quot;text&quot; style=&quot;border-right: #d0d0d0 1px solid; padding-right: 5px; border-top: #d0d0d0 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; border-left: #d0d0d0 1px solid; color: #000066; line-height: 120%; padding-top: 5px; border-bottom: #d0d0d0 1px solid; font-family: 굴림체; background-color: #f0f0f0&quot;&gt;ildasm.exe xxx.dll /output:xxx.il&lt;/div&gt;&lt;br /&gt;
그러면 해당 폴더에 리소스 파일 + xxx.il 파일이 생기는 것을 볼 수 있다.&lt;br /&gt;
우리는 notepad로 xxx.il 파일을 수정한 후&lt;br /&gt;
&amp;nbsp; &lt;div class=&quot;text&quot; style=&quot;border-right: #d0d0d0 1px solid; padding-right: 5px; border-top: #d0d0d0 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; border-left: #d0d0d0 1px solid; color: #000066; line-height: 120%; padding-top: 5px; border-bottom: #d0d0d0 1px solid; font-family: 굴림체; background-color: #f0f0f0&quot;&gt;ilasm /dll xxx.il &lt;/div&gt;&lt;br /&gt;
이렇게 Cmd 명령을 입력하면 xxx.dll이 출력된다.&lt;br /&gt;
&lt;br /&gt;
흐흣. .net 리버스 엔지니어링도 결국 어려운게 아니었다.&amp;nbsp;</description>
			<category>Reverse Engineering</category>
			<author> (TTF)</author>
			<guid>http://www.npteam.net/652</guid>
			<comments>http://www.npteam.net/652#entry652comment</comments>
			<pubDate>Tue, 08 Jul 2008 23:33:50 +0900</pubDate>
		</item>
		<item>
			<title>미수다 첫째 줄은 의미가 있는가?</title>
			<link>http://www.npteam.net/651</link>
			<description>웹서핑을 하다가 훌륭한 블로그가 있어서 링크를 걸어 봅니다.&lt;a href=&quot;http://openlook.org/blog/2008/02/17/cb-1201/&quot;&gt;&lt;br /&gt;
http://openlook.org/blog/2008/02/17/cb-1201/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
미수다 첫째 줄은 의미가 있는가? 대해서 나름데로 DB를 만들고 주관적 관점이 포함된 과학적 접근 방법으로 해석한 재미있는 글이었습니다.&lt;br /&gt;
&lt;br /&gt;
모든 수학적, 과학적인 공식과 논리를 초,중,고등학교에서 배우지만 실상 이렇게 실생활에 연관지어서 재미있게 해석해 보려는 시도를 하지 않았던 제 자신이 부끄럽습니다.&lt;br /&gt;
&lt;br /&gt;
창조적인 사고란 이런것이구나 하고 느끼게된 블로그 글이었습니다.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;글이 올라온 지 30일이 지나 새 댓글은 쓸 수 없습니다.&lt;/blockquote&gt;라고 되어 있어서 블로그 링크에 대한 허락은 구하지 못하였지만, 정말 저에게는 고마운 글이었습니다.</description>
			<category>TTF 개인 폴더</category>
			<author> (TTF)</author>
			<guid>http://www.npteam.net/651</guid>
			<comments>http://www.npteam.net/651#entry651comment</comments>
			<pubDate>Mon, 07 Jul 2008 23:20:11 +0900</pubDate>
		</item>
	</channel>
</rss>
