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

📄 form1.cs

📁 Microsoft Mobile Development Handbook的代码,有C#,VB,C++的
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WSCompressionSample
{
    public partial class Form1 : Form
    {
        // TODO: Change targetURL to correct URL where the Web service is installed
        private readonly string targetURL = "http://myServer/CompressionService/CustomersService.asmx";

        public Form1()
        {
            InitializeComponent();

            System.Diagnostics.Debug.Assert(targetURL.IndexOf("myServer") == -1, 
                "Before running this sample, you must change the targetURL field to the correct URL for the CompressionWebService on your own server.");
        }

        private void buttonGetCustomers_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            this.Invalidate();

            Cursor.Current = Cursors.WaitCursor;

            try
            {
                CompressionService.CustomersService svc = new WSCompressionSample.CompressionService.CustomersService();
                svc.Url = targetURL;
                CompressionService.CustomersDataSet ds = null;

                int startTime = Environment.TickCount;
                if (checkBoxCompressed.Checked)
                {
                    ds = svc.GetCompressedCustomers();
                }
                else
                {
                    ds = svc.GetCustomers();
                }

                MessageBox.Show(Convert.ToString(Environment.TickCount - startTime) + "ms");

                textBox1.Text = ds.GetXml();
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
    }
}

⌨️ 快捷键说明

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