.NET テキスト出力 [.NET]

VB.NETでテキストを出力する方法です。

ソース
1
2
3
4
5
6
7
8
9
10
11
#Encoding設定
Dim oEnc As System.Text.Encoding = System.Text.Encoding.UTF8
#書き込むファイルを開く
Dim sOutPath = "c:\test\test.txt"
Dim oSrW As New System.IO.StreamWriter(sOutPath, False, oEnc)
oSrW.Write("テキスト出力")
oSrW.Write(vbTab)   #Tabを挿入
oSrW.Write("Tabを挿入")
oSrW.Write(vbNewLine) #改行
oSrW.Write("改行")
oSrW.Close() #閉じる

以上

コメント

人気の投稿