예제 #1
0
        async void changedAsync(FileSystemEventArgs e)
        {
            try
            {
                string selectFolder = "";

                for (int i = 0; i < Properties.Settings.Default.selectedFolders.Count; i++)
                {
                    if (e.FullPath.Contains(Properties.Settings.Default.selectedFolders[i]))
                    {
                        selectFolder = Properties.Settings.Default.selectedFolders[i];
                    }
                }

                string name = e.FullPath.Substring(selectFolder.Length + 1);

                string[] Directories = selectFolder.Split('\\');
                string   nameFolder  = Directories.Last();

                if (isFolder(name))
                {
                    if (System.IO.Directory.Exists(e.FullPath))
                    {
                        var folder = await client.createFolderAsync(api, nameFolder + '/' + name);
                    }
                }
                else
                {
                    if (System.IO.File.Exists(e.FullPath))
                    {
                        var folder = await client.addFileAsync(api, nameFolder + '/' + name, e.FullPath);
                    }
                }
            }
            catch (Exception ex) { }
        }