<p>今天是放假最后一天</p><p>某些客户有OEM DTU配置工具的需要</p><p>根据合宙的接口做了这个</p><p>json解析和上传信息暂时还没做,后续会更新的.</p><p><br></p><p>登录</p><p><a href="http://dtu.openluat.com/api/site/login?name=用户名&password=密码">http://dtu.openluat.com/api/site/login?name=用户名&password=密码</a></p><p>登出</p><p><a href="http://dtu.openluat.com/api/site/logout">http://dtu.openluat.com/api/site/logout</a></p><p>用户信息</p><p><a href="http://dtu.openluat.com/api/site/user">http://dtu.openluat.com/api/site/user</a></p><p>查询模块参数(如果不填就是查询所有模块参数</p><p><a href="http://dtu.openluat.com/api/site/group?search_name=模块imei">http://dtu.openluat.com/api/site/group?search_name=模块imei</a><a href="http://dtu.openluat.com/api/site/group?search_name=模块imei"></a></p><p><br></p><p>下面是用c#+restsharp 写的几个重要函数</p><pre> private void button1_Click(object sender, EventArgs e)<br> {<br> //登录并保存cookie<br> var client = new RestClient("http://dtu.openluat.com/api/site/login?name=" + textBox1.Text + "&password=" + textBox2.Text + "");<br> client.CookieContainer = new System.Net.CookieContainer();<br> var request = new RestRequest(Method.GET);<br> IRestResponse response = client.Execute(request);<br> foreach (var cookie in response.Cookies)<br> {<br> cookie_name= cookie.Name.ToString();<br> cookie_value=cookie.Value.ToString();<br> }<br> }</pre><p><br></p><pre> private void button2_Click(object sender, EventArgs e)<br> {<br> //查询模块信息<br> var client = new RestClient("http://dtu.openluat.com/api/site/group?search_name=" + textBox3.Text);<br> client.CookieContainer = new System.Net.CookieContainer();<br> var request = new RestRequest(Method.GET);<br> request.AddParameter(cookie_name, cookie_value, ParameterType.Cookie);<br> IRestResponse response = client.Execute(request);<br> textBox4.Text=response.Content;<br> }</pre><p><br></p><pre> private void button3_Click(object sender, EventArgs e)<br> {<br> //查询用户信息<br> var client = new RestClient("http://dtu.openluat.com/api/site/user");<br> client.CookieContainer = new System.Net.CookieContainer();<br> var request = new RestRequest(Method.GET);<br> request.AddParameter(cookie_name, cookie_value, ParameterType.Cookie);<br> IRestResponse response = client.Execute(request);<br> textBox4.Text = response.Content;<br> }</pre>