📄 form1.vb
字号:
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Namespace WSCompressionSample
Public Class Form1
' TODO: Change targetURL to correct URL where the Web service is installed
Private ReadOnly targetURL As String = "http://myServer/CompressionService/CustomersService.asmx"
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
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.")
End Sub
Private Sub buttonGetCustomers_Click(ByVal sender As Object, ByVal e As EventArgs) Handles buttonGetCustomers.Click
textBox1.Text = ""
Me.Invalidate()
Cursor.Current = Cursors.WaitCursor
Try
Dim svc As CompressionService.CustomersService = New CompressionService.CustomersService()
svc.Url = targetURL
Dim ds As CompressionService.CustomersDataSet = Nothing
Dim startTime As Integer = Environment.TickCount
If (checkBoxCompressed.Checked) Then
ds = svc.GetCompressedCustomers()
Else
ds = svc.GetCustomers()
End If
MessageBox.Show(Convert.ToString(Environment.TickCount - startTime) + "ms")
textBox1.Text = ds.GetXml()
Finally
Cursor.Current = Cursors.Default
End Try
End Sub
End Class
End Namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -