⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchresultsdetailsform.cs

📁 Accessing microsoft live web services from windows mobile
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
using LiveExpoService;

namespace LiveExpoApp
{
    public partial class SearchResultsDetailsForm : Form
    {
        LiveExpoResults liveExpoResults;
        private LiveExpoResult resultDetails;

        public SearchResultsDetailsForm(int requestedResult)
        {
            liveExpoResults = LiveExpoResults.Instance();
            this.resultDetails = liveExpoResults[requestedResult];
            InitializeComponent();
        }

        private void SearchResultsDetailsForm_Load(object sender, EventArgs e)
        {
            label1.Text = resultDetails.Title;
            if (resultDetails.PictureLink != null)
            {
                Cursor.Current = Cursors.WaitCursor;
                LoadImage();
                Cursor.Current = Cursors.Default;
            }
            tbAddress.Text = resultDetails.Address;
            tbCity.Text = resultDetails.City;
            tbZipCode.Text = resultDetails.ZipCode;
            tbState.Text = resultDetails.State;
            textBox1.Text = resultDetails.Description;
        }

        private void LoadImage()
        {
            try
            {
                HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create(resultDetails.PictureLink);
                HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
                this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                this.pictureBox1.Image = new Bitmap(webResponse.GetResponseStream());
                webResponse.Close();
            }
            catch (WebException)
            {
                MessageBox.Show("Error retrieving information from the Live Expo Service");
            }

        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -