Beispiel #1
0
        public static void UploadURL(TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            string url = InputBox.GetInputText("ShareX - URL to download from and upload");

            if (!string.IsNullOrEmpty(url))
            {
                string filename = URLHelpers.GetFileName(url, true);

                if (!string.IsNullOrEmpty(filename))
                {
                    DownloadAndUploadFile(url, filename, taskSettings);
                }
            }
        }
Beispiel #2
0
        public static void UploadURL(TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            string url = InputBox.GetInputText("ShareX - " + Resources.UploadManager_UploadURL_URL_to_download_from_and_upload);

            if (!string.IsNullOrEmpty(url))
            {
                string filename = URLHelpers.GetFileName(url, true);

                if (!string.IsNullOrEmpty(filename))
                {
                    DownloadAndUploadFile(url, filename, taskSettings);
                }
            }
        }
Beispiel #3
0
        public static void UploadURL(TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            string inputText = null;

            string text = ClipboardHelpers.GetText(true);

            if (URLHelpers.IsValidURL(text))
            {
                inputText = text;
            }

            string url = InputBox.GetInputText("ShareX - " + Resources.UploadManager_UploadURL_URL_to_download_from_and_upload, inputText);

            if (!string.IsNullOrEmpty(url))
            {
                DownloadAndUploadFile(url, taskSettings);
            }
        }
        public static void ShowShortenURLDialog(TaskSettings taskSettings = null)
        {
            if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();

            string inputText = null;

            if (Clipboard.ContainsText())
            {
                string text = Clipboard.GetText();

                if (URLHelpers.IsValidURL(text))
                {
                    inputText = text;
                }
            }

            string url = InputBox.GetInputText("ShareX - " + ShareX.Properties.Resources.UploadManager_ShowShortenURLDialog_ShortenURL, inputText, ShareX.Properties.Resources.UploadManager_ShowShortenURLDialog_Shorten);

            if (!string.IsNullOrEmpty(url))
            {
                ShortenURL(url, taskSettings);
            }
        }