StreamReader݂̂pȒPȗ܂B
̗ł̓eLXgt@C"C:\test.txt"ׂēǂݍł̓eo͂Ă܂B
łShift JISR[hƂēǂݍł܂B

[VB.NET]
'"C:\test.txt"Shift-JISR[hƂĊJ
System.IO.StreamReader sr =
    New System.IO.StreamReader("C:\test.txt",
        System.Text.Encoding.GetEncoding(932))
'eׂēǂݍ
Dim s As String =  sr.ReadToEnd() 
'
sr.Close()
 
'ʂo͂
Console.WriteLine(s)

[C#]
//"C:\test.txt"Shift-JISR[hƂĊJ
System.IO.StreamReader sr =
    new System.IO.StreamReader(@"C:\test.txt",
        System.Text.Encoding.GetEncoding(932));
//eׂēǂݍ
string s = sr.ReadToEnd();
//
sr.Close();

//ʂo͂
Console.WriteLine(s);

 Encoding ɂĂƐĂ܂傤B
L̗łShift JISEncodingR[hy[Wi932jŎw肵Ă܂A
System.Text.Encoding.GetEncoding("shift-jis")
̂悤ɖOŎw肷邱Ƃo܂B

܂JISEncoding̎ŵ͎悤ɂȂ܂B
System.Text.Encoding.GetEncoding(50220)
܂
System.Text.Encoding.GetEncoding("iso-2022-jp")

EUCEncoding̎ŵ͎悤ɂȂ܂B
System.Text.Encoding.GetEncoding(51932)
܂
System.Text.Encoding.GetEncoding("euc-jp")

Encodingw肵ȂUTF-8Ƃēǂݍ܂܂B

̑̕R[hŕϊƂlGetEncodingœKȃR[hy[W▼Ow肵܂B
̑̃R[hy[WɊւẮAMicrosoft̂̃y[WB

Ɉsǂݍޗ܂B
O̗ƓlAShift-JIS̃eLXgt@C"C:\test.txt"sǂݍł̓eo͂Ă܂B
ReadLine\bhňsǂݍ݁APeek\bhŖmFĂ܂B

[VB.NET]
'"C:\test.txt"Shift-JISR[hƂĊJ
System.IO.StreamReader sr =
    New System.IO.StreamReader("C:\test.txt",
        System.Text.Encoding.GetEncoding(932))
'esǂݍ
While sr.Peek() > -1
    Console.WriteLine(sr.ReadLine())
End While
'
sr.Close()

[C#]
//"C:\test.txt"Shift-JISR[hƂĊJ
System.IO.StreamReader sr =
    new System.IO.StreamReader(@"C:\test.txt",
        System.Text.Encoding.GetEncoding(932));
//esǂݍ
while (sr.Peek() > -1)
{
    Console.WriteLine(sr.ReadLine());
}
//
sr.Close();

=========================================
StreamWriter݂̂pȒPȗ܂B
̗ł̓eLXg{bNXTextBox1̓eeLXgt@C"C:\test.txt"ɏł܂B
łShift JISR[hŕۑ܂B

[VB.NET]
'StreamWriteȑ
't@C㏑AShift JISŏ
StreamWriter sw = New StreamWriter("c:\test.txt", False,
    System.Text.Encoding.GetEncoding(932))
'TextBox1.Text̓eׂď
sw.Write(TextBox1.Text)
'
sw.Close()

[C#]
//StreamWriteȑ
//t@C㏑AShift JISŏ
StreamWriter sw = new StreamWriter("c:\test.txt", false,
    System.Text.Encoding.GetEncoding(932));
//TextBox1.Text̓eׂď
sw.Write(TextBox1.Text);
//
sw.Close();

̂ق̕R[h(JISAEUCȂ)ŕۑ鎞́AKEncodingw肵܂B
EncodingɊւẮuXg[găeLXgt@CǂݍށvQlɂĂB
ȂEncodingȗ́AUTF-8ƂȂ܂B

