Example #1
0
        //探测使用的方法
        public void TanCe()
        {
            MyYunfileDelegate d = new MyYunfileDelegate(UpdateListUI);

            this.Invoke(d, "开始探测了...\r\n");

            this.afile = PostClass.GetURLFile(this.txtUserURL.Text.Trim(), out this.afolder);

            #region 文件夹部分判断==============

            if (this.afolder.Count > 0)
            {
                this.Invoke(d, "\r\n扫描到了" + this.afolder.Count + "个文件夹地址...\r\n");
                foreach (string item in this.afolder)
                {
                    this.Invoke(d, item + "\n");
                }
            }
            else
            {
                this.Invoke(d, "哈哈!你的运气太差了哦!一个文件夹也没有找到...\n");
            }

            #endregion

            #region 文件部分判断================

            if (this.afile.Count > 0)
            {
                this.Invoke(d, "\r\n扫描到了" + this.afile.Count + "个文件地址...\r\n");
                foreach (string item in this.afile)
                {
                    this.Invoke(d, item + "\n");
                }
            }
            else
            {
                this.Invoke(d, "哈哈!你的运气太差了哦!一个也没有找到...\n");
            }
            #endregion

            string strLab = "文件夹数量:" + afolder.Count + "\r\r" + "文件数量:" + this.afile.Count;

            this.Invoke(d, strLab);
            this.Invoke(d, "扫描完成...\n");
        }
Example #2
0
        public void SaveASV2(object obj)
        {
            MyYunfileDelegate d = new MyYunfileDelegate(UpdateUI);

            Pobject p = (Pobject)obj;

            string[] arrList = p.alist.ToArray(); //文件的地址列表

            string strL        = string.Empty;
            string strUID      = string.Empty; //用户的ID
            string strFID      = string.Empty; //文件的ID
            string strFileName = string.Empty; //文件的名字
            string PostData    = string.Empty;

            //设置cookie
            string strCookies = p.scookie;

            //转换为Cookie对象
            CookieCollection cookies = VTS.Common.NetHelper.CreateCookies(strCookies, p.scookiepath, p.scookieDomain);

            Random rm = new Random();

            int i = 0;

            foreach (string item in arrList)
            {
                #region 1.阶段一:获取文件的ID和用户的ID

                strL        = item.Split('#')[0];
                strFileName = item.Split('#')[1];

                string[] atmep = PostClass.GetUIDFid(strL.Trim(), cookies);

                if (atmep == null)
                {
                    continue;
                }
                strUID = atmep[0];
                strFID = atmep[1];

                this.Invoke(d, "\r\n正在处理用户ID:" + strUID + ",文件ID:" + strFID + "\r\n");

                #endregion

                //让当前的线程歇一会
                if (thSaveV2 != null)
                {
                    this.Invoke(d, "第一次休息中...\n");
                    thSaveV2.Join(rm.Next(400, 900));
                }

                #region 2.阶段二:转存用户的文件信息

                //1.获得Post数据
                PostData = PostClass.CreatePOSTData(strFID, strUID, "/Share", strFileName);

                i++;

                //开始转存
                this.Invoke(d, "\r\n开始转存第" + i + "个文件...\r\n");

                string strCode = VTS.Common.NetHelper.HttpPost(strPOSTUrl, "", PostData, cookies, 1);

                this.Invoke(d, "\r\n成功啦!返回代码:" + strCode + "\r\n");

                this.Invoke(d, "\n********************分割线*******************\n");
                #endregion

                //让当前的线程歇一会
                if (thSaveV2 != null)
                {
                    this.Invoke(d, "第二次在休息中...\n");
                    thSaveV2.Join(rm.Next(300, 900));
                }
            }
            this.Invoke(d, "已经全部搞定了...\n");
        }
