示例#1
0
        /// <summary>
        /// 开始发送使用信息
        /// </summary>
        /// <param name="mod"></param>
        private async void Begin_tongji_Run(string mod)
        {
            try
            {
                ClassHttp CH = new ClassHttp();
                CH.HttpURL = URLSTR.tongji;
                IDictionary <string, string> CS = new Dictionary <string, string>();
                //可选参数,但如果要获取的地址不是网页,而是一个文件或图片,服务器一般默认配置不接受Post进而导致无法获取到。
                //直接使用图片地址的,不要设置这个参数,避免使用Post方式,直接传递null。

                HardwareToken hardwareToken = HardwareIdentification.GetPackageSpecificToken(null);
                EasClientDeviceInformation easClientDeviceInformation = new EasClientDeviceInformation();


                CS["mod"] = mod;
                CS["hardwareToken_Id"]                              = Buffer2Base64(hardwareToken.Id);
                CS["hardwareToken_Signature"]                       = Buffer2Base64(hardwareToken.Signature);
                CS["hardwareToken_Certificate"]                     = Buffer2Base64(hardwareToken.Certificate);
                CS["easClientDeviceInformation_Version"]            = "固件版本:" + easClientDeviceInformation.SystemFirmwareVersion + "★硬件版本:" + easClientDeviceInformation.SystemHardwareVersion;
                CS["easClientDeviceInformation_FriendlyName"]       = easClientDeviceInformation.FriendlyName;
                CS["easClientDeviceInformation_OperatingSystem"]    = easClientDeviceInformation.OperatingSystem;
                CS["easClientDeviceInformation_SystemManufacturer"] = easClientDeviceInformation.SystemManufacturer;
                CS["easClientDeviceInformation_SystemProductName"]  = easClientDeviceInformation.SystemProductName;
                IDictionary <string, object> RE = await CH.LoadHttpText(CS);
            }
            catch (Exception exx)
            { }
        }
示例#2
0
        private async void _tj_Click(object sender, RoutedEventArgs e)
        {
            if (_tb2.Text.Trim() == "")
            {
                await new MessageDialog("你好!至少说点什么呗?").ShowAsync();
                return;
            }
            _tj.Visibility  = Windows.UI.Xaml.Visibility.Collapsed;
            _tjing.IsActive = true;

            try
            {
                ClassHttp CH = new ClassHttp();
                CH.HttpURL = URLSTR.jianyi;
                IDictionary <string, string> CS = new Dictionary <string, string>();
                //可选参数,但如果要获取的地址不是网页,而是一个文件或图片,服务器一般默认配置不接受Post进而导致无法获取到。
                //直接使用图片地址的,不要设置这个参数,避免使用Post方式,直接传递null。

                HardwareToken hardwareToken = HardwareIdentification.GetPackageSpecificToken(null);

                CS["hardwareToken_Id"] = Buffer2Base64(hardwareToken.Id);
                CS["daming"]           = _tb1.Text;
                CS["jianyi"]           = _tb2.Text;
                IDictionary <string, object> RE = await CH.LoadHttpText(CS);

                string re = RE["返回内容"].ToString();
                await new MessageDialog(re).ShowAsync();
            }
            catch (Exception exx)
            { }

            _tj.Visibility  = Windows.UI.Xaml.Visibility.Visible;
            _tjing.IsActive = false;

            Frame.Navigate(typeof(PivotPage), null);
        }
示例#3
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            string Sxz    = "";
            string Sren   = "";
            string Sxinxi = _xinxi.Text;

            if (_xingzhi01.IsChecked.Value)
            {
                Sxz = _xingzhi01.Content.ToString();
            }
            if (_xingzhi02.IsChecked.Value)
            {
                Sxz = _xingzhi02.Content.ToString();
            }
            if (_xingzhi03.IsChecked.Value)
            {
                Sxz = _xingzhi03.Content.ToString();
            }
            if (_ren01.IsChecked.Value)
            {
                Sren = _ren01.Content.ToString();
            }
            if (_ren02.IsChecked.Value)
            {
                Sren = _ren02.Content.ToString();
            }
            if (_ren03.IsChecked.Value)
            {
                Sren = _ren03.Content.ToString();
            }

            if (Sxz == "" || Sren == "")
            {
                await new MessageDialog("总要选择一下的嘛").ShowAsync();
                return;
            }

            _tj.Visibility    = Windows.UI.Xaml.Visibility.Collapsed;
            _tjing.IsActive   = true;
            _tjing.Visibility = Windows.UI.Xaml.Visibility.Visible;
            try
            {
                ClassHttp CH = new ClassHttp();
                CH.HttpURL = URLSTR.caidan;
                IDictionary <string, string> CS = new Dictionary <string, string>();
                //可选参数,但如果要获取的地址不是网页,而是一个文件或图片,服务器一般默认配置不接受Post进而导致无法获取到。
                //直接使用图片地址的,不要设置这个参数,避免使用Post方式,直接传递null。

                HardwareToken hardwareToken = HardwareIdentification.GetPackageSpecificToken(null);

                CS["hardwareToken_Id"] = Buffer2Base64(hardwareToken.Id);
                CS["xingzhi"]          = Sxz;
                CS["ren"]   = Sren;
                CS["xinxi"] = Sxinxi;
                IDictionary <string, object> RE = await CH.LoadHttpText(CS);

                string re = RE["返回内容"].ToString();
                await new MessageDialog(re).ShowAsync();
            }
            catch (Exception exx)
            { }

            _tj.Visibility    = Windows.UI.Xaml.Visibility.Visible;
            _tjing.IsActive   = false;
            _tjing.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }