Add CopyFile, refactor DeleteFile.
This commit is contained in:
@@ -623,11 +623,20 @@ namespace MarketData.Utils
|
||||
{
|
||||
return double.IsNaN(value);
|
||||
}
|
||||
public static void DeleteFile(String pathFileName)
|
||||
public static bool DeleteFile(String pathFileName)
|
||||
{
|
||||
if(!File.Exists(pathFileName))return;
|
||||
try{File.Delete(pathFileName);}catch(Exception){;}
|
||||
if(!File.Exists(pathFileName))return false;
|
||||
try{File.Delete(pathFileName);}catch(Exception){return false;}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool CopyFile(String pathSrcFileName,String pathDstFileName)
|
||||
{
|
||||
if(!File.Exists(pathSrcFileName))return false;
|
||||
try{File.Copy(pathSrcFileName,pathDstFileName);}catch(Exception){return false;}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static DateTime GetRunDate(String strPathFileName)
|
||||
{
|
||||
DateTime runDate=DateTime.Now.Date;
|
||||
|
||||
Reference in New Issue
Block a user