Example #3
0
        //开始进行苦逼的操作了
        public void DoWork()
        {
            //当文件处理过多的时候容易中断退出,建议使用小个文件进行转存
            MyYunfileDelegate d = new MyYunfileDelegate(UpdateUI);

            //需要同过一组源代码解析其中的一组 ULR---文件名集合
            this.Invoke(d, "开始工作了了...\n先看看有没有文件夹\r\n");

            List <string> afolder;
            //List<string> afile = PostClass.GetURLFile("http://page1.yunfile.com/ls/lmpbjs1988/", out afolder);
            List <string> afile = PostClass.GetURLFile(this.txtFileURLList.Text.Trim(), out afolder);

            #region 文件夹地址扫描

            if (afolder.Count > 0)
            {
                this.Invoke(d, "\r\n扫描到了" + afolder.Count + "个文件夹地址...\r\n");
                foreach (string item in afolder)
                {
                    this.Invoke(d, item + "\n");
                }
            }
            else
            {
                this.Invoke(d, "\r\n哈哈!你的运气太差了哦!一个也没有找到...\r\n");
            }
            #endregion

            #region 文件列表转存

            if (afile.Count > 0)
            {
                this.Invoke(d, "\r\n共计扫描到" + afile.Count + "个文件地址...\r\n");

                //思路分析:两种参数输入 文件的地址列表  用户的地址【蜘蛛算法 不停的便利获得下一级别 不推荐使用速度较慢】
                this.Invoke(d, "注意!开始进行转存了...\r\n");

                //设置cookie
                string           strCookies = this.txtCookie.Text.Trim();
                CookieCollection cookies    = VTS.Common.NetHelper.CreateCookies(strCookies, "/", "www.yunfile.com");
                this.Invoke(d, "Cookie已经设置完毕,正在进行努力登陆.....\r\n");

                string strUID      = string.Empty;  //用户的ID
                string strFID      = string.Empty;  //文件的ID
                string strFileName = string.Empty;  //文件的名字

                string[] arrList = afile.ToArray(); //文件的地址列表

                Random rm = new Random();

                int i = 0;
                foreach (string item in arrList)
                {
                    #region 1.阶段一:获取文件的ID和用户的ID

                    string strL = item.Split('#')[0];

                    //文件的名字
                    strFileName = item.Split('#')[1];

                    this.Invoke(d, "开始获取文件的ID和用户ID...\r\n");

                    string[] atmep = PostClass.GetUIDFid(strL.Trim(), cookies);

                    //this.Invoke(d, "获取完毕...\r\n进入到转存阶段\r\n**************************************************\r\n");
                    if (atmep != null)
                    {
                        strUID = atmep[0];
                        strFID = atmep[1];
                    }
                    else
                    {
                        this.Invoke(d, "该文件有问题,转存失败了\r\n");
                        continue;
                    }
                    this.Invoke(d, "正在处理第" + i + "个文件,用户ID:" + strUID + ",文件ID:" + strFID + "\r\n");


                    #endregion

                    //让当前的线程歇一会
                    if (yunfilepath != null)
                    {
                        //this.Invoke(d, "第一次休息中...\n");
                        yunfilepath.Join(rm.Next(200, 2000));
                    }

                    #region 2.阶段二:转存用户的文件信息

                    //获得Post数据
                    string PostData = PostClass.CreatePOSTData(strFID, strUID, "/Share", strFileName);

                    i++;

                    //开始转存
                    string strCode = VTS.Common.NetHelper.HttpPost(strPOSTUrl, "", PostData, cookies, 1);

                    this.Invoke(d, "成功啦!返回代码:" + strCode + "\n");

                    this.Invoke(d, "\n********************分割线*******************\n");

                    #endregion

                    //让当前的线程歇一会
                    if (yunfilepath != null)
                    {
                        //this.Invoke(d, "第二次在休息中...\n");
                        yunfilepath.Join(rm.Next(300, 1000));
                    }
                }
                this.Invoke(d, "已经全部搞定了...\n");
            }
            #endregion
        }