Exemple #1
0
        private void Upload(string uploadFilePath, string PathForServer, DropBox box)
        {
            try
            {
                using (System.IO.FileStream stream = new System.IO.FileStream(uploadFilePath, System.IO.FileMode.Open, System.IO.FileAccess.Read))
                {
                    ServiceReference1.RemoteFileInfo uploadRequestInfo = new RemoteFileInfo();
                    uploadRequestInfo.FileName       = Path.GetFileName(uploadFilePath);
                    uploadRequestInfo.Length         = stream.Length;
                    uploadRequestInfo.FileByteStream = stream;
                    if (Convert.ToDouble(service.GetDiskSize(client).Split(' ')[1]) - (stream.Length / Math.Pow(1024, 3)) < 0)
                    {
                        MessageBox.Show("not enough memory to disk");
                        return;
                    }
                    //  MessageBox.Show(service.Endpoint.Address.ToString());

                    service.UploadFile(uploadRequestInfo.FileName, uploadRequestInfo.Length, PathForServer, uploadRequestInfo.FileByteStream);

                    box.Invoke(box.myDelegate);
                }
            }
            catch
            {
                MessageBox.Show("Error");
            }
        }
Exemple #2
0
 public AuthenticationApplication(DropBox f)
 {
     InitializeComponent();
     this.f = f;
 }