ファイル操作

//必須
using System.IO;

//exeファイルをネットワークからMyDocument内へコピーする
string copyFrom = @“\\server\\work\\file.exe";
string copyTO = “c:\\file.exe";
File.Copy(copyFrom, copyTO);

//ファイル削除
File.Delete(copyTO);

//ディレクトリ削除
Directory.Delete(dirMyDoc);

//ファイル存在チェック
String FNAME = “xvax.ini";
if (File.Exists(FNAME) != true) {
	MessageBox.Show(“File not Found “, “File not Found");
	return;
}

//ファイル読み込み
String line;
StreamReader sr = new StreamReader(FNAME);
//1行だけ読み込む
line = sr.ReadLine();

//ファイル書き込み
using (StreamWriter sw = File.CreateText(“書き込み対象ファイル+パス")) {
	sw.WriteLine(“test,test");
	//File Close
	sw.Close();
}