示例#1
0
 public override void GetFile(string Remote, string DestinationFilePath)
 {
     using (FileStream fsDestination = new FileStream(DestinationFilePath, FileMode.Create, FileAccess.ReadWrite))
     {
         MediaD.DownloadFile("sdcard\\" + Remote, fsDestination);
     }
 }
示例#2
0
        public override bool DeleteFile(string FilePath)
        {
            try
            {
                if (MediaD.FileExists("sdcard\\" + FilePath))
                {
                    MediaD.DeleteFile("sdcard\\" + FilePath);
                }
            }
            catch (Exception e)
            {
                BVM.QuasarLogger.Error(e.Message);
            }

            return(false);
        }
示例#3
0
        public override bool SendFile(string SourceFilePath, string FilePath)
        {
            string destinationpath = FilePath.Substring(0, FilePath.Length - FilePath.Split('\\')[FilePath.Split('\\').Length - 1].Length);

            if (!MediaD.DirectoryExists("sdcard\\" + destinationpath))
            {
                MediaD.CreateDirectory("sdcard\\" + destinationpath);
            }

            if (MediaD.FileExists("sdcard\\" + FilePath))
            {
                MediaD.DeleteFile("sdcard\\" + FilePath);
            }

            using (FileStream fsSource = new FileStream(SourceFilePath, FileMode.Open, FileAccess.Read))
            {
                MediaD.UploadFile(fsSource, "sdcard\\" + FilePath);
            }
            return(true);
        }
示例#4
0
 public override bool DeleteFolder(string FolderPath)
 {
     MediaD.DeleteDirectory("sdcard\\" + FolderPath, true);
     return(false);
 }
示例#5
0
 public override bool CheckFileExists(string FilePath)
 {
     return(MediaD.FileExists("sdcard\\" + FilePath));
 }
示例#6
0
 public override bool CheckFolderExists(string FolderPath)
 {
     return(MediaD.DirectoryExists("sdcard\\" + FolderPath));
 }
示例#7
0
 public override async Task <bool> VerifyOK()
 {
     MediaD.Connect();
     return(MediaD.IsConnected);
 }