This commit is contained in:
@@ -5,6 +5,8 @@ using System.Linq;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using Amazon.S3;
|
||||
using Amazon.S3.Transfer;
|
||||
|
||||
namespace rockfishCore.Util
|
||||
{
|
||||
@@ -20,15 +22,40 @@ namespace rockfishCore.Util
|
||||
if (Response.IsSuccessStatusCode)
|
||||
{
|
||||
var PageText = Response.Content.ReadAsStringAsync().Result;
|
||||
if(PageText.Contains(mustContain))
|
||||
if (PageText.Contains(mustContain))
|
||||
{
|
||||
Result=true;
|
||||
Result = true;
|
||||
}
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
||||
public static bool CheckSpacesBackupStorage()
|
||||
{
|
||||
|
||||
var SECRET_KEY = "iNwbHr+sK+9is2wmRjIax+rdyEjLNvWKJBYr7w4txkY";
|
||||
var ACCESS_KEY = "CMPAFDNX53OWPC55HBJ4";
|
||||
var HOST_ENDPOINT = "https://nyc3.digitaloceanspaces.com";
|
||||
var BUCKET = "%(bucket)s.nyc3.digitaloceanspaces.com";
|
||||
AmazonS3Config clientConfig=new AmazonS3Config();
|
||||
clientConfig.ServiceURL=HOST_ENDPOINT;
|
||||
IAmazonS3 s3Client = new AmazonS3Client(ACCESS_KEY, SECRET_KEY, clientConfig);
|
||||
var bucketlist=s3Client.ListBucketsAsync().Result;
|
||||
|
||||
// IAmazonS3 amazonS3Client = new
|
||||
// AWSClientFactory.CreateAmazonS3Client("your-spaces-key", "your-spaces-key-secrete",
|
||||
// new AmazonS3Config
|
||||
// {
|
||||
// ServiceURL = "https://nyc3.digitaloceanspaces.com"
|
||||
// }
|
||||
// );
|
||||
// var myBuckets = amazonS3Client.ListBuckets();
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user