2008年9月8日 星期一

vb.net 讀取文字檔案

Dim str1, str2 As String
Dim Cc As Integer
Dim myRead = File.ReadAllLines("c:\3000-04.txt", Encoding.UTF8)
Dim MystreamWiter As StreamWriter = New StreamWriter("c:\3000-04-02.txt", False) Cc = 0
str2 = ""
For Each str1 In myRead
'MsgBox(str1)
str2 = str2 & str1
Cc = Cc + 1
If Cc = 3 Then
MystreamWiter.WriteLine(str2)
Cc = 0
str2 = ""
End If
Next

沒有留言:

張貼留言