mortgage.asmx.vb
来自「Programming Web and Desktop Applications」· VB 代码 · 共 55 行
VB
55 行
Imports System.Web.Services
<WebService(Namespace:="http://localhost/Chapter16/Mortgage/")> _
Public Class Mortgage
Inherits System.Web.Services.WebService
#Region " Web Services Designer Generated Code "
Public Sub New()
MyBase.New()
'This call is required by the Web Services Designer.
InitializeComponent()
'Add your own initialization code after the InitializeComponent() call
End Sub
'Required by the Web Services Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Web Services Designer
'It can be modified using the Web Services Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
'CODEGEN: This procedure is required by the Web Services Designer
'Do not modify it using the code editor.
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
#End Region
<WebMethod(Description:="This method accepts Loan Amount, Interest/year, and Period in Years to compute Monthly Mortgage Payments")> _
Public Function MonthlyPayment(ByVal sngPrincipal As Single, ByVal sngInterest As Single, ByVal intYears As Integer) As Single
'Compute and Return Monthly Payments
sngInterest = sngInterest / 1200
intYears = CInt(intYears * 12)
Return sngPrincipal * (sngInterest _
/ (1 - (1 + sngInterest) ^ -intYears))
End Function
End Class
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?