[vb.net] SaveText / 텍스트 문서(txt)로 저장하는 함수

하나를하더라도최선을 2020-01-17 15:01:45 34,663 0 0
    Function SaveText(fPATH As String, TEXT As String, Optional ED As System.Text.Encoding = NothingAs Boolean
        On Error GoTo ErrPass
        Dim File As System.IO.StreamWriter
        If ED Is Nothing Then ED = System.Text.Encoding.Default
        File = My.Computer.FileSystem.OpenTextFileWriter(fPATH, False, ED) '// False = 새로쓰기, True = 이어쓰기
        File.WriteLine(TEXT)
        File.Close()
        SaveText = True
ErrPass:
    End Function

댓글 0개

첫 번째 댓글을 작성해보세요!