--- /dev/null
+\r
+Microsoft Visual Studio Solution File, Format Version 10.00\r
+# Visual C# Express 2008\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RenameBatch", "RenameBatch\RenameBatch.csproj", "{68C95640-E62C-4181-B477-AA6A87FE8FD8}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Any CPU = Debug|Any CPU\r
+ Release|Any CPU = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {68C95640-E62C-4181-B477-AA6A87FE8FD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {68C95640-E62C-4181-B477-AA6A87FE8FD8}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {68C95640-E62C-4181-B477-AA6A87FE8FD8}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {68C95640-E62C-4181-B477-AA6A87FE8FD8}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+using System;\r
+using System.Collections.Generic;\r
+using System.IO;\r
+using System.Linq;\r
+using System.Text;\r
+\r
+// $Id: Program.cs 357 2009-10-12 08:56:39Z u6k $\r
+\r
+namespace RenameBatch\r
+{\r
+ class Program\r
+ {\r
+ static void Main(string[] args)\r
+ {\r
+ try\r
+ {\r
+ /*\r
+ * 引数チェック\r
+ */\r
+ if (args.Length != 1)\r
+ {\r
+ throw new ArgumentException("引数が1個ではありません。");\r
+ }\r
+ if (!Directory.Exists(args[0]))\r
+ {\r
+ throw new ArgumentException("引数[0]のフォルダ・パスが存在しません。");\r
+ }\r
+ if (!File.Exists(args[0] + "/before.txt"))\r
+ {\r
+ throw new ArgumentException("before.txtが存在しません。");\r
+ }\r
+ if (!File.Exists(args[0] + "/after.txt"))\r
+ {\r
+ throw new ArgumentException("after.txtが存在しません。");\r
+ }\r
+\r
+ /*\r
+ * before.txt, after.txtを読み込む。\r
+ */\r
+ string[] beforeArray = File.ReadAllLines(args[0] + "/before.txt", Encoding.Default);\r
+ string[] afterArray = File.ReadAllLines(args[0] + "/after.txt", Encoding.Default);\r
+\r
+ if (beforeArray.Length != afterArray.Length)\r
+ {\r
+ throw new ArgumentException("before.txtとafter.txtの行数が異なります。");\r
+ }\r
+\r
+ /*\r
+ * リネームする。\r
+ */\r
+ for (int i = 0; i < beforeArray.Length; i++)\r
+ {\r
+ string beforePath = args[0] + "/" + beforeArray[i];\r
+ string afterPath = args[0] + "/" + afterArray[i];\r
+\r
+ try\r
+ {\r
+ if (File.Exists(beforePath))\r
+ {\r
+ Console.WriteLine("[" + (i + 1) + "/" + beforeArray.Length + "]" + beforePath + " ...ファイル・リネーム成功");\r
+\r
+ File.Move(beforePath, afterPath);\r
+ }\r
+ else if (Directory.Exists(beforePath))\r
+ {\r
+ Console.WriteLine("[" + (i + 1) + "/" + beforeArray.Length + "]" + beforePath + " ...フォルダ・リネーム成功");\r
+\r
+ Directory.Move(beforePath, afterPath);\r
+ }\r
+ else\r
+ {\r
+ Console.WriteLine("[" + (i + 1) + "/" + beforeArray.Length + "]" + beforePath + " ...パス不存在");\r
+ }\r
+ }\r
+ catch (IOException e)\r
+ {\r
+ Console.WriteLine("[" + (i + 1) + "/" + beforeArray.Length + "]" + beforePath + " ...エラー");\r
+ }\r
+ }\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ Console.WriteLine(e.ToString());\r
+\r
+ Console.WriteLine("usage: " + typeof(Program).Assembly.GetName().Name + ".exe [フォルダ・パス]");\r
+ Console.WriteLine(" [フォルダ・パス]\\before.txt ... リネーム前のパス・リスト");\r
+ Console.WriteLine(" [フォルダ・パス]\\after.txt ... リネーム後のパス・リスト");\r
+ }\r
+\r
+ Console.WriteLine("Push Any Key...");\r
+ Console.ReadLine();\r
+ }\r
+ }\r
+}\r
--- /dev/null
+using System.Reflection;\r
+using System.Runtime.CompilerServices;\r
+using System.Runtime.InteropServices;\r
+\r
+// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。\r
+// アセンブリに関連付けられている情報を変更するには、\r
+// これらの属性値を変更してください。\r
+[assembly: AssemblyTitle("RenameBatch")]\r
+[assembly: AssemblyDescription("")]\r
+[assembly: AssemblyConfiguration("")]\r
+[assembly: AssemblyCompany("")]\r
+[assembly: AssemblyProduct("RenameBatch")]\r
+[assembly: AssemblyCopyright("")]\r
+[assembly: AssemblyTrademark("")]\r
+[assembly: AssemblyCulture("")]\r
+\r
+// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから \r
+// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、\r
+// その型の ComVisible 属性を true に設定してください。\r
+[assembly: ComVisible(false)]\r
+\r
+// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です\r
+[assembly: Guid("ae5d37bc-a56b-4e85-b56e-1133c67c4b57")]\r
+\r
+// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:\r
+//\r
+// Major Version\r
+// Minor Version \r
+// Build Number\r
+// Revision\r
+//\r
+// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を \r
+// 既定値にすることができます:\r
+// [assembly: AssemblyVersion("1.0.*")]\r
+[assembly: AssemblyVersion("2009.10.12.*")]\r
+[assembly: AssemblyFileVersion("2009.10.12.0")]\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <PropertyGroup>\r
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
+ <ProductVersion>9.0.30729</ProductVersion>\r
+ <SchemaVersion>2.0</SchemaVersion>\r
+ <ProjectGuid>{68C95640-E62C-4181-B477-AA6A87FE8FD8}</ProjectGuid>\r
+ <OutputType>Exe</OutputType>\r
+ <AppDesignerFolder>Properties</AppDesignerFolder>\r
+ <RootNamespace>RenameBatch</RootNamespace>\r
+ <AssemblyName>一括リネーム</AssemblyName>\r
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
+ <FileAlignment>512</FileAlignment>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+ <DebugSymbols>true</DebugSymbols>\r
+ <DebugType>full</DebugType>\r
+ <Optimize>false</Optimize>\r
+ <OutputPath>bin\Debug\</OutputPath>\r
+ <DefineConstants>DEBUG;TRACE</DefineConstants>\r
+ <ErrorReport>prompt</ErrorReport>\r
+ <WarningLevel>4</WarningLevel>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+ <DebugType>pdbonly</DebugType>\r
+ <Optimize>true</Optimize>\r
+ <OutputPath>bin\Release\</OutputPath>\r
+ <DefineConstants>TRACE</DefineConstants>\r
+ <ErrorReport>prompt</ErrorReport>\r
+ <WarningLevel>4</WarningLevel>\r
+ </PropertyGroup>\r
+ <ItemGroup>\r
+ <Reference Include="System" />\r
+ <Reference Include="System.Core">\r
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
+ </Reference>\r
+ <Reference Include="System.Xml.Linq">\r
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
+ </Reference>\r
+ <Reference Include="System.Data.DataSetExtensions">\r
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
+ </Reference>\r
+ <Reference Include="System.Data" />\r
+ <Reference Include="System.Xml" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <Compile Include="Program.cs" />\r
+ <Compile Include="Properties\AssemblyInfo.cs" />\r
+ </ItemGroup>\r
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
+ Other similar extension points exist, see Microsoft.Common.targets.\r
+ <Target Name="BeforeBuild">\r
+ </Target>\r
+ <Target Name="AfterBuild">\r
+ </Target>\r
+ -->\r
+</Project>
\ No newline at end of file
--- /dev/null
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file