using System;
using System.Collections .Generic ;
using System.ComponentModel ;
using System.Data ;
using System.Drawing ;
using System.Linq ;
using System.IO ;
using System.Text ;
using System.Windows .Forms ;
using System.Globalization ;
using System.Collections ;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1( )
{
InitializeComponent( ) ;
}
private void button1_Click( object sender, EventArgs e)
{
string path = Application.StartupPath + @"\t est01.DAT" ;
//byte配列へ変換
StreamReader ss = new StreamReader( path, Encoding.GetEncoding ( "Shift_JIS" ) ) ;
string text = ss.ReadToEnd ( ) ;
ss.Close ( ) ;
byte[ ] data = Encoding.GetEncoding ( "Shift_JIS" ) .GetBytes ( text) ;
data[ 3 ] = 66 ;
//上書き更新
StreamWriter sw = new StreamWriter( path, false , Encoding.GetEncoding ( "shift_jis" ) ) ;
sw.Write ( Encoding.GetEncoding ( "shift_jis" ) .GetString ( data) ) ;
sw.Close ( ) ;
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uSU87CnVzaW5nIFN5c3RlbS5UZXh0Owp1c2luZyBTeXN0ZW0uV2luZG93cy5Gb3JtczsKdXNpbmcgU3lzdGVtLkdsb2JhbGl6YXRpb247CnVzaW5nIFN5c3RlbS5Db2xsZWN0aW9uczsKCm5hbWVzcGFjZSBXaW5kb3dzRm9ybXNBcHBsaWNhdGlvbjEKewogICAgcHVibGljIHBhcnRpYWwgY2xhc3MgRm9ybTEgOiBGb3JtCiAgICB7CiAgICAgICAgcHVibGljIEZvcm0xKCkKICAgICAgICB7CiAgICAgICAgICAgIEluaXRpYWxpemVDb21wb25lbnQoKTsKICAgICAgICB9CgogICAgICAgIHByaXZhdGUgdm9pZCBidXR0b24xX0NsaWNrKG9iamVjdCBzZW5kZXIsIEV2ZW50QXJncyBlKQogICAgICAgIHsKICAgICAgICAgICAgc3RyaW5nIHBhdGggPSBBcHBsaWNhdGlvbi5TdGFydHVwUGF0aCArIEAiXHRlc3QwMS5EQVQiOwoKICAgICAgICAgICAgLy9ieXRl6YWN5YiX44G45aSJ5o+bCiAgICAgICAgICAgIFN0cmVhbVJlYWRlciBzcyA9IG5ldyBTdHJlYW1SZWFkZXIocGF0aCwgRW5jb2RpbmcuR2V0RW5jb2RpbmcoIlNoaWZ0X0pJUyIpKTsKICAgICAgICAgICAgc3RyaW5nIHRleHQgPSBzcy5SZWFkVG9FbmQoKTsKICAgICAgICAgICAgc3MuQ2xvc2UoKTsKICAgICAgICAgICAgYnl0ZVtdIGRhdGEgPSBFbmNvZGluZy5HZXRFbmNvZGluZygiU2hpZnRfSklTIikuR2V0Qnl0ZXModGV4dCk7CgogICAgICAgICAgICBkYXRhWzNdID0gNjY7CgogICAgICAgICAgICAvL+S4iuabuOOBjeabtOaWsAogICAgICAgICAgICBTdHJlYW1Xcml0ZXIgc3cgPSBuZXcgU3RyZWFtV3JpdGVyKHBhdGgsIGZhbHNlLCBFbmNvZGluZy5HZXRFbmNvZGluZygic2hpZnRfamlzIikpOwogICAgICAgICAgICBzdy5Xcml0ZShFbmNvZGluZy5HZXRFbmNvZGluZygic2hpZnRfamlzIikuR2V0U3RyaW5nKGRhdGEpKTsKICAgICAgICAgICAgc3cuQ2xvc2UoKTsKICAgICAgICB9CiAgICB9Cn0K
compilation info
prog.cs(4,14): error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing an assembly reference?
prog.cs(5,14): error CS0234: The type or namespace name `Drawing' does not exist in the namespace `System'. Are you missing an assembly reference?
prog.cs(9,14): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
Compilation failed: 3 error(s), 0 warnings
stdout