Пример #1
0
 public void Save(ISuspeciousItem record)
 {
     UploadBlobHttpTriggerFunc.
     if (record.ItemType == ItemType.Domain)
     {
     }
     if (record.ItemType == ItemType.Domain)
     {
     }
 }
        //private const string STORAGE_KEY = "XeOy+4HJfX0654tURCv+BC7HLvEO5CN9kH1bWpZrAunYrACg2K6EJ09b0txMWUOtdjnZAnIC1lLUwhRh/Ryn3A==";


        public static async Task <bool> CreateLogFileAsync(ISuspeciousItem record)
        {
            HttpResponseMessage PostResult = new HttpResponseMessage();

            PostResult.StatusCode = HttpStatusCode.BadRequest;
            string content = string.Empty;

            Thread.Sleep(1000);
            using var client = new HttpClient();
            var sendInfo = new { suspeciousItemName = record.ItemName, suspeciousItemDescription = record.ItemDescription };
            var json     = JsonConvert.SerializeObject(sendInfo);

            var data = new StringContent(json, Encoding.UTF8, "application/json");

            PostResult = await client.PostAsync(AZURE_SERVER_URI, data);

            content = await PostResult.Content.ReadAsStringAsync();

            Console.WriteLine(PostResult.StatusCode + " " + content);
            return(PostResult.IsSuccessStatusCode);
        }
Пример #3
0
 public bool PopulateSuspeciousItem(ISuspeciousItem item)
 {
     try
     {
         //_pool.WaitOne();
         if (item is DomainItem)
         {
             PopulateDomainItem(item as DomainItem, eventReset);
         }
         if (item is HashItem)
         {
             PopulateHashItem(item as HashItem, eventReset);
         }
         eventReset.WaitOne();
         //_pool.WaitOne();
         return(true);
     }
     catch (Exception e)
     {
         throw new Exception($"PopulateSuspeciousItem failed due to the below issue:\n{e.InnerException}");
     }
 }