zoukankan      html  css  js  c++  java
  • getdata

    public partial class GetData : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {

    //string path = Server.MapPath("~/css/css.css");
    //using (StreamReader sr = new StreamReader(path))
    //{
    // string all_code = sr.ReadToEnd();
    // ArrayList my_list = new ArrayList();
    // //string p = @"http://([w-]+.)+[w-]+(/[w- ./?%&=]*)?";
    // string p = @"background:url((?<ImgUrl>.*?))";
    // //string p = @"(?<=(?:srcs*=s*['""]?|background:s*.*?url()(?!http:))/?([^'""s)]+)";
    // Regex re = new Regex(p, RegexOptions.IgnoreCase);
    // MatchCollection mc = re.Matches(all_code);

    // for (int i = 0; i <= mc.Count - 1; i++)
    // {
    // bool _foo = false;
    // string name = "http://d1mr.com/" + mc[i].ToString().TrimEnd(')').Replace("background:url(", "");
    // //string name = mc[i].ToString();
    // foreach (string list in my_list)
    // {
    // if (name == list)
    // {
    // _foo = true;
    // break;
    // }
    // }//过滤
    // if (!_foo)
    // {
    // try
    // {
    // WebClient wc = new WebClient();
    // wc.DownloadFile(name, Server.MapPath("~/images") + @"" + Path.GetFileName(name));
    // }
    // catch (Exception ex)
    // {

    // }


    // //images
    // //Response.Write(name + " ");
    // }

    // }
    //}

    //string path = Server.MapPath("~/images1");
    //foreach (string item in Directory.GetFiles(path))
    //{
    // //string pageHtml = LeYour.Common.WebCatcher.GetPageData("http://localhost:3333/经典香氛_美容健康_YOKA时尚网.htm");
    // string pageHtml = LeYour.Common.WebCatcher.GetPageData("http://localhost:3333/shoumm/" + Path.GetFileName(item));
    // Regex searchTitle = new Regex("<title>(?<title>[\s\S]*?)<\/title>", RegexOptions.IgnoreCase);
    // Match oM = searchTitle.Match(pageHtml);

    // if (oM.Success)
    // {
    // Response.Write(oM.Groups["title"].Value.Trim());
    // string matchEvents = "<table width="600" border="0" cellpadding="3".*?</table>";
    // string Content = Regex.Match(pageHtml, matchEvents, RegexOptions.Singleline).Value;

    // if (!string.IsNullOrEmpty(Content))
    // {
    // ICommon common = CommonProxy.GetProxy("MeiRong.MeiRong_Temp", "ID");
    // Dictionary<string, object> dict = new Dictionary<string, object>();
    // dict.Add("Title", oM.Groups["title"].Value.Trim());
    // dict.Add("Content", Content);
    // dict.Add("CreateTime", DateTime.Now);
    // common.Insert(dict);
    // //Response.Write(Events);
    // }

    // }

    //}

    //string matchEvents = "(<table width="600" border="0" cellpadding="3".*?</table>)(?:\s*<div align="center">)";


    // string path = Server.MapPath("~/hufu[1].txt");
    // using (StreamReader sr = new StreamReader(path))
    // {
    // string all_code = sr.ReadToEnd();
    // ArrayList my_list = new ArrayList();
    // string p = @"http://([w-]+.)+[w-]+(/[w- ./?%&=]*)?";
    // Regex re = new Regex(p, RegexOptions.IgnoreCase);
    // MatchCollection mc = re.Matches(all_code);

    // for (int i = 0; i <= mc.Count - 1; i++)
    // {
    // bool _foo = false;
    // string name = mc[i].ToString();
    // foreach (string list in my_list)
    // {
    // if (name == list)
    // {
    // _foo = true;
    // break;
    // }
    // }//过滤
    // if (!_foo)
    // {
    // try
    // {
    // WebClient wc = new WebClient();
    // wc.DownloadFile(name, Server.MapPath("~/images") + @"" + Path.GetFileName(name));
    // }
    // catch
    // {

    // }


    // //images
    // //Response.Write(name + " ");
    // }

    // }
    // }
    }

  • 相关阅读:
    给网站添加icon图标
    jquery动态改变元素内容
    jQuery判断checkbox是否选中的3种方法
    jquery datatable设置垂直滚动后,表头(th)错位问题
    网页弹出[Object HTMLDivElement],怎么取值?
    JS获取元素属性和自定义属性
    Thymeleaf显示Map集合数据
    带搜索框的select下拉框
    JQuery获取浏览器窗口的高度和宽度
    鼠标悬停在一个标签上时,显示一段文字
  • 原文地址:https://www.cnblogs.com/zwei1121/p/3409281.html
Copyright © 2011-2022 走看看