本文整理汇总了C#中ResultType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ResultType.ToString方法的具体用法?C# ResultType.ToString怎么用?C# ResultType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResultType
的用法示例。
在下文中一共展示了ResultType.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadTweets
public static async Task<IEnumerable<TwitterModel>> LoadTweets(string searchKey, ResultType resultType) {
//Prepare the url
string query = string.Format("http://search.twitter.com/search.json?q=%23{0}&result_type={1}", searchKey, resultType.ToString());
var client = new HttpClient();
//Make the request
var httpResponse = await client.GetAsync(new Uri(query));
//Read the response
var responseContent = await httpResponse.Content.ReadAsStringAsync();
// Parse the response (JSON)
return ParseResponse(responseContent);
}
示例2: search_tweets
public static async Task<Response<List<Status>>> search_tweets(this Api api, string query, Geocode geocode = null, Language lang = Language.English, string local = "ja", ResultType result_type = ResultType.Mixed, int count = -1, string until = null, long since_id = -1, long max_id = -1, bool include_entities = false)
{
var uri = "https://api.twitter.com/1.1/search/tweets.json";
var parameters = new Dictionary<string, object>();
parameters.Add("q", query);
if (geocode != null) parameters.Add("geocode", $"{geocode.Latitude},{geocode.Longitude},{geocode.Radius}{geocode.Units.ToString().ToLower()}");
parameters.Add("lang", lang.GetDescriptionFromEnumValue());
parameters.Add("local", local);
parameters.Add("result_type", result_type.ToString().ToLower());
// TODO: fix "until" parameter
if (!string.IsNullOrEmpty(until)) parameters.Add("until", until);
if (since_id != -1) parameters.Add("since_id", since_id);
if (max_id != -1) parameters.Add("max_id", max_id);
if (include_entities) parameters.Add("include_entities", include_entities);
return await api.SendAsync<List<Status>>(HttpMethod.Post, uri, parameters);
}
示例3: Json
public JsonResult Json(object data,ResultType resultType,string msg)
{
return Json(new { ResultType = resultType.ToString(), Data = data, Msg = msg }, "application/json", System.Text.Encoding.UTF8, JsonRequestBehavior.AllowGet);
}