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


C# StringBuilder.Append2方法代码示例

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


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

示例1: getParameterString

        public virtual String getParameterString()
        {
            StringBuilder builder = new StringBuilder("");

            if (Url != null)
                builder.Append2("&url=", HttpUtility.UrlEncode(Url));

            if (Html != null)
                builder.Append2("&html=", HttpUtility.UrlEncode(Html));

            if (Text != null)
                builder.Append2("&text=", HttpUtility.UrlEncode(Text));

            if (CustomParameters != null)
                builder.Append(CustomParameters);

            if (OutputMode != OutputMode.None)
            {
                if (OutputMode == OutputMode.Xml)
                    builder.Append("&outputMode=xml");
                else if (OutputMode == OutputMode.Rdf)
                    builder.Append("&outputMode=rdf");
            }

            return builder.ToString();
        }
开发者ID:raviprakashvarshney,项目名称:AlchemyApiSharp,代码行数:26,代码来源:BaseParams.cs

示例2: getParameterString

        public override String getParameterString()
        {
            StringBuilder builder = new StringBuilder(base.getParameterString());

            builder.Append(SourceTextMode.GetUrlParameter());

            if (ShowSourceText.HasValue)
                builder.Append2("&showSourceText=", (ShowSourceText.Value ? "1" : "0"));
            if (Disambiguate.HasValue)
                builder.Append2("&disambiguate=", (Disambiguate.Value ? "1" : "0"));
            if (LinkedData.HasValue)
                builder.Append2("&linkedData=", (LinkedData.Value ? "1" : "0"));
            if (Coreference.HasValue)
                builder.Append2("&coreference=", (Coreference.Value ? "1" : "0"));
            if (Quotations.HasValue)
                builder.Append2("&quotations=", (Quotations.Value ? "1" : "0"));
            if (Sentiment.HasValue)
                builder.Append2("&sentiment=", (Sentiment.Value ? "1" : "0"));
            if (CQuery != null)
                builder.Append2("&cquery=", HttpUtility.UrlEncode(CQuery));
            if (XPath != null)
                builder.Append2("&xpath=", HttpUtility.UrlEncode(XPath));
            if (MaxRetrieve.HasValue)
                builder.Append2("&maxRetrieve=", MaxRetrieve.Value.ToString(CultureInfo.InvariantCulture));
            if (BaseUrl != null)
                builder.Append2("&baseUrl=", HttpUtility.UrlEncode(BaseUrl));

            return builder.ToString();
        }
开发者ID:raviprakashvarshney,项目名称:AlchemyApiSharp,代码行数:29,代码来源:EntityParams.cs

示例3: getParameterString

        public override String getParameterString()
        {
            StringBuilder builder = new StringBuilder(base.getParameterString());

            if (ShowSourceText.HasValue)
                builder.Append2("&showSourceText=", (ShowSourceText.Value ? "1" : "0"));
            if (Target != null)
                builder.Append2("&target=", HttpUtility.UrlEncode(Target));

            return builder.ToString();
        }
开发者ID:raviprakashvarshney,项目名称:AlchemyApiSharp,代码行数:11,代码来源:TargetedSentimentParams.cs

示例4: getParameterString

        public override String getParameterString()
        {
            StringBuilder builder = new StringBuilder(base.getParameterString());

            if (UseMetadata.HasValue)
                builder.Append2("&useMetadata=", (UseMetadata.Value ? "1" : "0"));
            if (ExtractLinks.HasValue)
                builder.Append2("&extractLinks=", (ExtractLinks.Value ? "1" : "0"));

            return builder.ToString();
        }
开发者ID:raviprakashvarshney,项目名称:AlchemyApiSharp,代码行数:11,代码来源:TextParams.cs

示例5: getParameterString

        public override String getParameterString()
        {
            StringBuilder builder = new StringBuilder(base.getParameterString());

            builder.Append(SourceTextMode.GetUrlParameter());

            if (CQuery != null)
                builder.Append2("&cquery=", HttpUtility.UrlEncode(CQuery));
            if (XPath != null)
                builder.Append2("&xpath=", HttpUtility.UrlEncode(XPath));

            return builder.ToString();
        }
开发者ID:raviprakashvarshney,项目名称:AlchemyApiSharp,代码行数:13,代码来源:LanguageParams.cs

示例6: getParameterString

        public override String getParameterString()
        {
            StringBuilder builder = new StringBuilder(base.getParameterString());

            builder.Append(SourceTextMode.GetUrlParameter());

            if (ShowSourceText.HasValue)
                builder.Append2("&showSourceText=", (ShowSourceText.Value ? "1" : "0"));
            if (LinkedData.HasValue)
                builder.Append2("&linkedData=", (LinkedData.Value ? "1" : "0"));
            if (CQuery != null)
                builder.Append2("&cquery=", HttpUtility.UrlEncode(CQuery));
            if (XPath != null)
                builder.Append2("&xpath=", HttpUtility.UrlEncode(XPath));
            if (MaxRetrieve.HasValue)
                builder.Append2("&maxRetrieve=", MaxRetrieve.Value.ToString(CultureInfo.InvariantCulture));

            return builder.ToString();
        }
开发者ID:raviprakashvarshney,项目名称:AlchemyApiSharp,代码行数:19,代码来源:ConceptParams.cs

示例7: getParameterString

        public override String getParameterString()
        {
            StringBuilder builder = new StringBuilder(base.getParameterString());

            builder.Append(SourceTextMode.GetUrlParameter());

            if (ShowSourceText.HasValue)
                builder.Append2("&showSourceText=", (ShowSourceText.Value ? "1" : "0"));
            if (Sentiment.HasValue)
                builder.Append2("&sentiment=", (Sentiment.Value ? "1" : "0"));
            if (CQuery != null)
                builder.Append2("&cquery=", HttpUtility.UrlEncode(CQuery));
            if (XPath != null)
                builder.Append2("&xpath=", HttpUtility.UrlEncode(XPath));
            if (MaxRetrieve.HasValue)
                builder.Append2("&maxRetrieve=", MaxRetrieve.ToString());
            if (BaseUrl != null)
                builder.Append2("&baseUrl=", HttpUtility.UrlEncode(BaseUrl));
            if (KeywordExtractMode != KeywordExtractModes.None)
                builder.Append2("&keywordExtractMode=", (KeywordExtractModes.Strict == KeywordExtractMode ? "strict" : "normal"));

            return builder.ToString();
        }
开发者ID:raviprakashvarshney,项目名称:AlchemyApiSharp,代码行数:23,代码来源:KeywordParams.cs

示例8: SetCustomParameters

        public void SetCustomParameters(params object[] argsRest)
        {
            StringBuilder builder = new StringBuilder("");

            for (int i = 0; i < argsRest.Length; ++i)
            {
                builder.Append2("&", argsRest[i].ToString());
                if (++i < argsRest.Length)
                    builder.Append2("=", HttpUtility.UrlEncode((string)argsRest[i]));
            }

            CustomParameters = builder.ToString();
        }
开发者ID:raviprakashvarshney,项目名称:AlchemyApiSharp,代码行数:13,代码来源:BaseParams.cs


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