This commit is contained in:
2018-07-26 20:09:05 +00:00
parent 280239604c
commit 18e851c9c2
3 changed files with 165 additions and 23 deletions

37
util/OpsDiagnostics.cs Normal file
View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
namespace rockfishCore.Util
{
public static class OpsDiagnostics
{
private static HttpClient Client = new HttpClient();
public static bool CheckWebsite(string url, string mustContain)
{
bool Result = false;
var Response = Client.GetAsync(url).Result;
if (Response.IsSuccessStatusCode)
{
var PageText = Response.Content.ReadAsStringAsync().Result;
if(PageText.Contains(mustContain))
{
Result=true;
}
}
return Result;
}
}//eoc
}//eons