Home > Back-end >  Unable to run code, which master through guidance,
Unable to run code, which master through guidance,

Time:12-02

Import the Java. IO. IOException;
The import okhttp3. FormBody;
The import okhttp3. OkHttpClient;
The import okhttp3. Request;
The import okhttp3. The Response;
Public class App
{
The static String username="Li Risheng";
OkHttpClient client=new OkHttpClient ();
Public static void main (String [] args)
{
The String url="https://448282.yichafen.com/public/queryscore/sqcode/OsDcQn0mNjMxfGYyYzc2ZTc0YjFhNDQ4NjQ2OTZhN2E4ZjQzZDA5ZjkyfDQ0ODI4MgO0O0OO0O0O.html";
Try {
For (int I=200101; i <=202550; I++) {
String STR=new App (), post (url String. The valueOf (I));
If (STR. IndexOf (code name "incorrect") & gt; 1) {
System.out.println(i);
} else {
System. The out. Println (STR);
return;
}
}
} the catch (Exception e) {
System. The out. Println (e);
}
}
The String post (url String, the String kaohao) throws IOException {
FormBody FormBody=new FormBody. Builder ()
. The add (" s_kaohao ", String. The valueOf (kaohao))
. The add (" s_xingming ", username)
.build();
Request the Request=new Request. Builder ()
Url (url)
.post (formBody)
.build();
Try (Response Response=client. NewCall (request). The execute ()) {
Return the response body (). The string ();
}
}
}

CodePudding user response:

What is unable to run code, I copy operation, a page is the result returned