テキストファイルを作成する

カテゴリ: VB.NET
投稿日時:2009/02/02 10:01:02
テキストファイルを作成するには、以下のようにします。
Imports System.IO

Public Class FileSystemForm

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Using stream As New StreamWriter("c:\test\test.txt")
            'テキストファイルに書く
            stream.Write("abcd")

            '1行書く
            stream.WriteLine("最後に改行されます")

        End Using

    End Sub
End Class
このエントリーをはてなブックマークに追加

スポンサード リンク