コード例 #1
0
ファイル: Program.cs プロジェクト: vudev/AliSearcher
        public void Start()
        {
            // start a thread and start doing some processing
            Console.WriteLine("Thread started, processing..");

            using (var app = new WebApiApplication())
            {
                Console.WriteLine("Work path: " + Config.Pathes.Work);
                Console.WriteLine("Writing in work path: " + (Config.Pathes.WriteAllow ? "allowed" : "DENIED"));
                Console.WriteLine("Admin rights: " + (Config.AdminRights ? "yes" : "no"));

                Console.WriteLine("Init server... Base address: " + app.Address);
                app.Run();
                // Create HttpCient and make a request to api/values
                //HttpClient client = new HttpClient();

                //var response = client.GetAsync(baseAddress + "api/values").Result;

                //Console.WriteLine(response);
                //Console.WriteLine(response.Content.ReadAsStringAsync().Result);
                Console.WriteLine("Listening...");
                while (!exitSystem)
                {
                }
            }
        }
コード例 #2
0
ファイル: Service1.cs プロジェクト: vudev/AliSearcher
 protected override void OnStart(string[] args)
 {
     try
     {
         app = new WebApiApplication();
         app.Run();
     }
     catch (Exception ex) { Catch.Set(ex); }
     base.OnStart(args);
 }