.NET/テキストファイルの読込・StreamReader
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* StreamReaderを使ったテキストファイルの読み込み [#ve6349...
StreamReaderを使ったテキストファイルの読み込みのサンプル...
#htmlinsert(windev-top.html)
#contents
* 参考サイト [#g664c97c]
-[[Microsoft|.NET StreamReader クラス>https://docs.micros...
*StreamReaderでテキストファイルを読込 [#h3263786]
C#、Visual Basic(VB)でStreamReaderを使ったサンプルコード...
*関連記事 [#t8f3fd93]
-[[テキストファイルの読込・ReadAllText,ReadAllLines>.NET/...
** C#サンプルコード [#xf2913e8]
using System;
class Program
{
static void Main(string[] args)
{
String hosts = @"C:\Windows\System32\drivers\etc...
try
{
using (System.IO.StreamReader sr = new Syste...
{
String l;
while ((l = sr.ReadLine()) != null)
{
Console.WriteLine(l);
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
** Visual Basic(VB)サンプルコード [#db7c8872]
Module Module1
Sub Main()
Dim hosts As String = "C:\Windows\System32\drive...
Try
Using sr As System.IO.StreamReader = New Sys...
Dim l As String
Do
l = sr.ReadLine()
Console.WriteLine(l)
Loop Until l Is Nothing
End Using
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
End Sub
End Module
** 実行結果 [#f220a188]
以下にStreamReaderを使ったサンプルコードを実行した時のキ...
#ref(01.png)
以上、StreamReader使ってテキストファイルを読み込むサンプ...
#htmlinsert(windev-btm.html)
終了行:
#navi(../)
* StreamReaderを使ったテキストファイルの読み込み [#ve6349...
StreamReaderを使ったテキストファイルの読み込みのサンプル...
#htmlinsert(windev-top.html)
#contents
* 参考サイト [#g664c97c]
-[[Microsoft|.NET StreamReader クラス>https://docs.micros...
*StreamReaderでテキストファイルを読込 [#h3263786]
C#、Visual Basic(VB)でStreamReaderを使ったサンプルコード...
*関連記事 [#t8f3fd93]
-[[テキストファイルの読込・ReadAllText,ReadAllLines>.NET/...
** C#サンプルコード [#xf2913e8]
using System;
class Program
{
static void Main(string[] args)
{
String hosts = @"C:\Windows\System32\drivers\etc...
try
{
using (System.IO.StreamReader sr = new Syste...
{
String l;
while ((l = sr.ReadLine()) != null)
{
Console.WriteLine(l);
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
** Visual Basic(VB)サンプルコード [#db7c8872]
Module Module1
Sub Main()
Dim hosts As String = "C:\Windows\System32\drive...
Try
Using sr As System.IO.StreamReader = New Sys...
Dim l As String
Do
l = sr.ReadLine()
Console.WriteLine(l)
Loop Until l Is Nothing
End Using
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
End Sub
End Module
** 実行結果 [#f220a188]
以下にStreamReaderを使ったサンプルコードを実行した時のキ...
#ref(01.png)
以上、StreamReader使ってテキストファイルを読み込むサンプ...
#htmlinsert(windev-btm.html)
ページ名: