示例#1
0
        public void Execute(object[] parameters)
        {
            RequestClass requestMethod = new RequestClass();
            string       response      = requestMethod.CreateFolder(parameters[1].ToString());
            JObject      obj           = JObject.Parse(response);
            bool         b             = (bool)obj["ok"];

            if (b)
            {
                //Console.WriteLine(string.Format("Folder named {0} was created successfully"), folderName);
                Console.WriteLine("folder was created successfully");
            }
            else
            {
                Console.WriteLine(string.Format("An occured the error while creating named {0}"), parameters[1].ToString()); //parametre gelecek
            }
        }
示例#2
0
        public IList <Profiles> profiles()
        {
            List <Profiles> profile = new List <Profiles>();
            RequestClass    req     = new RequestClass();
            string          data    = req.GetProfiles();
            JObject         obj     = JObject.Parse(data);
            JToken          tok     = obj["Profiles"];

            for (int i = 0; i < tok.Count(); i++)
            {
                profile.Add(new Profiles
                {
                    Id   = (int)tok[i]["Id"],
                    Name = (string)tok[i]["Name"]
                });
            }
            return(profile);
        }
示例#3
0
        public IList <Dir> Folders()
        {
            List <Dir>   folders       = new List <Dir>();
            RequestClass requestMethod = new RequestClass();
            string       data          = requestMethod.GetIndex();
            JObject      jObject       = JObject.Parse(data);
            JToken       jDir          = jObject["Folders"];

            for (int i = 0; i < jDir.Count(); i++)
            {
                string name         = (string)jDir[i]["Name"];
                string createDate   = (string)jDir[i]["CreateDate"];
                string parentFolder = (string)jDir[i]["ParentFolder"];
                Dir    dir          = new Dir
                {
                    Name         = name,
                    CreateDate   = createDate,
                    ParentFolder = parentFolder
                };
                folders.Add(dir);
            }
            return(folders);
        }
示例#4
0
 public void Execute(object[] parameters)
 {
     if (parameters.Length < 2)
     {
         Profiles profiles = new Profiles();
         foreach (var item in profiles.profiles())
         {
             Console.Write(item.Id + "\t");
             Console.Write(item.Name + "\t");
             Console.WriteLine();
         }
     }
     else
     {
         RequestClass req    = new RequestClass();
         string       result = req.CreateFile(int.Parse(parameters[1].ToString()), parameters[2].ToString());
         JObject      obj    = JObject.Parse(result);
         bool         b      = (bool)obj["ok"];
         if (b)
         {
             Console.WriteLine("file was uploaded successfully");
         }
     }
 }
示例#5
0
        public void Execute(object[] parameters)
        {
            RequestClass request = new RequestClass();

            request.Login(parameters[1].ToString(), parameters[2].ToString());
        }
示例#6
0
        public void Execute(object[] parameters)
        {
            RequestClass request = new RequestClass();

            request.ChangeDirectory(parameters[1].ToString());
        }