This commit is contained in:
37
util/OpsDiagnostics.cs
Normal file
37
util/OpsDiagnostics.cs
Normal 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
|
||||
Reference in New Issue
Block a user