示例#1
0
        public static bool ApplyFtp(out FtpWeb fp)
        {
            fp = null;
            string ss = "select mkey,mvalue from dbo.ConSystem where mParentID=(select mid from dbo.ConSystem where mKey='FTP')";
            SqlConnection sc = MSSQLDB.CreateDBConnet();
            try
            {
                sc.Open();
                SqlCommand scmd = new SqlCommand(ss, sc);
                SqlDataAdapter sda = new SqlDataAdapter(scmd);
                DataTable dt = new DataTable();
                sda.Fill(dt);
                if (dt.Rows.Count == 4)
                {
                    string ftpAddress = "", ftpPort = "", ftpUser = "", ftppassword = "";
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (dr[0].ToString() == "Address")
                        {
                            ftpAddress = dr[1].ToString();
                            continue;
                        }
                        if (dr[0].ToString() == "Port")
                        {
                            ftpPort = dr[1].ToString();
                            continue;
                        }
                        if (dr[0].ToString() == "User")
                        {
                            ftpUser = dr[1].ToString();
                            continue;
                        }
                        if (dr[0].ToString() == "password")
                        {
                            ftppassword = dr[1].ToString();
                            continue;
                        }
                    }
                    if (ftpAddress.Length <= 0 || ftpPort.Length <= 0 || ftpUser.Length <= 0 || ftppassword.Length <= 0)
                    {

                    }
                    else
                    {//注意默认路径下,有xps和doc两个文件夹,分别对应原始和现在需要的文件,下载必须使用xps,否则客户端无法解读。

                        ///get mms mms://202.103.25.141/
                        scmd.CommandText = "SELECT [mValue]  FROM ConSystem where mKey='mms'";
                        fp = new FtpWeb(ftpAddress, ftpPort, "", ftpUser, ftppassword,scmd.ExecuteScalar().ToString());
                        sc.Close();
                        return true;
                    }
                }
                sfailedopen = "FTP设置错误!";
                sc.Close();
                return false;
            }
            catch { }
            sfailedopen = MSSQLDB.error;
            return false;
        }
示例#2
0
        private bool ApplyFtp()
        {
            string ss = "select mkey,mvalue from dbo.ConSystem where mParentID=(select mid from dbo.ConSystem where mKey='FTP')";
            SqlConnection sc = MSSQLDB.CreateDBConnet();
            try
            {
                sc.Open();
                SqlCommand scmd = new SqlCommand(ss, sc);
                SqlDataAdapter sda = new SqlDataAdapter(scmd);
                DataTable dt = new DataTable();
                sda.Fill(dt);
                if (dt.Rows.Count == 4)
                {
                    string ftpAddress = "", ftpPort = "", ftpUser = "", ftppassword = "";
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (dr[0].ToString() == "Address")
                        {
                            ftpAddress = dr[1].ToString();
                            continue;
                        }
                        if (dr[0].ToString() == "Port")
                        {
                            ftpPort = dr[1].ToString();
                            continue;
                        }
                        if (dr[0].ToString() == "User")
                        {
                            ftpUser = dr[1].ToString();
                            continue;
                        }
                        if (dr[0].ToString() == "password")
                        {
                            ftppassword = dr[1].ToString();
                            continue;
                        }
                    }
                    if (ftpAddress.Length <= 0 || ftpPort.Length <= 0 || ftpUser.Length <= 0 || ftppassword.Length <= 0)
                    {

                    }
                    else
                    {//注意默认路径下,有xps和doc两个文件夹,分别对应原始和现在需要的文件,下载必须使用xps,否则客户端无法解读。
                        fw = new FtpWeb(ftpAddress, ftpPort, @"xps", ftpUser, ftppassword);
                        sc.Close();
                        return true;
                    }
                }
                sfailedopen = "FTP设置错误!";
                sc.Close();
                return false;
            }
            catch { }
            sfailedopen = MSSQLDB.error;
            return false;
        }
示例#3
0
 public Agendo(string sid, string sname, FtpWeb fw, IDocumentPaginatorSource ids, DateTime dtstart, DateTime dtend)
 {
     Init(sid, sname, fw);
     xpscontent = ids;
     initDatetime(dtstart, dtend);
 }
示例#4
0
 public Agendo(string sid, string sname, FtpWeb fw, IDocumentPaginatorSource Content)
 {
     Init(sid, sname, fw);
     xpscontent = Content;
 }
示例#5
0
 public Agendo(string sid, string sname, FtpWeb fw)
 {
     Init(sid, sname, fw);
 }
示例#6
0
 private void Init(string sid, string sname, FtpWeb fw)
 {
     mId = sid;
     gfw = fw;
     name = sname;
 }