Dict.xaml.cs

(开头部分) 18KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using System.Xml.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Networking.Connectivity;
using Windows.Storage;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// “空白页”项模板在 http://go.microsoft.com/fwlink/?LinkId=234238 上有介绍

namespace SimpleDictionary
{
    /// <summary>
    /// 可用于自身或导航至 Frame 内部的空白页。
    /// </summary>
    public sealed partial class Dict : Page
    {
        //查询的单词
        string keyword = null;
        //当前显示的单词
        string currentword = null;
        //httpclient对象
        HttpClient httpClient = null;
        public Dict()
        {
            this.InitializeComponent();

            httpClient = new HttpClient();//实例化该类,以便后面发送http请求获取网络数据
            httpClient.MaxResponseContentBufferSize = 256000;//设置读取响应内容时缓冲区的最大字节数
            httpClient.DefaultRequestHeaders.Add("user-agent", "Mozilla/5.0 (compatible;MSIE 10.0;Windows NT 6.2;WOW64;Trident/6.0)");//设置请求头部
            this.NavigationCacheMode = NavigationCacheMode.Enabled;
            Loaded+=Dict_Loaded;
        }

        private void Dict_Loaded(object sender, RoutedEventArgs e)
        {
            txtKeyWords.Focus(FocusState.Programmatic);
        }

        /// <summary>
        /// 在此页将要在 Frame 中显示时进行调用。
        /// </summary>
        /// <param name="e">描述如何访问此页的事件数据。Parameter
        /// 属性通常用于配置页。</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
             
        }
后面还有 424 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。