본문 바로가기
개발자 커뮤니티에 오신 것을 환영합니다!

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

페이지 정보

profile_image
작성자 하나를하더라도최선을
댓글 0건 조회 29,731회 작성일 20-01-17 15:01

본문

    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

댓글목록

등록된 댓글이 없습니다.


Copyright © program1472 | IT HUB. All rights reserved.