Exemplo n.º 1
0
        static Int32 Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("Please supply a filename to upload.");
                return 1;
            }
            FileInfo file = new FileInfo(args[0]);
            if (!file.Exists)
            {
                Console.WriteLine("The supplied file does not exist.");
                return 2;
            }
            UsenetPosterConfig config = new UsenetPosterConfig();
            UsenetPoster poster = new UsenetPoster(config);
            poster.newUploadSpeedReport += poster_newUploadSpeedReport;
            poster.PostToUsenet(file);

            #if DEBUG       //VS does not halt after execution in debug mode.
            Console.WriteLine("Finished");
            Console.ReadKey();
            #endif

            return 0;
        }
Exemplo n.º 2
0
 public AutoPoster(AutoPosterConfig configuration)
 {
     this.configuration = configuration;
     posterConfiguration = new UsenetPosterConfig();
     poster = new UsenetPoster(posterConfiguration);
     StopRequested = false;
     MyTask = new Task(AutopostingTask, TaskCreationOptions.LongRunning);
 }
Exemplo n.º 3
0
 public PostingThread(UsenetPosterConfig configuration, NewsHostConnectionInfo connectionInfo, 
     Queue<nntpMessage> messageQueue)
 {
     _configuration = configuration;
     _connectionInfo = connectionInfo;
     _messageQueue = messageQueue;
     MyTask = new Task(PostingTask, TaskCreationOptions.LongRunning);
 }
Exemplo n.º 4
0
        public FileToPost(UsenetPosterConfig configuration, FileInfo fileToPost)
        {
            this.configuration = configuration;
            partSize = configuration.YEncPartSize;

            File = fileToPost;
            DetermineTotalParts();
        }
Exemplo n.º 5
0
        public nntpMessagePoster(UsenetPosterConfig configuration)
        {
            this.configuration = configuration;
            connectionInfo = new NewsHostConnectionInfo()
            {
                Address = configuration.NewsGroupAddress,
                Port = configuration.NewsGroupPort,
                UseSsl = configuration.NewsGroupUseSsl,
                Username = configuration.NewsGroupUsername,
                Password = configuration.NewsGroupPassword
            };

            MessagesToPost = new Queue<nntpMessage>();
            PostingThreads = ConstructPostingThreads();
            IsPosting = false;
        }
Exemplo n.º 6
0
 public UsenetPoster(UsenetPosterConfig configuration)
 {
     this.configuration = configuration;
 }