80 likes | 189 Views
// dirctrl.cpp : ƒƒCƒ“ ƒvƒƒWƒFƒNƒg ƒtƒ@ƒCƒ‹‚Å‚·B. #include "stdafx.h". using namespace System;. using namespace System::IO;. int main(array<System::String ^> ^args). {. String^ sinfpath; String^ stgpath; String^ sifdirpath; String^ dateStr; if(args->Length<2){
E N D
// dirctrl.cpp : ƒƒCƒ“ ƒvƒƒWƒFƒNƒg ƒtƒ@ƒCƒ‹‚Å‚·B
{ • String^ sinfpath; • String^ stgpath; • String^ sifdirpath; • String^ dateStr; • if(args->Length<2){ • Console::WriteLine("Full path of the shot_inf.txt file and the root directory of SIF file storage should be specified."); • return 0; • } • sinfpath=args[0]; • stgpath=args[1]; • sifdirpath=stgpath+"sif"; • if(!Directory::Exists(stgpath)){ • Console::WriteLine("SIF directory: [{0}] not found.", sifdirpath); • Console::WriteLine("Please check the path."); • return 0; • } • //read date info. from shot_inf.txt • StreamReader^ sr = gcnew StreamReader(sinfpath); • try{ • dateStr=sr->ReadLine(); • } • finally{ • delete sr; • } • array<String^>^ tmpStr=dateStr->Split(','); //comma is delimiter • sifdirpath=sifdirpath+"\\"+tmpStr[5]; • if(!Directory::Exists(sifdirpath)){ • Directory::CreateDirectory(sifdirpath); • //Console::WriteLine("{0}", sifdirpath); //check • }