Exemple #1
0
        public bool DeleteAsync()
        {
            FileOperationResult result = _client.DeleteFiles(new string[] { _path });

            return(result.errno == 0);

            //return Task.Run(async () =>
            //{
            //    var json = await _netDiskUser.DataServer.SendPacketAsync(new DeleteFilePacket()
            //    {
            //        Token = _netDiskUser.Token,
            //        Path = _path
            //    });
            //    return (int)JObject.Parse(json)["errno"] == 0;
            //});

            /*
             * return Task.Run(async () =>
             * {
             *  var json = await _netDiskUser.DataServer.SendPacketAsync(new CreateLinkPacket()
             *  {
             *      Token = _netDiskUser.Token,
             *      Info = this
             *  });
             *  Console.WriteLine(json);
             *  return true;
             *  return (int)JObject.Parse(json)["errno"] == 0;
             * });
             */
        }