当前位置: 首页>>代码示例>>C#>>正文


C# Data.MakeNiceNameFive方法代码示例

本文整理汇总了C#中Data.MakeNiceNameFive方法的典型用法代码示例。如果您正苦于以下问题:C# Data.MakeNiceNameFive方法的具体用法?C# Data.MakeNiceNameFive怎么用?C# Data.MakeNiceNameFive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Data的用法示例。


在下文中一共展示了Data.MakeNiceNameFive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        Data dat = new Data(DateTime.Now);

        Page.Title = "Hippo Blog - The Portal To What's Happenings<";

        DataView dvFeatured = dat.GetDataDV("SELECT * FROM HippoBlogContent WHERE Featured = 'True' ");

        if (dvFeatured.Count > 0)
        {
            FeaturedLiteral.Text = "<table>" +
                "<tr>" +
                   " <td class=\"ContentLeft\" valign=\"top\">" +
                   "     <img src=\"../NewImages/Cloud.png\" />" +
                   " </td>" +
                   " <td valign=\"top\">" +
                    "     <h1 class=\"FeaturedTitle\">" + dvFeatured[0]["Title"].ToString() + "</h1>" +

                   " </td>" +
               " </tr>" +
                "<tr>" +
                 "   <td class=\"ContentLeft\" align=\"center\">" +
                 "       2pm <br />" +
                 "       Wed <br />" +
                 "       Mar. <br />" +
                 "       22nd <br />" +
                  "  </td>" +
                  "  <td class=\"FeaturedContent\">" + "<img src=\"" + dvFeatured[0]["HomeImage"].ToString() + "\" />" + dvFeatured[0]["HomePageSummary"].ToString() +
                  "  </td>" +
                "</tr>" +
                "<tr>" +
                 "   <td>" +
                 "   </td>" +
                  "  <td>" +
                  "      Continue Reading <a class=\"FeaturedLink\" href=\"" +
                  dat.MakeNiceNameFive(dvFeatured[0]["Title"].ToString()) + "_" +
                  dvFeatured[0]["ID"].ToString() + "_Blog\">" +
                  dvFeatured[0]["Title"].ToString() + "</a>" +
                  "  </td>" +
               " </tr>" +
           " </table>";
        }

        DataView dv = dat.GetDataDV("SELECT * FROM HippoBlogContent WHERE Featured = 'False' ORDER BY PostDate DESC");

        foreach (DataRowView row in dv)
        {
            RestOfArticlesLiteral.Text += "<table class=\"OneArticle\">" +
                "<tr>" +
                   " <td class=\"ContentLeft\" valign=\"top\">" +
                   "     <img src=\"../NewImages/Cloud.png\" />" +
                   " </td>" +
                   " <td valign=\"top\">" +
                    "     <h1 class=\"Title\">" + row["Title"].ToString() + "</h1>" +

                   " </td>" +
               " </tr>" +
                "<tr>" +
                 "   <td class=\"ContentLeft\" align=\"center\">" +
                 "       2pm <br />" +
                 "       Wed <br />" +
                 "       Mar. <br />" +
                 "       22nd <br />" +
                  "  </td>" +
                  "  <td class=\"Content\">" + "<img src=\"" + row["HomeImage"].ToString() + "\" />" + row["HomePageSummary"].ToString() +
                  "  </td>" +
                "</tr>" +
                "<tr>" +
                 "   <td>" +
                 "   </td>" +
                  "  <td>" +
                  "      Continue Reading <a class=\"Title\" href=\"" +
                  dat.MakeNiceNameFive(row["Title"].ToString()) + "_" +
                  row["ID"].ToString() + "_Blog\">" +
                  row["Title"].ToString() + "</a>" +
                  "  </td>" +
               " </tr>" +
           " </table>";
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:80,代码来源:Home.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];

        DateTime isn = DateTime.Now;

        DateTime.TryParse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"), out isn);

        Data dat = new Data(isn);

        if (IsPostBack)
        {
            MessageRadWindowManager.VisibleOnPageLoad = false;
        }

        string background = "";
        if (isFeatured)
        {
            background = "background-color: #e9f1f4;";
        }
        else
        {
            background = "border-bottom: solid 1px #dedbdb;";
        }

        if (searchNumber != "")
        {
            string markerNumber = dat.GetImageNum(searchNumber);
            ImageLiteral.Text = imageLiteral + "<div class=\"topDiv\" style=\"float: left;padding-right: 5px;height: 50px;\"><img style=\"cursor: " +
                "pointer;\" onclick=\"myclick(" + markerNumber + ");\" id='image" + searchNumber + "' src=" +
                "\"http://www.google.com/mapfiles/marker" + searchNumber + ".png\" /></div>";
            BeginingLiteral.Text = "<div style=\"margin-top: 3px;height: 56px;margin-bottom: 3px; width: " + width.ToString() +
                "px; padding: 3px;" + background + "\">";
        }
        else
        {
            BeginingLiteral.Text = "<div class=\"topDiv\" style=\"margin-top: 3px;margin-bottom: 3px;" + background +
                " width: " + width.ToString() + "px;padding: 3px;\">";
        }

        bool imgAbsolute = false;
        VenueLabel.Text = venueLabel;

        if (!isVenue)
        {
            DataView dvEvent = dat.GetDataDV("SELECT * FROM Events WHERE ID=" + eventID);

            DataView dvEventsSlider = dat.GetDataDV("SELECT * FROM Events E, Event_Slider_Mapping ESM WHERE E.ID=ESM.EventID AND E.ID=" + eventID);
            if (dvEventsSlider.Count > 0)
            {
                if(bool.Parse(dvEventsSlider[0]["ImgPathAbsolute"].ToString()))
                    imgAbsolute = true;

                if (imgAbsolute)
                {
                    string name = dat.MakeNiceNameFull(dvEventsSlider[0]["PictureName"].ToString().Replace("/", "_").Replace(":", "_").Replace(".", "_"));

                    int i = 0;
                    for (i = name.Length - 1; i >= 0; i--)
                    {
                        if (name[i] == '_')
                        {
                            break;
                        }
                    }

                    Random rand = new Random(DateTime.Now.Millisecond);

                    name = dat.MakeNiceNameFive(dvEventsSlider[0]["PictureName"].ToString()) + "_" + eventID + "." + name.Substring(i + 1, name.Length - i - 1);

                    //if (name.Length > 230)
                    //    name = name.Substring(name.Length - 50, 50);

                    //if (!System.IO.File.Exists(MapPath("../") + "\\Temp\\Temp_" + name))
                    //{
                    try
                    {
                        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(dvEventsSlider[0]["PictureName"].ToString());
                        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                        Stream receiveStream = response.GetResponseStream();
                        // read the stream
                        System.Drawing.Image img = System.Drawing.Image.FromStream(receiveStream);
                        receiveStream.Close();
                        response.Close();

                        SaveThumbnail(img, MapPath("../") + "\\Temp\\Temp_" + name);
                        //}
                        EventImageLiteral.Text = "<img style='float: left; padding-right: 5px;' src='http://hippohappenings.com/Temp/Temp_" +
                            name + "' />";
                    }
                    catch (Exception ex)
                    {

                    }
                }
                else
                {
                    if (!System.IO.File.Exists(MapPath("../") + "\\Temp\\Temp_" + dvEventsSlider[0]["PictureName"].ToString()))
                    {
                        if (System.IO.File.Exists(MapPath("../") + "\\UserFiles\\" +
//.........这里部分代码省略.........
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:SearchElement.ascx.cs


注:本文中的Data.MakeNiceNameFive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。