Пример #1
0
 public void Upload(string path)
 {
     Upload upload = new Upload(path);
     if (loggedin)
     {
         GettShare share = user.Shares.CreateShare(upload.filename);
         GettFile file = share.CreateFile(upload.filename);
         file.UploadFileAsync(upload.path);
         file.UploadProgressChanged += UploadProgressChangedEventHandler;
         file.UploadFileCompleted += UploadFileCompleted;
         System.Windows.Forms.Clipboard.SetText(file.Info.GettUrl);
         Notify("Upload of " + upload.filename +" started. The URL to the download page has been copied to your clipboard.");
     }
     else
     {
         Notify("Upload of " + upload.filename + " failed!");
         MessageBox.Show("Not logged in!");
     }
 }
Пример #2
0
        public void Upload(string path)
        {
            Upload upload = new Upload(path);

            if (loggedin)
            {
                GettShare share = user.Shares.CreateShare(upload.filename);
                GettFile  file  = share.CreateFile(upload.filename);
                file.UploadFileAsync(upload.path);
                file.UploadProgressChanged += UploadProgressChangedEventHandler;
                file.UploadFileCompleted   += UploadFileCompleted;
                System.Windows.Forms.Clipboard.SetText(file.Info.GettUrl);
                Notify("Upload of " + upload.filename + " started. The URL to the download page has been copied to your clipboard.");
            }
            else
            {
                Notify("Upload of " + upload.filename + " failed!");
                MessageBox.Show("Not logged in!");
            }
        }