|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Imports System.IO
Imports System.Text
Public Class Text
Shared Function Read(ByVal Path As String) As String()
Dim sr As New StreamReader(Path, Encoding.GetEncoding("GB2312"))
Dim list As New List(Of String), s As String
Do While Not sr.EndOfStream
s = sr.ReadLine
If 判断条件 Then list.Add(s)
Loop
sr.Dispose() : sr.Close()
Return list.ToArray
End Function
Shared Sub Write(ByVal Path As String, ByVal s As String)
Dim sw As New StreamWriter(Path, False, Encoding.GetEncoding("GB2312"))
sw.Write(s) : sw.Flush() : sw.Close()
End Sub
End Class |
|