Esempio n. 1
0
        public int UpFile(String file)
        {
            if (inCheck) {
                fileTransfer ft = new fileTransfer(this.v.wr, this.v.ls);
                ft.add(file);

                ft.transfer();
                return 1;
            } return 0;
        }
Esempio n. 2
0
               private void listView1_DragDrop(object sender, DragEventArgs e)
               {
                   string[] fileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
                   progressBar1.Maximum = fileList.Length;
                   foreach (String file in fileList) {
                       progressBar1.Increment(1);
                       if (File.Exists(file)) {
                           
                           UTF8Encoding enc = new UTF8Encoding();
                           String[] name = file.Split(Path.DirectorySeparatorChar);
                           
                           sending.Visible = true;
                           sending.Text="Sending "+name[name.Length-1]+" ..." ;

                           //wr.sendString("95" + name[name.Length-1]);  depreched :v 

                           fileTransfer ft = new fileTransfer(wr, ls);
                           ft.add(file);
                           ft.transfer();                          
                           listView1.Items.Add(name[name.Length - 1]).Name="f";
                       }
                   } sending.Visible = false;
                   progressBar1.Value = 0;
                   MessageBox.Show("Sending completed");
               }