v3.8.3.0 开发调试中...

This commit is contained in:
wisdomwei201804 2018-04-29 09:16:01 +08:00
parent 33781a5e9b
commit 9eb3142b8c

View File

@ -4,6 +4,8 @@ using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml; using System.Xml;
using System.Net; using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
namespace net.nutcore.aliddns namespace net.nutcore.aliddns
{ {
@ -11,7 +13,7 @@ namespace net.nutcore.aliddns
{ {
public Form_About() public Form_About()
{ {
InitializeComponent(); InitializeComponent();
this.MinimizeBox = false; //取消窗口最小化按钮 this.MinimizeBox = false; //取消窗口最小化按钮
this.MaximizeBox = false; //取消窗口最大化按钮 this.MaximizeBox = false; //取消窗口最大化按钮
@ -27,6 +29,31 @@ namespace net.nutcore.aliddns
Stream s = webreq.GetResponse().GetResponseStream(); Stream s = webreq.GetResponse().GetResponseStream();
StreamReader sr = new StreamReader(s, Encoding.Default); StreamReader sr = new StreamReader(s, Encoding.Default);
string all = sr.ReadToEnd();*/ string all = sr.ReadToEnd();*/
try
{
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
HttpContent httpContent = new StringContent("");
httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
httpContent.Headers.ContentType.CharSet = "utf-8";
httpContent.Headers.Add("token", "11111111111");
// httpContent.Headers.Add("appId", appId);
//httpContent.Headers.Add("serviceURL", serviceURL);
HttpClient httpClient = new HttpClient();
//httpClient..setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET, "utf-8");
HttpResponseMessage response = httpClient.PostAsync("https://api.github.com/respo/wisdomwei201804/AliDDNS/releases/latest", httpContent).Result;
//statusCode = response.StatusCode.ToString();
if (response.IsSuccessStatusCode)
{
string result = response.Content.ReadAsStringAsync().Result;
// return result;
}
}
catch( Exception error)
{
MessageBox.Show(error.ToString());
}
} }
else checkBox_autoCheckUpdate.Checked = false; else checkBox_autoCheckUpdate.Checked = false;
textBox_updateInfo.ReadOnly = true; textBox_updateInfo.ReadOnly = true;