ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文

  メンテナンス 前画面に戻る

対象スレッド 件名: ディレクトリ作成とファイルコピー
名前: lightbox
処理選択
パスワード

件名 ディレクトリ作成とファイルコピー
名前 lightbox
コメント
http://msdn.microsoft.com/ja-jp/library/system.io.aspx

@DIV
// プロジェクトディレクトリ作成
String targetRoot = this.出力場所.Text + @"\" + this.プロジェクト.Text;
String target = targetRoot + @"\excel_out";
if (Directory.Exists(target)) {
	MessageBox.Show("プロジェクトが既に存在します   ");
	return;
}

// 途中のディレクトリも作成される
Directory.CreateDirectory(target);

String str;

// PHP 用
if (this.PHP.Checked) {
	// excel_out.php
	str = @"\excel_out.php";
	File.Copy(exeDir + @"\sk" + str, targetRoot + str);
	// book.php
	str = @"\book.php";
	File.Copy(exeDir + @"\sk" + str, targetRoot + str);

	// filelist.xml
	str = @"\filelist.xml";
	File.Copy(exeDir + @"\sk\excel_out" + str, target + str);
	// sheet.php
	str = @"\sheet.php";
	File.Copy(exeDir + @"\sk\excel_out" + str, target + str);
	// stylesheet.css
	str = @"\stylesheet.css";
	File.Copy(exeDir + @"\sk\excel_out" + str, target + str);
}
// ASP 用
if (this.ASP.Checked) {
	// excel_out.php
	str = @"\excel_out.asp";
	File.Copy(exeDir + @"\sk" + str, targetRoot + str);
	// book.php
	str = @"\book.inc";
	File.Copy(exeDir + @"\sk" + str, targetRoot + str);

	// filelist.xml
	str = @"\filelist.xml";
	File.Copy(exeDir + @"\sk\excel_out" + str, target + str);
	// sheet.php
	str = @"\sheet.asp";
	File.Copy(exeDir + @"\sk\excel_out" + str, target + str);
	// stylesheet.css
	str = @"\stylesheet.css";
	File.Copy(exeDir + @"\sk\excel_out" + str, target + str);
}
@END