public clsSFTP(string dbConnectionString) { m_dbData3060 = new dbData3060DataContext(dbConnectionString); #if (DEBUG) //m_rec_sftp = (from s in m_dbData3060.tblsftps where s.navn == "TestHD36" select s).First(); m_rec_sftp = (from s in m_dbData3060.tblsftps where s.navn == "Test" select s).First(); //m_rec_sftp = (from s in m_dbData3060.tblsftps where s.navn == "Produktion" select s).First(); #else m_rec_sftp = (from s in m_dbData3060.tblsftps where s.navn == "Test" select s).First(); //m_rec_sftp = (from s in m_dbData3060.tblsftps where s.navn == "Produktion" select s).First(); #endif byte[] bPK = Encoding.UTF8.GetBytes(m_rec_sftp.certificate); MemoryStream mPK = new MemoryStream(bPK); PrivateKeyFile PK = new PrivateKeyFile(mPK, m_rec_sftp.pincode); m_sftp = new SftpClient(m_rec_sftp.host, int.Parse(m_rec_sftp.port), m_rec_sftp.user, PK); m_sftp.Connect(); }
public clsSFTP(dbData3060DataContext p_dbData3060) { #if (DEBUG) m_rec_sftp = (from s in p_dbData3060.tblsftps where s.navn == "TestHD36" select s).First(); //m_rec_sftp = (from s in p_dbData3060.tblsftps where s.navn == "Test" select s).First(); //m_rec_sftp = (from s in p_dbData3060.tblsftps where s.navn == "Produktion" select s).First(); #else //m_rec_sftp = (from s in p_dbData3060.tblsftps where s.navn == "Test" select s).First(); m_rec_sftp = (from s in p_dbData3060.tblsftps where s.navn == "Produktion" select s).First(); #endif Program.Log(string.Format("host={0}, port={1}, user={2}", m_rec_sftp.host, int.Parse(m_rec_sftp.port), m_rec_sftp.user), "SFTP ConnectionString"); byte[] bPK = Encoding.UTF8.GetBytes(m_rec_sftp.certificate); MemoryStream mPK = new MemoryStream(bPK); PrivateKeyFile PK = new PrivateKeyFile(mPK, m_rec_sftp.pincode); m_sftp = new SftpClient(m_rec_sftp.host, int.Parse(m_rec_sftp.port), m_rec_sftp.user, PK); m_sftp.Connect(); Program.Log("SFTP Connected"); }
partial void Updatetblsftp(tblsftp instance);
partial void Deletetblsftp(tblsftp instance);
partial void Inserttblsftp(tblsftp instance);