Ejemplo n.º 1
0
 private void InitData(int serverId)
 {
     if (serverId > 0)
     {
         DownServerInfo downServerById = DownServer.GetDownServerById(serverId);
         this.TxtServerName.Text         = downServerById.ServerName;
         this.TxtServerLogo.Text         = downServerById.ServerLogo;
         this.TxtServerUrl.Text          = downServerById.ServerUrl.ToString();
         this.DropShowType.SelectedValue = downServerById.ShowType.ToString();
     }
 }
Ejemplo n.º 2
0
        private string ParseDownLoadPath(int urlid, int id, int serverid)
        {
            DataTable contentDataById = ContentManage.GetContentDataById(id);

            if (contentDataById.Rows.Count <= 0)
            {
                DynamicPage.WriteErrMsg("此资源不存在!", SiteConfig.SiteInfo.VirtualPath + "Default.aspx");
            }
            string         str            = "";
            DownServerInfo downServerById = DownServer.GetDownServerById(serverid);
            string         weburl         = "";

            if (contentDataById.Rows.Count > 0)
            {
                str = contentDataById.Rows[0]["DownloadUrl"].ToString();
                int num = 0;
                foreach (string str3 in str.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries))
                {
                    string[] strArray2 = str3.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                    if (num == urlid)
                    {
                        weburl = strArray2[1];
                    }
                    num++;
                }
            }
            if (downServerById.IsNull)
            {
                this.downloadurl = Utility.ConvertAbsolutePath(SiteConfig.SiteInfo.VirtualPath + SiteConfig.SiteOption.UploadDir + "/", weburl, true);
                return(weburl);
            }
            string str4 = downServerById.ServerUrl.ToString();

            if (!str4.StartsWith("http://", StringComparison.OrdinalIgnoreCase))
            {
                str4 = "http://" + str4;
            }
            if (!str4.EndsWith("/", StringComparison.Ordinal))
            {
                str4 = str4 + "/";
            }
            if (weburl.StartsWith("/", StringComparison.Ordinal) || weburl.Contains("://"))
            {
                this.downloadurl = weburl;
                return(weburl);
            }
            this.downloadurl = str4 + weburl;
            return(weburl);
        }
Ejemplo n.º 3
0
        protected void EBtnSetOrderId_Click(object sender, EventArgs e)
        {
            List <DownServerInfo> list = new List <DownServerInfo>();

            foreach (GridViewRow row in this.GdvDownServerOrder.Rows)
            {
                DropDownList   list2          = (DropDownList)row.FindControl("DropOrderId");
                int            serverId       = (int)this.GdvDownServerOrder.DataKeys[row.RowIndex].Value;
                int            num2           = DataConverter.CLng(list2.SelectedValue);
                DownServerInfo downServerById = DownServer.GetDownServerById(serverId);
                downServerById.OrderId = num2;
                if (!downServerById.IsNull)
                {
                    list.Add(downServerById);
                }
            }
            DownServer.OrderDownServer(list);
            this.GdvDownServerOrder.DataBind();
            base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
            AdminPage.WriteSuccessMsg("下载服务器排序成功!", "DownServerOrder.aspx");
        }