Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string GetIPUpro()
- {
- string reponse = "";
- string IP = "";
- try
- {
- using (var httpClient = new HttpClient())
- {
- using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://uproxy.pro/ip/?api&username=test10&password=th201293&getip=0"))
- {
- var response = httpClient.SendAsync(request);
- reponse = response.Result.Content.ReadAsStringAsync().Result;
- }
- };
- Regex r = new Regex("(?<=\"ip0\": \")(.*?)(?=\")");
- MatchCollection mc = r.Matches(reponse);
- return mc[0].Value;
- }
- catch (Exception ex)
- {
- fillrtb(richTextBox1, "\n" + ex.Message);
- IP = "";
- return IP;
- }
- }
- public bool ChangeIPPro()
- {
- string repone="";
- try
- {
- using (var httpClient = new HttpClient())
- {
- using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://uproxy.pro/ip/?api&username=test10&password=th201293&ip=0"))
- {
- var response = httpClient.SendAsync(request);
- repone = response.Result.Content.ReadAsStringAsync().Result;
- }
- };
- if (repone.Contains("OK"))
- {
- return true;
- }
- else
- {
- fillrtb(richTextBox1, repone+"\n");
- }
- }
- catch (Exception ex)
- {
- fillrtb(richTextBox1, "\n" + ex.Message);
- return false;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement