Back to "التلقيمات..."

This is a viewer only at the moment see the article on how this works.

To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk

This is a preview from the server running through my markdig pipeline

ASP.NET Imported mostlylucidcouk Web Development XML

التلقيمات...

Friday, 12 March 2004

سُئل كيف يقوم أشخاص آخرون بتغذيات RSS، حسناً هذه كانت مشكلة بالنسبة لي مؤخراً، حيث كان علي توليد التلقيمات RSS للأجسام الموجودة. استخدمت مجموعة صغيرة من الفصول للقيام بذلك والتي قمت بتحميلها. هنا هناهنا مثال سريع لكيفية استخدامي لهذه (الأسماء المزالة لحماية الأبرياء) - ملاحظة، هذه ليست EXACR Rs، لقد اضفت حقل واحد، xsdDate، 'كذلك انني احتجت الى هذا لتحويل (لا تكسر القراء التي لديها هذا الجزء الاضافي على الرغم من ذلك!) سوف احدث هذا لاحقا مع المزيد من المعلومات عن هذه-- في الاساس انها تمر خلال العناصر في كائن (بشكل سيئ) سميت namefed sruct و تنشئ مدخلا لكل واحد... (Adam Kinney) باء - س منفذ

        private void BindRssControls(ItemFeedStruct theFeed)
        {
            
            string thisUrl = "http://" + Request.Url.Host + Application["AppPath"];
            RSSFeed rFeed = new RSSFeed("Latest  " + cts.ContentTypeName,thisUrl,"Feed for  Communities");
    
            for(int i=0; i < theFeed.items.Length; i++)
            {
                RSSItem rItem;
                if(_contentType != ctl.ForumThreads)
                {
                    rItem = new RSSItem(Server.HtmlEncode(theFeed.items[i].ItemTitle),Server.HtmlEncode(theFeed.items[i].ShortDescription));    
                }
                else
                {
                    string longDesc= theFeed.items[i].LongDescription;
                    if(longDesc.IndexOf(' ') > -1)
                    {
                        longDesc= longDesc.Substring(0,longDesc.LastIndexOf(' '));
                    }
                    rItem = new RSSItem(Server.HtmlEncode(theFeed.items[i].ItemTitle),Server.HtmlEncode(longDesc));    
                }
                rItem.PubDate = theFeed.items[i].ItemValidFrom.ToUniversalTime().ToString("r");
                rItem.XsdDate = theFeed.items[i].ItemValidFrom.ToString("s");
                rItem.Guid = theFeed.items[i].itemId.ToString();
                rItem.Link = Server.HtmlEncode(theFeed.items[i].ViewUrl);
                rItem.Author = Server.HtmlEncode(theFeed.items[i].AuthorName);
                RSSCategoryCollection rCat = new RSSCategoryCollection();
                rCat.Add(new RSSCategory(Server.HtmlEncode(theFeed.items[i].Category)));
                rItem.Categories = rCat;
                rFeed.Items.Add(rItem);
            }
            Response.ContentType = "text/xml";
            Page.EnableViewState = false;
            RssLiteral.Text = rFeed.ToString();
        }
logo

© 2026 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.