using DotNet4.Utilities; using HandyControl.Controls; using LiveTools.Data; using Microsoft.VisualBasic.ApplicationServices; using Microsoft.Win32; using Newtonsoft.Json.Linq; using ryCommon; using ryCommonDb; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace LiveTools { /// /// FrmAddRule.xaml 的交互逻辑 /// public partial class FrmUseSN : HandyControl.Controls.Window { public FrmUseSN() { InitializeComponent(); TxtUserId.Text = Config.UserInfo.UserId; } private void BtnOK_Click(object sender, RoutedEventArgs e) { HttpResult html = Config.ry_api.Post(Config.Api_Url + "user.aspx", "api=usesn&userid=" + RyWeb.WebDecode.Escape(Config.UserInfo.UserId) + "&sn=" + RyWeb.WebDecode.Escape(TxtSN.Text)); string jsonText = API.GetJson(html.Html); Json json = new Json(jsonText); string result = json.GetJsonValue(ConstVar.json_Result); if (result == ResultVar.json_Success.ToString()) { Config.UserInfo.OutDateStr= json.GetJsonValue("out_date"); Config.UserInfo.OutTime=Config.UserInfo.OutDateStr.ToDateTime().ToInt64(); HandyControl.Controls.MessageBox.Show("激活成功。", "提示"); DialogResult = true; } else { HandyControl.Controls.MessageBox.Show(json.GetJsonValue(ConstVar.json_ResultText), "激活失败"); } } private void BtnCancel_Click(object sender, RoutedEventArgs e) { DialogResult = false; } } }