コード例 #1
0
 public bool FileExists(string path)
 {
     try
     {
         return(NETFXCOREIOService.GetFileForPathOrURI(path) != null);
     }
     catch
     {
         return(false);
     }
 }
コード例 #2
0
 public void FileDelete(string path)
 {
     if (path == null)
     {
         throw new ArgumentNullException();
     }
     if (path.Trim() == "")
     {
         throw new ArgumentException();
     }
     try
     {
         WindowsRuntimeSystemExtensions.AsTask(NETFXCOREIOService.GetFileForPathOrURI(path).DeleteAsync())
         .Wait();
     }
     catch (Exception ex)
     {
         throw NETFXCOREIOService.GetRethrowException(ex);
     }
 }