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

본문 바로가기

vb.net

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

회원사진
하나를하더라도최선을
2020-01-17 15:01 5,498 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

등록된 댓글이 없습니다.
게시판 전체검색