Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {

            if(string.IsNullOrEmpty(this.textBox1.Text))
            {
                LoadingDiskInfo();
                return;
            }

            DirectoryInfo dir = new DirectoryInfo(this.textBox1.Text);

            if (dir.Parent != null)
            {
                string newdir = dir.Parent.FullName;


                Dir tmp = new Dir()
                {
                    DirName = newdir,
                    FileSystemList = new List<FileSystem>(),
                    IsSuccess = false,
                    Msg = ""
                };

                SocketManager.Send(BufferFormatV2.FormatFCA(tmp, Deflate.Compress));
            }
            else
            {
                LoadingDiskInfo();
            }
        }
Exemplo n.º 2
0
        private void GotoDir()
        {
            Dir tmp = new Dir()
            {
                DirName = this.textBox1.Text,
                FileSystemList = new List<FileSystem>(),
                IsSuccess = false,
                Msg = ""
            };

            SocketManager.Send(BufferFormatV2.FormatFCA(tmp, Deflate.Compress));
        }
Exemplo n.º 3
0
        public void GotoDir()
        {
            try
            {
                DirectoryInfo np = new DirectoryInfo(Path + this.textBox1.Text);
                Dir tmp = new Dir()
                {
                    DirName = np.FullName,
                    FileSystemList = new List<FileSystem>(),
                    IsSuccess = false,
                    Msg = ""
                };

                SocketManager.Send(BufferFormatV2.FormatFCA(tmp, Deflate.Compress));
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message);
            }
        }
Exemplo n.º 4
0
        private void listView1_DoubleClick(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0)
            {
                ListViewItem item = listView1.SelectedItems[listView1.SelectedItems.Count - 1];


                string DirName = "";

                FileSystem dirinfo = item.Tag as FileSystem;

                if (dirinfo != null)
                {
                    if (dirinfo.FileType == FileType.Dir)
                    {
                        DirName = dirinfo.FullName;
                    }
                    else
                    {
                        if (MessageBox.Show("是否下载文件:" + dirinfo.Name + "?","提示",MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            FileSystem downFile = (this.listView1.SelectedItems[this.listView1.SelectedItems.Count - 1].Tag as FileSystem);

                            if (downFile != null)
                            {
                                Down down = new Down()
                                {
                                    FullName = downFile.FullName

                                };

                                SocketManager.Send(BufferFormatV2.FormatFCA(down, Deflate.Compress));

                            }

                        }

                        return;
                    }

                }
                else
                {

                    DiskInfo info = item.Tag as DiskInfo;

                    if (info != null)
                        DirName = info.Name;

                }


                Dir tmp = new Dir()
                {
                    DirName=DirName,
                    FileSystemList = new List<FileSystem>(),
                    IsSuccess = false,
                    Msg = ""
                };

                SocketManager.Send(BufferFormatV2.FormatFCA(tmp,Deflate.Compress));
              
            }
        }
Exemplo n.º 5
0
 private void LoadingDiskInfo()
 {
     Dir disk = new Dir();
     SocketManager.Send(BufferFormatV2.FormatFCA(disk,Deflate.Compress));
 }