吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1769|回复: 3
收起左侧

[会员申请] 申请会员ID: 应乘风

[复制链接]
吾爱游客  发表于 2022-11-10 11:17
1、申 请 I D:应乘风
2、个人邮箱:69470630@qq.com
3、原创技术文章:[C#]文件中转站程序及源码



功能介绍:

​在网上看到一款名为DropPoint文件复制中转站”的工具,于是自己尝试仿写一下。并且添加一个移动​文件的功能。

用来提高复制粘贴文件效率的工具,它会给你一个临时中转悬浮框,只需要将一处或多处想要复制的文件拖拽到这个悬浮框,再一次性拖拽至目的地文件夹,就能高效完成复制粘贴及移动文件。

支持拖拽多个文件到悬浮框,并显示文件数量

将悬浮窗内的文件往目标文件夹拖拽即可实现复制,适用于整理文件

主要的功能实现:

1、实现文件拖拽功能,将文件或者文件夹拖拽到软件上

2、实现文件拖拽出来,将文件或目录拖拽到指定的位置

3、实现多文件添加,包含目录及文件

4、添加软件透明背景、软件置顶、文件计数

主要源码:​文件从界面拖出并实现复制及移动功能​:
[C#] 纯文本查看 复制代码
 //定义全局变量
        ArrayList FileNum = new ArrayList();
        private Rectangle dragBox;
 
        private void label1_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                e.Effect = DragDropEffects.Link;
 
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }
        }
 
        
        private void label1_DragDrop(object sender, DragEventArgs e)
        {
            label1.ImageIndex = 2;
 
            FileNum.Add(((Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString());
            label3.Text = "已放入" + FileNum.Count + "个文件";            
        }
        
       
        private void label1_MouseDown(object sender, MouseEventArgs e)
        {
            dragBox = new Rectangle(new Point(e.X - (SystemInformation.DragSize.Width / 2),
                e.Y - (SystemInformation.DragSize.Height / 2)), SystemInformation.DragSize);
        }
 
        private void label1_MouseMove(object sender, MouseEventArgs e)
        {
            if ((e.Button & MouseButtons.Left) == MouseButtons.Left)
            {
 
                if (dragBox != Rectangle.Empty && !dragBox.Contains(e.X, e.Y))
                {
                    if (radioButton1.Checked == true)
                    {
                        string[] files = (string[])FileNum.ToArray(typeof(string));
                        var effect = this.DoDragDrop(new DataObject(DataFormats.FileDrop, files), DragDropEffects.Copy);
                        if (effect == DragDropEffects.Copy)
                        {
                            label3.Text = "文件复制完成";
                            label1.ImageIndex = 1;
                            FileNum.Clear();
                        }
                    }
                    else if (radioButton2.Checked == true)
                    {
                        string[] files = (string[])FileNum.ToArray(typeof(string));
                        var effect = this.DoDragDrop(new DataObject(DataFormats.FileDrop, files), DragDropEffects.Move);
                        if (effect == DragDropEffects.Move)
                        {
                            label3.Text = "文件移动完成";
                            label1.ImageIndex = 1;
                            FileNum.Clear();
                        }
                    }
 
                }
            }
        }
 
        private void label1_MouseUp(object sender, MouseEventArgs e)
        {
            dragBox = Rectangle.Empty;
        }
文件及源码下载地址:链接:https://pan.baidu.com/s/184LoXj68FBGWvKe3U7iMeQ 提取码:6mc8



发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

Hmily 发表于 2022-11-10 11:50
明天就开放注册了,自己到时候来注册吧。
吾爱游客  发表于 2022-11-10 13:49
Hmily 发表于 2022-11-10 11:50
明天就开放注册了,自己到时候来注册吧。

直接注册吗?明天几点

点评

首页和置顶帖都有  详情 回复 发表于 2022-11-10 21:48
Hmily 发表于 2022-11-10 21:48

首页和置顶帖都有

【开放注册公告】吾爱破解论坛2022年11月11日光棍节开放注册公告
https://www.52pojie.cn/thread-1706653-1-1.html
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-4-29 06:01

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表