zoukankan      html  css  js  c++  java
  • 触动精灵 alilib

    --gethtml
    function gethtml (url)
    local sz = require("sz")
    local http = require("szocket.http")
    local res, code = http.request(url);
    
    return res
    
    end
    ---------------------------------------------------------------------------
    -- r w a分别为 读 写 追加
    --write 
    function writenew(url,data)
        local  file = io.open(url, "w");
           assert(file);
           file:write(data);
           file:close();
    end
    -----------------------------------------------------------------------------
    --write append
    function writeappend(url,data)
        local  file = io.open(url, "a");
           
           file:write(data);
           file:close();
    end
    ------------------------------------------------------------------------------
    --read to table
    function read(url)
        local x = {}
    local file = io.open(url, "r");
           assert(file);
           local data = file:read(); -- 读取所有内容
           while data do
               table.insert(x,data);
               data = file:read()
           end
          file:close();
          return x 
    end
  • 相关阅读:
    图像相似度
    二维数组 问题 E: 计算鞍点
    Uva
    Uva
    Uva
    Uva
    Uva
    Uva
    Uva
    【转载】2015 Objective-C 三大新特性 | 干货
  • 原文地址:https://www.cnblogs.com/aliblogs/p/5493720.html
Copyright © 2011-2022 走看看