Ejemplo n.º 1
0
        private FtpParametr GetFtp(int ServerID)
        {
            ApplicationDbContext db = new ApplicationDbContext();
            var q = db.Tbl_Server.Where(a => a.ServerId == ServerID).Single();

            FtpParametr f = new FtpParametr()
            {
                FtpAddress = q.IP + q.Path,
                Password   = q.FtpPassword,
                UserName   = q.FtpUsername
            };

            return(f);
        }
Ejemplo n.º 2
0
        private FtpParametr GetFtp(string TypeFtp)
        {
            ApplicationDbContext db = new ApplicationDbContext();
            var q         = db.Tbl_Server.Where(a => a.Type == TypeFtp).ToList();
            int RndServer = new Random().Next(0, q.Count() - 1);

            FtpParametr f = new FtpParametr()
            {
                FtpAddress = q[RndServer].IP + q[RndServer].Path,
                Password   = q[RndServer].FtpPassword,
                UserName   = q[RndServer].FtpUsername,
                FtpID      = q[RndServer].ServerId
            };

            return(f);
        }