📜  将网站下载为字符串 kotlin - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:07.858000             🧑  作者: Mango

代码示例1
try 
{
    URL url = new URL("http://yourwebpage.com");
    // Read all the text returned by the server
    BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
    String str;
    while ((str = in.readLine()) != null) 
    {
     // str is one line of text; readLine() strips the newline character(s)
     // You can use the contain method here.
       if(str.contains(editText.getText().toString))
        {
          You can perform your logic here!!!!!         
        }
    }
    in.close();
} catch (MalformedURLException e) {
} catch (IOException e) {
}

//Manifest