ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦óŪ¶i¤@µ§¸ê®Æ(.TXTÀÉ)?

[µo°Ý] ¦p¦óŪ¶i¤@µ§¸ê®Æ(.TXTÀÉ)?

¥»©«³Ì«á¥Ñ linshin1999 ©ó 2011-1-7 21:47 ½s¿è

­nŪ¤@µ§¸ê®Æ¶i¨Ó,¦ý¤£§@¬° Workbook ªº¤u§@ªí¥Î,¥uŪ¶i¨Ó¹Bºâ¥Î,½Ð°Ý¦p¦ó¼g?

Sub Ū¤Jsys¸ê®ÆÀÉ(ByRef sys_name As String)
    Dim f_stream, f_rec, rec_str
    Set f_stream = CreateObject("Scripting.FileSystemObject")
    Set f_rec = f_stream.GetFile(sys_name)
         rec_str = f_rec.ReadLine
    f_rec.Close
    MsgBox rec_str
End Sub


°õ¦æ¨ì  rec_str = f_rec.ReadLine ·|¥X²{ ª«¥ó¤£¤ä´©¦¹ÄݩʩΤèªk ªº¿ù»~. ½Ð°Ý¦U¦ì«e½ú¦p¦ó¤~¯à§âÀÉ®×Ū¥X¨Ó?.
V98

¦^´_ 1# linshin1999


Input # ³¯­z¦¡
±q¤w¶}±Òªº´`§ÇÀɤ¤Åª¨ú¸ê®Æ¡A¨Ã±N¸ê®Æ«ü©wµ¹ÅܼÆ
VBA»¡©ú½d¨Ò
Dim MyString, MyNumber
Open "TESTFILE" For Input As #1    ' ¶}±Ò¿é¤JÀɮסC
Do While Not EOF(1)    ' °õ¦æ°j°éª½¨ìÀɧÀ¬°¤î¡C
    Input #1, MyString, MyNumber    ' ±N¸ê®ÆŪ¤J¨â­ÓÅܼƤ¤¡C
    Debug.Print MyString, MyNumber    ' ±N¸ê®Æ¦b¡u¥ß§Y¡vµøµ¡¤¤Åã¥Ü¡C
Loop
Close #1    ' Ãö³¬ÀɮסC
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

Hsiehª©¥D ÁÂÁ§A,¯u¬O§Úªº±Ï¬P! ¦¬¨ì¤F,ÁÂÁÂ!.
V98

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD