积分:3
http://pic30.nipic.com/20130612/2531170_124748553000_2.jpg
用2手指收放操作。
旋转应用方向
c#开发应用商店app怎么用HttpClient.PostAsync方法获取登陆后的网页内容?
http://www.zhihu.com/question/28050747/answer/41181841
static string GetPublicIP() { if (ip == null) { IPHostEntry host; string localIP = ""; host = Dns.GetHostEntry(Dns.GetHostName()); foreach (IPAddress ip1 in host.AddressList) { if (ip1.AddressFamily == AddressFamily.InterNetwork) { localIP = ip1.ToString(); break; } } ip = localIP; } return ip; }
private static async Task<string> DoLogging(object uqc, string strUrl) { try { using (var client = new HttpClient()) { var mediaType = new MediaTypeHeaderValue("application/json"); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage responseMessage = await client.PostAsJsonAsync(strUrl, uqc); var result = await responseMessage.Content.ReadAsAsync<string>(); return result; } } catch(Exception exc) { return string.Empty; } }
public static void LogFeedback(Dictionary<string, string> otherTelemetries = null) { try { otherTelemetries.Add("QueryId", QueryId.ToString()); var uf = new UserFeedback { Timestamp = DateTime.Now, OtherTelemetries = otherTelemetries }; string jsonResult = DoLogging(uf, LogFeedbackUrl).Result; } catch(Exception exc) {} }
public static void LogQuery(string queryWord, string filters, string queryLanguage) { try { QueryId = Guid.NewGuid(); var sbqc = new SampleBrowserQueryContext { Guid = QueryId.ToString(), UserQuery = queryWord, Timestamp = DateTime.Now, UserIp = GetPublicIP(), Language = queryLanguage, Filters = filters, Version = Properties.Settings.Default.ClientVersion }; string jsonResult = DoLogging(sbqc, LogQueryUrl).Result; } catch(Exception exc) { } }
Task.Run(delegate { LogQuery(uqc.UserQuery, "", uqc.Language); });
http://img4.duitang.com/uploads/item/201307/27/20130727200346_jYh4w.thumb.600_0.png
http://media.liveauctiongroup.net/i/5736/8632855_1.jpg?v=8CE70FDFAF1B540
http://img4.duitang.com/uploads/item/201307/27/20130727200346_jYh4w.thumb.600_0.png
http://image.zcool.com.cn/img3/58/19/m_1332512568836.jpg
http://t10.baidu.com/it/u=2154664982,3260472065&fm=23&gp=0.jpg
http://t1.baidu.com/it/u=2349648842,1901967946&fm=90&gp=0.jpg
哈佛大学的公开课《幸福课》