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


C# SearchMode.ToString方法代码示例

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


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

示例1: BasicSearch

		/// <summary>
		/// A Basic Amazon Search
		/// </summary>
		/// <param name="mode">The search mode to use</param>
		/// <param name="search">The search</param>
		/// <see cref="http://msdn.microsoft.com/coding4fun/web/services/article.aspx?articleid=912260"/>
		public string BasicSearch(SearchMode mode, string search)
		{
			System.Text.StringBuilder details = new StringBuilder("Search Results:\n\n");
		
			try
			{
				AmazonWebService.KeywordRequest request = new AmazonWebService.KeywordRequest();
				request.locale = "us";
				request.type = "lite";
				request.sort = "reviewrank";
				request.mode = mode.ToString();
				request.keyword = search;
				request.tag = accessKeyId;
				request.devtag = accessKeyId;
				
				AmazonWebService.AmazonSearchService searchService = new Alexandria.Amazon.AmazonWebService.AmazonSearchService();
				AmazonWebService.ProductInfo info = searchService.KeywordSearchRequest(request);
				foreach(AmazonWebService.Details detail in info.Details)
				{
					details.Append(detail.ProductName + " [ ASIN: " + detail.Asin);					
					if (!string.IsNullOrEmpty(detail.OurPrice))
						details.Append(" Amazon: " + detail.OurPrice);
					int usedCount;
					int.TryParse(detail.UsedCount, out usedCount);
					if (usedCount > 0 && !string.IsNullOrEmpty(detail.UsedPrice))
						details.Append(", Used: " + detail.UsedPrice);
					details.Append("]\n");
					
					System.Diagnostics.Debug.WriteLine("Product Name: " + detail.ProductName);
				}
				
				return details.ToString();
			}
			catch (Exception ex)
			{
				throw new AlexandriaException("The was an error attempting to search Amazon", ex);
			}
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:44,代码来源:WebServiceClient.cs

示例2: GetSearchThreadUrl

 public static string GetSearchThreadUrl(string codeName, int threadID, int postID, SearchMode mode, string searchText)
 {
     return GetThreadUrl(codeName, threadID) + "?postID=" + postID + "&page=1&SearchMode=" + mode.ToString() + "&searchText=" + searchText;
     //return BbsRouter.GetUrl(string.Format("showthread/{0}/tid-{1}/{2}/pid-{3}/smode-{4}/keyword-{5}", codeName, threadID, 1, postID,mode.ToString(),searchText));
     //string threadUrl = UrlManager.GetFriendlyUrl("ShowThread.html?codename={0}&ThreadID={1}&postID={2}&page=1&SearchMode={3}&searchText={4}", true);
     //return string.Format(threadUrl, codeName, threadID, postID, mode.ToString(), searchText);
 }
开发者ID:huchao007,项目名称:bbsmax,代码行数:7,代码来源:BbsUrlHelper.cs


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