Exemple #1
0
        static void Main(string[] args)
        {
            LibNews kek = new LibNews();

            kek.Title       = "Новая Новость";
            kek.ReleaseDate = DateTime.Now;
            kek.TextContent = "Очень интересное описание новости";

            int?proxyPort = 8000;  // 18000;

            if (proxyPort.HasValue)
            {
                // mitmweb --web-port 28000 --listen-port 18000 --mode reverse:http://localhost:13044
                var kk = new NewsServiceClient("BasicHttpBinding_INewsService",
                                               $"http://localhost:{proxyPort.Value}/INewService");
                var ar = kk.SelectAllCategory();
                foreach (var item in ar)
                {
                    Console.WriteLine(item.NameCat);
                }
                kk.CreateNewWithCat(kek, new string[] { "Актуально сейчас", "Актуально всегда" });
                Console.WriteLine("Querying through proxy has been completed");
            }

            Console.ReadLine();
        }
Exemple #2
0
 private void cbCategory_DropDown(object sender, EventArgs e)
 {
     try
     {
         var NSC = new NewsServiceClient("BasicHttpBinding_INewsService",
                                         $"http://{wcfServerIp}/INewService");
         LibCategory[] allCategories = NSC.SelectAllCategory();
         cbCategory.Items.Clear();
         foreach (var category in allCategories)
         {
             cbCategory.Items.Add(category.NameCat);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Server with categories is not connected right now");
     }
 }