?? reference.vb
字號:
?'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.42
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict Off
Option Explicit On
Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization
'
'This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50727.42.
'
Namespace net.webservicex.www
'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42"), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Web.Services.WebServiceBindingAttribute(Name:="GlobalWeatherSoap", [Namespace]:="http://www.webserviceX.NET")> _
Partial Public Class GlobalWeather
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
Private GetWeatherOperationCompleted As System.Threading.SendOrPostCallback
Private GetCitiesByCountryOperationCompleted As System.Threading.SendOrPostCallback
Private useDefaultCredentialsSetExplicitly As Boolean
'''<remarks/>
Public Sub New()
MyBase.New
Me.Url = Global.WeatherInfo.My.MySettings.Default.WeatherInfo_net_webservicex_www_GlobalWeather
If (Me.IsLocalFileSystemWebService(Me.Url) = true) Then
Me.UseDefaultCredentials = true
Me.useDefaultCredentialsSetExplicitly = false
Else
Me.useDefaultCredentialsSetExplicitly = true
End If
End Sub
Public Shadows Property Url() As String
Get
Return MyBase.Url
End Get
Set
If (((Me.IsLocalFileSystemWebService(MyBase.Url) = true) _
AndAlso (Me.useDefaultCredentialsSetExplicitly = false)) _
AndAlso (Me.IsLocalFileSystemWebService(value) = false)) Then
MyBase.UseDefaultCredentials = false
End If
MyBase.Url = value
End Set
End Property
Public Shadows Property UseDefaultCredentials() As Boolean
Get
Return MyBase.UseDefaultCredentials
End Get
Set
MyBase.UseDefaultCredentials = value
Me.useDefaultCredentialsSetExplicitly = true
End Set
End Property
'''<remarks/>
Public Event GetWeatherCompleted As GetWeatherCompletedEventHandler
'''<remarks/>
Public Event GetCitiesByCountryCompleted As GetCitiesByCountryCompletedEventHandler
'''<remarks/>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.webserviceX.NET/GetWeather", RequestNamespace:="http://www.webserviceX.NET", ResponseNamespace:="http://www.webserviceX.NET", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Public Function GetWeather(ByVal CityName As String, ByVal CountryName As String) As String
Dim results() As Object = Me.Invoke("GetWeather", New Object() {CityName, CountryName})
Return CType(results(0),String)
End Function
'''<remarks/>
Public Function BeginGetWeather(ByVal CityName As String, ByVal CountryName As String, ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
Return Me.BeginInvoke("GetWeather", New Object() {CityName, CountryName}, callback, asyncState)
End Function
'''<remarks/>
Public Function EndGetWeather(ByVal asyncResult As System.IAsyncResult) As String
Dim results() As Object = Me.EndInvoke(asyncResult)
Return CType(results(0),String)
End Function
'''<remarks/>
Public Overloads Sub GetWeatherAsync(ByVal CityName As String, ByVal CountryName As String)
Me.GetWeatherAsync(CityName, CountryName, Nothing)
End Sub
'''<remarks/>
Public Overloads Sub GetWeatherAsync(ByVal CityName As String, ByVal CountryName As String, ByVal userState As Object)
If (Me.GetWeatherOperationCompleted Is Nothing) Then
Me.GetWeatherOperationCompleted = AddressOf Me.OnGetWeatherOperationCompleted
End If
Me.InvokeAsync("GetWeather", New Object() {CityName, CountryName}, Me.GetWeatherOperationCompleted, userState)
End Sub
Private Sub OnGetWeatherOperationCompleted(ByVal arg As Object)
If (Not (Me.GetWeatherCompletedEvent) Is Nothing) Then
Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
RaiseEvent GetWeatherCompleted(Me, New GetWeatherCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
End If
End Sub
'''<remarks/>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.webserviceX.NET/GetCitiesByCountry", RequestNamespace:="http://www.webserviceX.NET", ResponseNamespace:="http://www.webserviceX.NET", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Public Function GetCitiesByCountry(ByVal CountryName As String) As String
Dim results() As Object = Me.Invoke("GetCitiesByCountry", New Object() {CountryName})
Return CType(results(0),String)
End Function
'''<remarks/>
Public Function BeginGetCitiesByCountry(ByVal CountryName As String, ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
Return Me.BeginInvoke("GetCitiesByCountry", New Object() {CountryName}, callback, asyncState)
End Function
'''<remarks/>
Public Function EndGetCitiesByCountry(ByVal asyncResult As System.IAsyncResult) As String
Dim results() As Object = Me.EndInvoke(asyncResult)
Return CType(results(0),String)
End Function
'''<remarks/>
Public Overloads Sub GetCitiesByCountryAsync(ByVal CountryName As String)
Me.GetCitiesByCountryAsync(CountryName, Nothing)
End Sub
'''<remarks/>
Public Overloads Sub GetCitiesByCountryAsync(ByVal CountryName As String, ByVal userState As Object)
If (Me.GetCitiesByCountryOperationCompleted Is Nothing) Then
Me.GetCitiesByCountryOperationCompleted = AddressOf Me.OnGetCitiesByCountryOperationCompleted
End If
Me.InvokeAsync("GetCitiesByCountry", New Object() {CountryName}, Me.GetCitiesByCountryOperationCompleted, userState)
End Sub
Private Sub OnGetCitiesByCountryOperationCompleted(ByVal arg As Object)
If (Not (Me.GetCitiesByCountryCompletedEvent) Is Nothing) Then
Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
RaiseEvent GetCitiesByCountryCompleted(Me, New GetCitiesByCountryCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
End If
End Sub
'''<remarks/>
Public Shadows Sub CancelAsync(ByVal userState As Object)
MyBase.CancelAsync(userState)
End Sub
Private Function IsLocalFileSystemWebService(ByVal url As String) As Boolean
If ((url Is Nothing) _
OrElse (url Is String.Empty)) Then
Return false
End If
Dim wsUri As System.Uri = New System.Uri(url)
If ((wsUri.Port >= 1024) _
AndAlso (String.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) = 0)) Then
Return true
End If
Return false
End Function
End Class
'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")> _
Public Delegate Sub GetWeatherCompletedEventHandler(ByVal sender As Object, ByVal e As GetWeatherCompletedEventArgs)
'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42"), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code")> _
Partial Public Class GetWeatherCompletedEventArgs
Inherits System.ComponentModel.AsyncCompletedEventArgs
Private results() As Object
Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal userState As Object)
MyBase.New(exception, cancelled, userState)
Me.results = results
End Sub
'''<remarks/>
Public ReadOnly Property Result() As String
Get
Me.RaiseExceptionIfNecessary
Return CType(Me.results(0),String)
End Get
End Property
End Class
'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")> _
Public Delegate Sub GetCitiesByCountryCompletedEventHandler(ByVal sender As Object, ByVal e As GetCitiesByCountryCompletedEventArgs)
'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42"), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code")> _
Partial Public Class GetCitiesByCountryCompletedEventArgs
Inherits System.ComponentModel.AsyncCompletedEventArgs
Private results() As Object
Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal userState As Object)
MyBase.New(exception, cancelled, userState)
Me.results = results
End Sub
'''<remarks/>
Public ReadOnly Property Result() As String
Get
Me.RaiseExceptionIfNecessary
Return CType(Me.results(0),String)
End Get
End Property
End Class
End Namespace
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -