|
|
|
|
俵ÀÌ / 2001-06-20 / ¿ÀÈÄ 10:42:51 / 203.255.3.190
Á¶È¸¼ö : 133
|
[Áú¹®] FSOÀÇ »ç¿ë¿¡¼....¹®Á¦... |
> ¿©·¯°¡Áö ÆÄÀÏÀ» Á¶ÇÕÇÏ¿© ÇϳªÀÇ ÆÄÀÏÀ» ¸¸µé°íÀÚ ÇÕ´Ï´Ù..
>
> ¼±Åÿ¡ µû¶ó...´Ù¸¥ ÆÄÀÏÀ» ÀÐ¾î¼ ÇϳªÀÇ htmÆÄÀÏÀ» ¸¸µé¾î¾ß Çϱ⿡....¿ì¼±Àº include´Â Èûµé°Í °°½À´Ï´Ù.....ÇϳªÀÇ strº¯¼ö¿¡ ÀÌ ÆÄÀÏ(¿Ï¼º.asp¶ó°í ÇÒ¶§)ÀÇ htmlÄÚµùÀ» ´ã¾Æ ´Ù¸¥ ÆÄÀÏ·Î º¸³»Áà¾ß Çϱ⶧¹®¿¡...if(...)then str = <!--#inclue file="ºÎºÐ1.htm"--> end if ¶ó°í ÇÒ¼ö ¾ø±â ¶§¹®ÀÔ´Ï´Ù.(ÀÌ°Ô °¡´ÉÇÑ°¡??)
>
> ±×·¡¼ »ý°¢ÇÑ °ÍÀÌ...FSOÀä...À̸¦ ¼±Åð¡Áö¼ö·Î ·çÇÁ¹®À» µµ´Â ¾È¿¡¼...¼±ÅÃÁ¶°Ç¿¡ µû¶ó ÆÄÀÏÀ» ÀÐ¾î ¿À°Ô²û ÇÏ·Á±¸ Çϴµ¥...ÀÌ·²°æ¿ì CreateObject´Â Çѹø¸¸ ÇØÁÖ¾î¾ß ÇÏ´ÂÁö(·çÇÁ¹® ¹Û¿¡¼)....±×¸®°í FSO¿¡¼ ÆÄÀÏÀ» ¿¾î À̸¦ ´ãÀº º¯¼ö´Â ¾²°í ³ª¼ nullÀ» ½ÃÄÑÁÖ´Â ¿¹Á¦°¡ ¾ø´Âµ¥...À̸¦ null·Î ÇÏ°í ´Ù½Ã ´Ù¸¥ ÆÄÀÏÀ» Àоî¾ß ÇÏ´ÂÁö¿ä...
>
> Set fs = Server.CreateObject("Scripting.FileSystem.Object")
>
> for i=0 to ¼±Åð¡Áö¼ö
> select case selec
> case 1
> Set objFile = fs.OpenTextFile("C:\MyTest\test1.txt",1)
> content = objFile.readall
> str += replace(content,chr(13)&chr(10),"<br>")
> case 2
> Set objFile = fs.OpenTextFile("C:\MyTest\test2.txt",1)
> content = objFile.readall
> str += replace(content,chr(13)&chr(10),"<br>")
> case 3
> Set objFile = fs.OpenTextFile("C:\MyTest\test2.txt",1)
> content = objFile.readall
> str += replace(content,chr(13)&chr(10),"<br>")
> end select
> Next
>
> ÀÌ·¸°Ô ¾²¸é ¾ÈµÉ°Å °°Àºµ¥....¼öÁ¤À̳ª...´Ù¸¥ ÁÁÀº ¹æ¹ýÀ» ¾Æ½Ã´Â ºÐ Á¶¾ð ºÎŹµå¸³´Ï´Ù.
>
-----------------------------------------------------------
¹¹ ÀÌ·¸°Ô Çϼŵµ »ó°üÀº ¾ø½À´Ï´Ù...
´ë½Å¿¡ Scripting.FileSystem.ObjectÀÌ ¾Æ´Ï°í
Scripting.FileSystemObject¶ó°í ÇÏ¼Å¾ß µÇ°í...
str += replace(content,chr(13)&chr(10),"<br>")
ÀÌ·± Ç¥ÇöÀº VB¿¡¼´Â »ç¿ëÇÏÁö ¸øÇÕ´Ï´Ù.... C³ª ÀÚ¹Ù¿¡¼´Â »ç¿ë °¡´ÉÇÏÁö¸¸....
±×¸®°í »ý¼ºÇÑ objFile °´Ã¼´Â set objFile = Nothing Çϴ½ÄÀ¸·Î °´Ã¼¸¦ Á¦°ÅÇØ Áּŵµ µÇ±¸¿ä...
case ´ÙÀ½¿¡ 2¿Í 3ÀÇ ÇÏ´Â ¿ªÈ°ÀÌ °°´Ù¸é case 2, 3À̶ó°í Àû¾î Áּŵµ µË´Ï´Ù.
±×·³..... |
|
|
|