Beispiel #1
0
 public static void Main(string[] args)
 {
     ms       = new MessagesClass();
     Sessions = new SessionsClass();
     Sessions.add();
     CreateHostBuilder(args).Build().Run();
 }
Beispiel #2
0
        public static void Main(string[] args)
        {
            ms       = new MessagesClass();
            Sessions = new SessionsClass();
            Sessions.LoadFromFile();
            string IP;
            string port;


            if (args.Length > 0)
            {
                IP   = args[0];
                port = args[1];
            }
            else
            {
                Console.Write("Enter IP(or press enter or default):");
                IP = Console.ReadLine();
                if (!string.IsNullOrEmpty(IP))
                {
                    Console.Write("Enter port:");
                    port = Console.ReadLine();
                    Url  = $"http://{IP}:{port}";
                }
            }

            CreateHostBuilder(args).Build().Run();
        }
Beispiel #3
0
 public static void Main(string[] args)
 {
     ms       = new MessagesClass(); //обработка сообщений
     Sessions = new SessionsClass(); // хранение токенов логинов и паролей
     //Sessions.addValera();
     Sessions.LoadFromFile();
     // Console.WriteLine(Sessions.list_tokens.Count);
     CreateHostBuilder(args).Build().Run();
 }
Beispiel #4
0
 public void LoadFromFile(string filename = "data_sessions.json")
 {
     try
     {
         Console.WriteLine("Dannie vigruzheni");
         string json = "";
         using (StreamReader sr = new StreamReader(filename, System.Text.Encoding.Default))
         {
             json = sr.ReadToEnd();
         }
         SessionsClass ses = JsonConvert.DeserializeObject <SessionsClass>(json);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
 }
 public static void Main(string[] args)
 {
     try
     {
         config = IMainFunction.FromJsonFile <Config>("config.json");
     }
     catch
     {
         config = new Config()
         {
             _port = "http://localhost:5000"
         };
     }
     IMainFunction.ToJsonFile("config.json", config);
     ms       = new MessagesClass(); //обработка сообщений
     Sessions = new SessionsClass(); // хранение токенов логинов и паролей
                                     //Sessions.addValera();
     Sessions.LoadFromFile();
     ms.LoadFromFile();
     // Console.WriteLine(Sessions.list_tokens.Count);
     CreateHostBuilder(args).Build().Run();
 }