【发布时间】:2015-08-06 05:21:13
【问题描述】:
我一直在尝试使用返回 json 的在线 API。 我目前正在使用 winform 应用程序。
到目前为止我尝试过
WebClient cHttp = new WebClient();
string htmlCode = cHttp.DownloadString(path); <--------
///-----------And then this
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(path);
request.Method = WebRequestMethods.Http.Get;
request.Accept = "application/json";
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); <-----
我将箭头指向的地方,程序不会崩溃,它只是点击该行,然后跳过它下面的所有代码。然后我的表单打开而不运行我的整个代码。我做错了什么?
谢谢
【问题讨论】:
标签: c# json httprequest httpresponse