Program.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Newtonsoft.Json;
  2. using System;
  3. using System.Net.Http;
  4. using System.Threading.Tasks;
  5. namespace EVCB_OCPP.WSServer
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. Console.WriteLine("====================================================================================================");
  12. Console.WriteLine("====================================================================================================");
  13. Console.WriteLine("== ==");
  14. Console.WriteLine("== ------------ ----------- ------------- ------------- ==");
  15. Console.WriteLine("== --- --- ---- ---------------- ---------------- ==");
  16. Console.WriteLine("== --- --- ---- ---- --- ---- --- ==");
  17. Console.WriteLine("== --- --- ---- ---- --- ---- --- ==");
  18. Console.WriteLine("== --- --- ---- ---- ------------- ---- ------------- ==");
  19. Console.WriteLine("== --- --- ---- ---- ----------- ---- ----------- ==");
  20. Console.WriteLine("== --- --- ---- ---- ---- ==");
  21. Console.WriteLine("== --- --- ---- ---- ---- ==");
  22. Console.WriteLine("== ----------- ----------- ---- ---- ==");
  23. Console.WriteLine("== ==");
  24. Console.WriteLine("====================================================================================================");
  25. Console.WriteLine("====================================================================================================");
  26. ProtalServer s = new ProtalServer();
  27. Console.WriteLine("Starting Server...");
  28. s.Start();
  29. Console.Read();
  30. }
  31. public static object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
  32. {
  33. DateTime? timevalue = null;
  34. if (reader.Value != null)
  35. {
  36. DateTime date = ((DateTime)reader.Value).ToLocalTime();
  37. timevalue = new DateTime(date.Year, date.Month, date.Day, date.TimeOfDay.Hours, date.TimeOfDay.Minutes, date.TimeOfDay.Seconds, 000);
  38. }
  39. return timevalue;
  40. }
  41. }
  42. }