0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

僕のSystem.IO(VB)

Last updated at Posted at 2020-04-07

自分用の備忘録

使い方

ファイル操作

ファイルを読み込む
'読み込み用でファイルを開く
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(path,encoding)
    'オプション
'path:操作するファイルのパス
'encoding:System.Text.Encoding.GetEncoding("文字コード") 読み取るファイルの文字コードを指定

'ファイルを1行読み込む
Dim Line = sr.ReadLine() 

ファイルに書き込む
Dim sw As System.IO.StreamWriter = New System,IO.StreamWriter(path,append,encoding)
    'オプション
'path:操作するファイルのパス
'append:Trueで追加、Falseで上書き
'encoding:System.Text.Encoding.GetEncoding("文字コード") 読み取るファイルの文字コードを指定

'ファイルに一行書き込む
sw.WriteLine(value)

ファイルを閉じる

sr.Close()

番外編

文字の入力を受け取る

Dim txt As string = InputBox("文字を入力してください")
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?