• 图片下载(直接通过网站url 下载图片)


     /// <summary>
            /// 图片下载
            /// </summary>
            /// <param name="imageList"></param>
            /// <param name="FileDir"></param>
            /// <returns></returns>
            private bool DownloadImage(List<string> imageList, string FileDir)
            {
                bool result = true;
                try
                {
                    foreach (string str in imageList)
                    {

                        if (str.IsMatch("(jpg|gif|png)$"))
                        {
                            Uri uri = new Uri(str);
                            FileInfo fi = new FileInfo(FileDir + uri.AbsolutePath);
                            if (!fi.Directory.Exists)
                            {
                                fi.Directory.Create();
                            }
                            //http://i04.c.aliimg.com/img/ibank/2012/618/641/715146816_109741793.jpg
                            if (!fi.Exists)
                            {
                                System.Net.WebClient wc = new System.Net.WebClient();
                                wc.DownloadFile(str, fi.FullName);
                            }

                        }

                    }
                }
                catch
                {
                    result = false;

                }
                finally
                {

                }
                return result;
            }

  • 相关阅读:
    不可小视视图对效率的影响力
    Maximum Margin Planning
    PhysicsBased Boiling Simulation

    Learning Behavior Styles with Inverse Reinforcement Learning
    Simulating Biped Behaviors from Human Motion Data
    Nearoptimal Character Animation with Continuous Control
    Apprenticeship Learning via Inverse Reinforcement Learning
    回报函数学习的学徒学习综述
    Enabling Realtime Physics Simulation in Future Interactive Entertainment
  • 原文地址:https://www.cnblogs.com/guozhe/p/2997560.html
Copyright © 2020-2023  润新知