Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

49 rindas
1.4 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Diagnostics;
  6. using System.Linq;
  7. using System.Reflection;
  8. using System.ServiceProcess;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using Learun.Loger;
  12. using Learun.Util;
  13. using Microsoft.AspNet.SignalR;
  14. using Microsoft.Owin;
  15. using Microsoft.Owin.Cors;
  16. using Microsoft.Owin.Hosting;
  17. using Owin;
  18. [assembly: OwinStartup(typeof(Quanjiang.DigitalSchool.IMServerService.Startup1))]
  19. namespace Quanjiang.DigitalSchool.IMServerService
  20. {
  21. public partial class QuanjiangDigitalSchollIMService : ServiceBase
  22. {
  23. private Log log = LogFactory.GetLogger("QuanjiangDigitalSchollIMService");
  24. public QuanjiangDigitalSchollIMService()
  25. {
  26. InitializeComponent();
  27. }
  28. protected override void OnStart(string[] args)
  29. {
  30. string SignalRURI = Config.GetValue("IMUrl");
  31. try
  32. {
  33. WebApp.Start(SignalRURI);
  34. log.Info(new { Browser = "QuanjiangDigitalSchollIMService", Content = "服务已启动" });
  35. }
  36. catch (Exception e)
  37. {
  38. log.Error(new { Browser = "QuanjiangDigitalSchollIMService", Content = "服务启动异常" + e.Message+e.StackTrace });
  39. }
  40. }
  41. protected override void OnStop()
  42. {
  43. }
  44. }
  45. }