維克斯討論區
Dim dataFile As New StreamReader("c:\students.txt", System.Text.Encoding.Default)
Dim stickerFile As New StreamWriter("c:\sticker.txt", False, System.Text.Encoding.Default)
Dim str1 As String() = Nothing
Dim line1 As String
Dim sp As String
stickerFile.WriteLine("寄件人 郵遞區號 地址 收件人 電話 地址 列印")
stickerFile.WriteLine("=================================================================================")
Do While dataFile.Peek <> -1
line1 = dataFile.ReadLine()
str1 = Split(line1, ",")
stickerFile.WriteLine(str1(1) + " " + str1(2) + " " + str1(3) + " " + str1(4) + " " + str1(5) + " " + str1(6) + " " + str1(1))
Loop
dataFile.Close()
stickerFile.Close()
Console.WriteLine("郵寄標籤列印完成.存入檔案 c:\sticker.txt")
Console.WriteLine("請按任意鍵結束!")
Console.ReadLine()
|