Esempio n. 1
0
 static void Main(string[] args)
 {
     Log($"程序启动,版本:{Module.Version}");
     ConfigHelper.ReadConfig();
     FileQueue.ReadLocalList();
     if (args == null || args.Length == 0)
     {
         int count = FileQueue.Count();
         if (count == 0)
         {
             Log("没有待传文件");
             return;
         }
         else
         {
             Log("继续传本地缓存文件队列...");
             Run();
         }
     }
     else
     {
         string str0 = args[0];
         if (str0 == "-e")
         {
             if (args.Length < 3)
             {
                 Log("请输入 inputfile 和 outputfile");
                 return;
             }
             else
             {
                 string input  = args[1];
                 string output = args[2];
                 double rate   = 256000;
                 if (args.Length >= 4)
                 {
                     rate = double.Parse(args[3]);
                 }
                 EncodeFile(input, output, rate);
                 return;
             }
         }
         else
         {
             string path = args[0];
             Log($"地址为:{path}");
             Run(path);
         }
     }
     Console.ReadLine();
 }
Esempio n. 2
0
 private static async void LoopWork()
 {
     while (true)
     {
         Program.Log($">>检查待传输队列,文件数量{FileQueue.Count()}<<");
         FileQueue file = FileQueue.GetOne();
         if (file != null)
         {
             await UploadWork(file);
         }
         else
         {
             Environment.Exit(0);
         }
     }
 }